Thursday, September 24, 2015

Creating and modifying Contact Groups with EWS and Powershell

Mailbox Contact Groups have been around for a while and while there are a number of other Group options in Exchange from a users point of view these are still one of the most efficient ways of creating Distribution groups. I've updated my EWS PowerShell Contacts module to support creating and modifying Contact Groups. So using this module you can now

Create a ContactGroup in the default contacts folder of a Mailbox

Create-ContactGroup -Mailboxname -GroupName GroupName -Members ("","")

Add more Members to that Group

$Group = Get-ContactGroup -Mailboxname -GroupName GroupName $Group.Members.Add("")

This was just using the generic Add method but there are a number of methods for adding different types of contacts such as MailEnalbed Public Folders,ContactGroups,Directory Users etc see

Delete the Group
$Group = Get-ContactGroup -Mailboxname -GroupName GroupName

 The Contacts Module is up on GitHub you can download a zip from here