Quantcast
Channel: Let IT know » ocs 2007 r2
Viewing all articles
Browse latest Browse all 4

Check OCS/Lync enabled AD user with PowerShell

$
0
0

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

)

&nbsp;

#PowerShell AD module needed

Import-Module ActiveDirectory

&nbsp;

#get OCS SIP URI of the user

$a = get-aduser -filter { ObjectClass -eq "user" -and SamAccountName -eq $Identity } -property msRTCSIP-PrimaryUserAddress

&nbsp;

#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



Viewing all articles
Browse latest Browse all 4

Latest Images

Trending Articles





Latest Images