The Blown Light Bulb

Information worth to share...


Useful cmdlet commands for Exchange

Do you use to deal with Exchange? Probably, as an Exchange administrator, creating, modifying and removing distribution groups are some of your daily tasks. If you hate clicking around and Exchange console navigation, there are quick and easy ways to complete these tasks from the cmdlet.

To help you with this, here you have some common task cmdlet commands to deal with your day-to-day with Exchange, I hope you will enjoy them.

Create a distribution mail-enabled group
To create distribution mail-enabled groups. In this example I want to create a group called Engineers on the Distribution OU and managed by Peter Shlauss.

new-DistributionGroup -Name ‘Engineers’ -Type ‘Distribution’ -OrganizationalUnit ‘mydomain.net/Distribution Groups’ -SamAccountName ‘Engineers’ -Alias ‘Engineers’ –ManagedBy ‘PeterS’

Add or update “Managed By” field on a distribution mail-enabled group
To modify group object settings visible in Active Directory Users and Computers. In this example I want to change previous created distribution group Managed By field to John Suárez.

Set-Group -Identity ‘Engineers’ -ManagedBy “JohnS”

**_Activate “Manager can update membership list” checkbox
_**Letting managers update the membership list of a distribution mail-enabled group, means giving them write permissions on the AD group object. In this example I want to give permissions to John Suárez to update the membership list of our previous created distribution list.

Add-ADPermission -Identity ‘Engineers’ -User ‘JohnS’ -AccessRights WriteProperty -Properties “Member”

Add or update members **_on a distribution mail-enabled group
_**To add a recipient (also called members) to a distribution group. In this example I want to add Peter Schlauss, Maira Tays and John Suárez to our newly created group.

“PeterS",“MairaT”,“JohnS” | Add-distributiongroupmember -domaincontroller “DC.mydomain.net” -identity ‘Engineers’

Remove members **_on a distribution mail-enabled group
_**To remove an existing recipient (also called members) from a distribution group. In this example I want to remove Peter Schlauss and Maira Tays from our newly created group.

“PeterS",“MairaT” | Remove-distributiongroupmember -domaincontroller “DC.mydomain.net” -identity ‘Engineers’

Remove a distribution mail-enabled group
To delete an existing distribution group from Active Directory. In this example I want to remove the distribution group Engineers from AD.

Remove-DistributionGroup –Identity ‘Engineers’

Finally, in case you cannot wait until next nightly maintenance, Offline Address Book can be forcibly updated with a simple command.

**_Update Offline Address Books (AOBs)
_**To update the Offline Address Books (AOBs) used by Microsoft Outlook Clients.In this example I want to update the AOB called Default Offline Address List.

Update-OfflineAddressBook -Identity “Default Offline Address List”

More information is available in Exchange 2010 Cmdlets (TechNet).