none
Assign policy options to all Skype for Business users RRS feed

  • Question

  • I am trying to use the following short script to assign a default policy option to all of our Skype for Business online users.

    ForEach ($SolUser in Get-CsOnlineUser) {
    Grant-CsConferencingPolicy -Identity $SolUser -Verbose -PolicyName BposSDataProtection -WhatIf 
    }

    The problem seems to be that Get-CsOnlineUser returns the SID which Grant-CsConferencingPolicy does not accept for the identity parameter.  I can use "Display Name", UPN or SIP, but can't find a way to retrieve it.

    Thanks for any insight.

    Wednesday, December 14, 2016 8:57 PM

Answers

  • Posting the solution.  This code snippet sets a policy that restricts file sharing over Skype for Business, but can be amended to apply to any Skype for Business policy.

    ForEach ($SolUser in Get-CsOnlineUser -Filter {ProvisionedPlan -ne $null} -ResultSize unlimited ) {
    Grant-CsConferencingPolicy -Identity $SolUser.UserPrincipalName -Verbose -PolicyName BposSDataProtection
    }

    • Marked as answer by art Alexion Wednesday, December 21, 2016 6:50 PM
    Wednesday, December 21, 2016 6:50 PM

All replies

  • I believe that I fixed it by adding .UserPrincipalName to $SolUser as follows

    ForEach ($SolUser in Get-CsOnlineUser) {
    Grant-CsConferencingPolicy -Identity $SolUser.UserPrincipalName -Verbose -PolicyName BposSDataProtection -WhatIf 
    }

    I believe that it is going to do its job, but I still need to figure out how to filter for only licensed users in order to suppress errors.

    Wednesday, December 14, 2016 9:27 PM
  • You would do much better posting in the Skype forum for assistance with Skype For Business shell.

    https://social.technet.microsoft.com/Forums/lync/en-US/home?forum=sfbfr


    \_(ツ)_/

    Wednesday, December 14, 2016 9:57 PM
  • Thanks. Relatively new to the forums. I think I accidentally cross posted. Anyway, I solved the problem. Should I post the complete solution?
    Thursday, December 15, 2016 6:59 PM
  • Posting the solution.  This code snippet sets a policy that restricts file sharing over Skype for Business, but can be amended to apply to any Skype for Business policy.

    ForEach ($SolUser in Get-CsOnlineUser -Filter {ProvisionedPlan -ne $null} -ResultSize unlimited ) {
    Grant-CsConferencingPolicy -Identity $SolUser.UserPrincipalName -Verbose -PolicyName BposSDataProtection
    }

    • Marked as answer by art Alexion Wednesday, December 21, 2016 6:50 PM
    Wednesday, December 21, 2016 6:50 PM