Guy recommends :
Free Solarwinds
VM Console

Solarwinds VM Console Free Download

Find out which of your VMs are a waste of space and which VMs need more resources.



PowerShell Script - Exchange 2007 Mailcontact

PowerShell Script - Exchange 2007 Mailcontact Create new MailContact with Exchange 2007 System Manger

This page explains how to create Contact and  - Mailcontact objects in Exchange 2007.  If you are looking for a straightforward example to learn Exchange 2007 PowerShell commands, then Mailcontact is an ideal vehicle to practise.  The key verbs are: get, new and disable.

Topics for Mailcontact

 ♣

Walk-through with Exchange Management Console

To begin with, I recommend a walk-through with the Exchange Management Console.  Firstly it will clarify the objects that we are creating, secondly it will alert you to nuances such as Aliases don't have spaces.

Get-Mailcontact

As a prelude, open the PowerShell command prompt and type:

Get-mailcontact (Only Mail enabled objects)
Get-contact (Includes disabled contacts)

Type these commands after you have created a new mail object with the GUI, and again after you employ PowerShell to create the Mail Contact.

Note: As with so many PowerShell nouns contact is both case insensitive and singular.

New-Mailcontact

Our mission is to achieve with PowerShell what you could do manually with the Wizard (See Right).  Once you issue the plain command New-Mailcontact, you need to provide information about:

ExternalEmailAddress:
Name:
Alias:
OrganizationalUnit:

Create New Mail Contact Wizard

Example 1 Create a New Mailcontact called Eddie Jones"

New-Mailcontact
ExternalEmailAddress: ernie@guy-sports.com
Name: Ernie Prost
Alias: ErnieProst
OrganizationalUnit: Droitwich

Once created you should see your new Mailcontact.  Try viewing all such objects try:

Get-mailcontact | ft -autosize name, alias, ExternalEmailAddress.

Note: ft is an alias or shorthand for format-Table.

Guy Recommends:  Solarwinds' Free Bulk Import ToolFree Download of Solarwinds  Bulk Import Tool

Import users from a spreadsheet.  Just provide a list of the users with their fields in the top row, and save as .csv file.  Then launch this FREE utility and match your fields with AD's attributes, click to import the users.  Optionally, you can provide the name of the OU where the new accounts will be born.

There are also two bonus tools in this free download, and all 3 have been approved by Microsoft:

  1. Bulk-import new users into Active Directory.
  2. Seek and zap unwanted user accounts.
  3. Find inactive computers.

Download your FREE bulk import tool.

Disable-Mailcontact

Disabling is different from deleting the object.  Disabled Mail Contacts appear in the Exchange System Manager and can be verified by comparing Get-Mailcontact with Get-Contacts.  You can also confirm by checking the contents of the Disconnected folder in the Exchange Management Console.

Example 2 Disable a Mailcontact

Disable_Mailcontact 'Eddie Jones'

Note: For names with spaces, enclose them with single quotes.

Test your command with Get-Contact.  Compare the results with Get-Mailcontact.  See Exchange Nouns also see Exchange PowerShell Verbs

Exchange Monitor from SolarWindsGuy Recommends: The SolarWinds Exchange Monitor

Here is a free tool to monitor your Exchange Server.  Download and install the utility, then inspect your mail queues, monitor the Exchange server's memory, confirm there is enough disk space and check the CPU utilization. This is the real deal - there is no catch.  SolarWinds provides this fully-functioning product for free, as part of their commitment to supporting the network management community.

Free Download of SolarWinds Exchange Monitor

Summary of Mailcontact

Mailcontact is an Exchange 2007 object and PowerShell noun.  In order to control Mailcontact, master the verbs get, new and disable.

If you like this page then please share it with your friends

 


See more Microsoft PowerShell tutorials

PowerShell Tutorials  • Methods  • Cmdlets  • PS Snapin  • Profile.ps1  • Exchange 2007

Command & Expression Mode  • PowerShell pipeline (|)  • PowerShell 'where'  • PowerShell 'Sort'

If you see an error of any kind, do let me know.  Please report any factual mistakes, grammatical errors or broken links, I will be happy to not only to correct the fault, but also to give you credit.

 *


Custom Search

Guy Recommends: WMI Monitor and It's Free!Solarwinds WMI Monitor

Windows Management Instrumentation (WMI) is one of the hidden treasures of Microsoft operating systems.

Fortunately, Solarwinds have created the Free WMI Monitor so that you can actually see and understand these gems of performance information.  Take the guess work out of which WMI counters to use for applications like Microsoft Active Directory, SQL or Exchange Server.

Download your free copy of WMI Monitor

 

Home Copyright © 1999-2012 Computer Performance LTD All rights reserved

Please report a broken link, or an error.