I don't know of any "one" command, but you can script it. Something
like this should work...not tested, and you would have to input your
appropriate settings (IE your domain/user/OCS ADS):
# Bind to the user Object
$objUser = [ADSI]"LDAP://CN=John Doe,OU=TestOUUsers,OU=domain,DC=com"
# Set Variables
# 256 = EnabledForEnhancedPresence
$strPrimaryHomeServer = "CN=LC
Services,CN=Microsoft,CN=ocs,CN=Pools,CN=RTC
Service,CN=Services,CN=Configuration,DC=domain,DC=com"
$strPrimaryUserAddress = ("sip:" + $objUser.mail)
$bInternetAccessEnabled = False
$nOptionFlags = 256
# Set General Tab Properties
$objUser.Put("msRTCSIP-PrimaryUserAddress", $strPrimaryUserAddress)
$objUser.Put("msRTCSIP-InternetAccessEnabled",
$bInternetAccessEnabled)
$objUser.Put("msRTCSIP-OptionFlags", $nOptionFlags)
$objUser.Put("msRTCSIP-PrimaryHomeServer", $strPrimaryHomeServer)
$objUser.Put("msRTCSIP-UserEnabled", True)
# Commit changes
$objUser.setInfo()
And if you wanted to have an input for a user instead of modifying
settings every time, you could do this:
# Input for username to search
$User = Read-Host “Enter the Users’ Logon Name to enable for OCS”
# Search for the username
$Search = New-Object DirectoryServices.DirectorySearcher([ADSI]“”)
$Search.filter = “(&(objectClass=user)(sAMAccountName=$User))”
$results = $Search.Findall()
Foreach($result in $results){
$objUser = $result.GetDirectoryEntry()
# Set Variables
# 256 = EnabledForEnhancedPresence
$strPrimaryHomeServer = "CN=LC
Services,CN=Microsoft,CN=ocs,CN=Pools,CN=RTC
Service,CN=Services,CN=Configuration,DC=domain,DC=com"
$strPrimaryUserAddress = ("sip:" + $objUser.mail)
$bInternetAccessEnabled = False
$nOptionFlags = 256
# Set and enable OCS settings