Import-Module activedirectoryReferences:
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}
RSAT with SP1
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=7d2f6ad7-656b-4313-a005-4e344e43997d&displaylang=en
5 comments:
Trying to do this and get the following after modifying it for my domain:
cmdlet Get-ADUser at command pipeline position 1
Supply values for the following parameters:
(Type !? for Help.)
Filter:
Any ideas?
I get the same error! :(
Sorry for the delay guys. After taking a look at it I forgot to copy the filter property: -Filter *.
I use * for all users but if you needed you can exclude users using that filter property.
I updated the post to reflect this and good luck on your Lync deployments.
Hi Patrick
Thanks for your script it's helping a lot, one question, if I want an export of notifications which could not be enabled what would I need to add ?
Dewalt,
I would use a output variable to store the results. If enable-csuser throws exceptions instead of powershell then you will have to use Try Catch or what I could only think would be easier compare your AD User base to your CSUser enabled users.
Taking Results
$output = Get-ADUser -Filter * -SearchBase "OU=MyUsers,dc=domain,dc=com" | foreach {Enable-CsUser -RegistrarPool "LyncPool1.domain.com" -SipAddressType EmailAddress -SipDomain "domain.com" -Identity $_.SamAccountName}
Or
Import-Module activedirectoy
Import-Module lync
$adusers = Get-ADUser -Filter * -SearchBase "OU=MyUsers,dc=domain,dc=com"
$csusers = Get-CsUser
$diffusers = Compare-Object -ReferenceObject $adusers -DifferenceObject $csusers -Property SamAccountName
Post a Comment