Set-Contact is a nifty PowerShell cmdlet for modifying an existing Exchange
contact object.
If you are changing multiple contacts then you could employ a second PowerShell cmdlet such as
Get-Contact; the technique is to pipe its output into Set-Contact.
Remember that the 'Set' verb makes changes, thus if you it's your first
time, I recommend you check with the corresponding Get-Contact first. Another technique is to wade straight in with
Set-Contact, but append the -WhatIf parameter until you are sure that the
modifications are what you expected.
One of the best features of PowerShell is piping. In this instance obtain a flow
of 'Leads' using another cmdlet, and stream them into Set-Contact so that
you can
adjust their 'Department" value.
Note 2a: An alternative source cmdlet is Get-Mailbox,
the piping techique would be the same as in the above script.
Guy Recommends: SolarWinds' Free Bulk Mailbox Import Tool
Import users from a spreadsheet, complete with their mailbox. Just provide a list of the
users with the fields in the
top row, and save as .csv file. Then launch this FREE utility, match
your Exchange fields with AD's
attributes, click and import the users. Optionally, you can
provide the name of the OU where the new mailboxes will be born.
There are also two bonus tools in the free download, and all 3 have been approved by Microsoft:
Bulk-import new users and mailboxes into Active Directory.
I like to take a walk-through of the EMC (Exchange Management Console),
the benefit is that I can compare the
PowerShell script with what's in the Exchange GUI.
Launch the EMC, navigate to the Recipient Configuration, Mail
Contact (see
screenshot right)
PowerShell New-Mailcontact
It's also possible to create new contacts.
# Create a Contact with PowerShell New-Mailcontact -Name Guido
Smith ` -ExternalEmailAddress:
Guido@guy-sport.com ` -OrganizationalUnit Worcester -Alias GuidoSm
If you created a Mail Contact manually, then Get-mailcontact should display the name, both objects. Get-mailcontact
| Format-Table name, alias, ExternalEmailAddress -autosize.
Note
1: In PowerShell nouns are singular.
In order to disable a mailcontact you need its Alias or DN. For example Disable-Mailcontact
Martha Jones
Note disable is different from delete.
If you wished to delete a mailcontact then the command is:
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 freebie, as part of their commitment to supporting
the network management community.
Windows Management Instrumentation (WMI) is
most useful for PowerShell scripting.
SolarWinds
have produced this
Free WMI Monitor to take the guess work out of which
WMI counters to use for applications like Microsoft Active Directory,
SQL or Exchange Server.