Add a Contact Group
Published May 20 2019 02:39 PM 135 Views
Occasional Visitor
First published on TECHNET on Nov 12, 2010

For more information on using this script, see the article Adminstratively Managing User Contact Lists by Nick Smith.

#Contributed by Nick Smith, Microsoft

#Supported Versions: Office Communications Server 2007 R2

#Define WMI Put options

$PutOptions = New-Object System.Management.PutOptions

$PutOptions .Type = 2 #CreateOnly

#Get User Information

$User = Get-WmiObject -Query "Select * from MSFT_SIPESUserSetting where PrimaryURI = 'sip: '"

#Create ContactGroup instance

$ContactGroup = ( New-Object System.Management.ManagementClass ( "MSFT_SIPESUserContactGroupData" )).CreateInstance()

$ContactGroup .UserInstanceID = $User .InstanceID

$ContactGroup .Name = " NAME OF GROUP HERE "

#Create and commit group

$ContactGroup .PsBase.Put( $PutOptions)

Version history
Last update:
‎May 20 2019 02:39 PM
Updated by: