Windows PowerShell for OCS 2007 R2

The big launch event for Lync Server 2010 is only two days away. But just to reassure everyone that we haven’t forgotten about all of you out there who are running Office Communications Server 2007 R2, we decided to give you your own little section of this site. Yes, true, the Lync Server PowerShell blog…

0

Administratively Managing User Contact Lists

WMI Namespaces and Scripting Examples   By Nick Smith, Microsoft   Introduction   Your company has a requirement to administratively add/remove/modify the membership of Microsoft Office Communications Server 2007 R2 users’ contact lists.  This document provides Windows PowerShell scripting examples for managing OCS users’ contact lists via the supported Windows Management Instrumentation (WMI) namespaces.  The…

14

Remove a Contact

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 #Get User Information $User = Get-WmiObject -Query “Select * from MSFT_SIPESUserSetting where PrimaryURI = ‘sip:user@domain.com'”   #Get the contact on the user’s contact list $Contact…

0

Check if a Contact Exists

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 #Get User Information $User = Get-WmiObject -Query “Select * from MSFT_SIPESUserSetting where PrimaryURI = ‘sip:user@domain.com'” $UserInstanceID = $User.InstanceID   #Check if contact is already…

0

Add a Contact

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 #Get User Information $User = Get-WmiObject -Query “Select * from MSFT_SIPESUserSetting where PrimaryURI = ‘sip:user@domain.com'” $UserInstanceID = $User.InstanceID    #Create Contact instance $Contact =…

1

Remove a Contact Distribution Group

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 #Get User Information $User = Get-WmiObject -Query “Select * from MSFT_SIPESUserSetting where PrimaryURI = ‘sip:user@domain.com'”   #Get the contact group on the user’s contact…

0

Check if a Contact Distribution Group Exists

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 #Get User Information $User = Get-WmiObject -Query “Select * from MSFT_SIPESUserSetting where PrimaryURI = ‘sip:user@domain.com'” $UserInstanceID = $User.InstanceID   #Check if group is already…

0

Add a Contact Distribution Group

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 *…

0

Remove a Contact Group

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 #Get User Information $User = Get-WmiObject -Query “Select * from MSFT_SIPESUserSetting where PrimaryURI = ‘sip:user@domain.com'”   #Get the contact group on the…

0

Check if a Contact Group Exists

For more information on using this script, see the article Adminstratively Managing User Contact Lists by Nick Smith.   #Support Versions: Office Communications Server 2007 R2 #Get User Information $User = Get-WmiObject -Query “Select * from MSFT_SIPESUserSetting where PrimaryURI = ‘sip:user@domain.com'” $UserInstanceID = $User.InstanceID   #Check if group is already added to user’s contact list…

0