Wednesday, June 1, 2011

Lync 2010 - Enabling All Users in OU

Here is a quick script to enable all users in Lync 2010. To run this all on one computer you need to have Lync Tools and RSAT on it. This script is enabling all users using their EmailAddress as their SIP address. Change out domain with your domain name and Myusers with your OU or Container. The LyncPool1.domain.com is  your Lync Pool FQDN.
Import-Module activedirectory
Import-Module Lync
Get-ADUser -Filter * -SearchBase "OU=MyUsers,dc=domain,dc=com" | foreach {Enable-CsUser -RegistrarPool "LyncPool1.domain.com" -SipAddressType EmailAddress -SipDomain "domain.com" -Identity $_.SamAccountName}
References:
RSAT with SP1
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=7d2f6ad7-656b-4313-a005-4e344e43997d&displaylang=en