Howto import all domain users into Microsoft Lync 2010/2013

Howto import all domain users into Microsoft Lync 2010/2013

While working with Microsoft Lync Server, you will have a basic task you cannot perform quite quickly from GUI - enabling domain users in Lync Server, so that they can log in with client software.

It seems that in Microsoft they think we must solve this issue with powershell scripts.

I propose to you my solution.
 

# script needs a parameter - a domain name. For example, if you have domain "domain1.domain.local", then you will need to provide "domain1" as parameter.

import-module Lync;
if (!$args[0]) {
    Write-Host "Parameter was not defined!";
} else {
    $domain = $args[0];
    Get-CsAdUser | where {$_.DistinguishedName -like "*dc=$domain*" -and $_.Enabled -ne $true -and $_.UserAccountControl -notlike "*AccountDisabled*"} | Enable-CsUser -RegistrarPool "pool1.domain.local" -SipAddressType EmailAddress;
}


Script will take domain users that are not disabled $_.UserAccountControl -notlike "*AccountDisabled*" and that are not enabled in Lync already $_.Enabled -ne $true. SipAddress will be the same as the email attribute.

Thats it! Then just create a scheduled task with this script and have a coffee-brake.

lync (ru), lync 2013 (ru), lync 2010 (ru)

  • Hits: 3043
Add comment

Related Articles