#This script get group members and check for users that is not enabled for lync and enable these users using e-mail address

Import-Module activedirectory
Import-Module lync
$groupmember = Get-ADGroupMember lync
foreach ($member in $groupmember)
{
$aduser = Get-CsAdUser -Identity $member.Name | Where-Object {$_.enabled -ne "true"}
if($aduser -ne $())
{
Enable-CsUser -identity $aduser.identity -RegistrarPool lyncse.coex.com -SipAddressType emailaddress
}
}