The security is important; working for a huge company sometimes causes problems. You get less right, because of the security. If you a normal user, and you would like to check if one of the user enabled for OCS without Admin rights or Universal Server Administrator right. A normal domain user can check it, because the AD readable for all AD users.
Here is my script, all line commented.
#set the argument #Usage: ./Check_if_OCS_enabled.ps1 <User Identity> Param ( [string]$Identity ) #PowerShell AD module needed Import-Module ActiveDirectory #get OCS SIP URI of the user $a = get-aduser -filter { ObjectClass -eq "user" -and SamAccountName -eq $Identity } -property msRTCSIP-PrimaryUserAddress #if the SIP URI empty, the user not enabled for OCS If ($a."msRTCSIP-PrimaryUserAddress" -ne $null) {Write-Host "Enabled for OCS"} Else {Write-Host "Not enabled for OCS"}
That’s ALL