Granting Lync Polcies Via AD Group Member using PowerShell

459 views Asked by At

I am trying to grant MS Lync policies based on AD group membership. So far I have arrived at the following command but it fails to execute as desired.

Get-ADGroupMember -Identity "Name_Of_AD_Security_Group" | Grant-CsPersistentChatPolicy -PolicyName "Name_Of_Policy"

I know that the Grant-Cs... command will take a pipeline input but I suspect the AD output does not match the required input for the Lync command.

Would anyone have a better command of know of a way to transform the output into the correct input format?

1

There are 1 answers

0
Booga Roo On

I don't have access to Lync Powershell modules, but I noticed that the command you're wanting to run accepts output from Get-CsUser on its TechNet page.

See if this works:

Get-ADGroupMember -Identity "Name_Of_AD_Security_Group" | Get-CsUser

If it doesn't, try:

Get-ADGroupMember -Identity "Name_Of_AD_Security_Group" | Select-Object SamAccountName | Get-CsUser

Based on which works(if either do):

Get-ADGroupMember -Identity "Name_Of_AD_Security_Group" | Get-CsUser | Grant-CsPersistentChatPolicy -PolicyName "Name_Of_Policy"

or

Get-ADGroupMember -Identity "Name_Of_AD_Security_Group" | Select-Object SamAccountName | Get-CsUser | Grant-CsPersistentChatPolicy -PolicyName "Name_Of_Policy"