Bulk Lync User Addition via Powershell

When enabling users for the first time in Lync, we get a lot of requests for bulk enabling based on group membership or other factors.  If this is something you would like to do, you don’t need a tool, just check out the powerful get-csaduser and get-adgroupmember commands in Powershell: http://technet.microsoft.com/en-us/library/gg398592.aspx

Here’s a sample command to get you started on enabling users by group:

get-adgroupmember -identity “your group” |foreach {get-adus
er $_.samaccountname | foreach {enable-csuser -identity $_.userprincipalname -re
gistrarpool yourpool.domain.com -sipaddresstype samaccountname -sipdomain domain.com}}


If you wanted to enable all users by OU try this:

Get-CsADUser -OU “ou=Your OU Name,dc=domain,dc=com” | enable-csuser -registrarpool “Yourpool.domain.com” -sipaddresstype emailaddress


(Note: Edited June 6, 2014 because I found a group enablement command that I liked better)

6 thoughts on “Bulk Lync User Addition via Powershell

  1. Dawn

    This is what I’m looking for except I want to only search the one OU and not include any nested. I know with get-aduser searchscope 1 works but it does not with get-csaduser. And in my testing get-aduser does not work as nicely with enable-csuser. Is there a parameter to use for get-csaduser to search only for the OU listed?
    Thank you

    1. C. Anthony Caragol Post author

      Sorry for the delay, I hand filter a lot of spam in the comments and it takes me a while to sort through it all 🙂

      I’d suggest sticking with Get-ADUser. Try something like this:
      Get-ADUser -SearchBase “OU=My Deeper OU,OU=My OU,DC=domain,DC=com” -Filter * -SearchScope 1 | ForEach-Object {Enable-CSUser -identity $_.userprincipalname -registrarpool pool.domain.com -sipaddresstype samaccountname -sipdomain domain.com }

      Add -whatif with Enable-CSUser to test.

  2. James

    Is there a way to get just adgroupmember where they are not yet added to Lync? Perhaps a Where SIPAddr=NULL or something? This would allow us to run nightly a script to get any “new” employees who have not already been added to Lync and get them setup. Thanks!

    1. C. Anthony Caragol Post author

      Sure, Skype for Business Server 2015 you can (2016 is the Office client).

Comments are closed.