25 March, 2012

Useful power shell command

Hello Friends,



While performing Administrative duty, We require to enable, disable, Lync user list, Specific OU user list etc task multiple time. GUI mode is not good option. Instead GUI you can use CMDLETS,


Here are the lists of cmdlet which are getting use daily basis.

The difference between Get-CsUser and Get-CsAdUser:


Both cmdlets return information about Lync users. Use Get-CsUser unless you require access to the generic AD attributes, or if the user has not been enabled for Lync Server
Show all the properties returned by Get-CsUser:

Get-CsUser
Get-Member

Show the number of Lync enabled users:

@(Get-CsUser).Count

Get all AD users who are not, and who have never been, enabled for Lync or OCS:

Get-CsAdUser -Filter {Enabled -eq $null}
Format-Table -Wrap

Get users who are disabled for Lync or OCS:

Get-CsAdUser -Filter {Enabled -eq $False}

Get all users who have been enabled for Lync or OCS but are not currently assigned to a registrar pool.

Get-CsUser -UnassignedUser

Get all Lync Users in the 'Sales' Department (You may change sales name with any other name):

Get-CsUser -LDAPFilter 'Department=Sales'



Thank you!

No comments:

Post a Comment

Your feedback is always appreciated. I will try to reply to your queries as soon as possible- Amol Ghuge

Note: Only a member of this blog may post a comment.