mdrabble Posted March 4, 2020 Posted March 4, 2020 Can only add 20 users at a time to a PolicyPackage using the web interface - which will take ages........ So I thought Powershell should be able to do this...... but I am failing! When I try the command New-CsBatchPolicyPackageAssignmentOperation -PackageName Education_Teacher -Identity $name I get an error - New-CsBatchPolicyPackageAssignmentOperation : Not authorized. How have people assigned PolicyPackages to staff and students? Cheers
Popular Post mdrabble Posted March 4, 2020 Author Popular Post Posted March 4, 2020 Sorted it.... using the wrong powershell command! Here is my script for assigning the Policy Package Education (Teacher) to all teaching staff. $cred = Get-Credential "[email protected]" Connect-AzureAD -Credential $cred Connect-MicrosoftTeams -Credential $cred #Change Teaching Staff to your selected AD Group $group = Get-AzureADGroup -SearchString "Teaching Staff" $members = Get-AzureADGroupMember -ObjectId $group.ObjectId -All $true | Where-Object {$_.ObjectType -eq "User"} #Name : Education_Teacher #Description : This is an Education_Teacher package # #Name : Education_SecondaryStudent #Description : This is an Education_SecondaryStudent package #Change the PackageName to your chosen package $members | ForEach-Object { Grant-CsUserPolicyPackage -PackageName Education_Teacher -Identity $_.UserPrincipalName} Nothing fancy but hope it helps others. 6
CyBeRkId2002 Posted March 12, 2020 Posted March 12, 2020 Anyone struggling to get this to work? I get the following error (even when just trying to run Grant-CsUserPolicyPackage manually): Grant-CsUserPolicyPackage : One or more errors occurred. At line:1 char:1 + Grant-CsUserPolicyPackage + ~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: ( [Grant-CsUserPolicyPackage], AggregateException + FullyQualifiedErrorId : System.AggregateException,Microsoft.TeamsCmdlets.PowerShell.Custom.GrantCsUserPolicyPackage
TechMonkey Posted March 12, 2020 Posted March 12, 2020 How have people edited the Policy Package. I can't seem to see anyway to create my own or edit the ones already there. Check your groups as I found at one point it can't handle nested groups.
mdrabble Posted March 12, 2020 Author Posted March 12, 2020 How have people edited the Policy Package. I can't seem to see anyway to create my own or edit the ones already there. Check your groups as I found at one point it can't handle nested groups. I've just used the ones they provided, as they seemed to do the job etc. Didn't think about nested groups to be honest as I enabled per year group so I could keep track where I was up to. 1
mdrabble Posted March 12, 2020 Author Posted March 12, 2020 Anyone struggling to get this to work? I get the following error (even when just trying to run Grant-CsUserPolicyPackage manually): Grant-CsUserPolicyPackage : One or more errors occurred. At line:1 char:1 + Grant-CsUserPolicyPackage + ~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: ( [Grant-CsUserPolicyPackage], AggregateException + FullyQualifiedErrorId : System.AggregateException,Microsoft.TeamsCmdlets.PowerShell.Custom.GrantCsUserPolicyPackage @CyBeRkId2002 Sorry - forgot about that issue I had initally Take a look at this https://answers.microsoft.com/en-us/msoffice/forum/all/connect-microsoftteams-not-working/f3235724-ec03-4a9e-9679-40afa89bf956 1
sparsonsCHS Posted March 12, 2020 Posted March 12, 2020 I don't think you can create your own, or amend the existing packages but you can amend the individual policies from the individual policy pages. So you can apply the Education Secondary Student policy package to a user and then amend the Education Secondary Student Meeting Policy for example. 1
CyBeRkId2002 Posted March 12, 2020 Posted March 12, 2020 @CyBeRkId2002 Sorry - forgot about that issue I had initally Take a look at this https://answers.microsoft.com/en-us/msoffice/forum/all/connect-microsoftteams-not-working/f3235724-ec03-4a9e-9679-40afa89bf956 All sorted now! Cheers. Out of curiosity, how long after applying policies does it take to propagate to users? Certainly not instant if here is anything to go by.
RobFuller Posted March 12, 2020 Posted March 12, 2020 Sorted it.... using the wrong powershell command! Here is my script for assigning the Policy Package Education (Teacher) to all teaching staff. $cred = Get-Credential "[email protected]" Connect-AzureAD -Credential $cred Connect-MicrosoftTeams -Credential $cred #Change Teaching Staff to your selected AD Group $group = Get-AzureADGroup -SearchString "Teaching Staff" $members = Get-AzureADGroupMember -ObjectId $group.ObjectId -All $true | Where-Object {$_.ObjectType -eq "User"} #Name : Education_Teacher #Description : This is an Education_Teacher package # #Name : Education_SecondaryStudent #Description : This is an Education_SecondaryStudent package #Change the PackageName to your chosen package $members | ForEach-Object { Grant-CsUserPolicyPackage -PackageName Education_Teacher -Identity $_.UserPrincipalName} Nothing fancy but hope it helps others. Why can you not apply this per group Microsoft instead of individually.
IT_JB Posted March 12, 2020 Posted March 12, 2020 How have people edited the Policy Package. I can't seem to see anyway to create my own or edit the ones already there. Check your groups as I found at one point it can't handle nested groups. After you apply the package to a user it will then make the individual policies editable. It can take a few hours. 1
chazzy2501 Posted March 16, 2020 Posted March 16, 2020 (edited) I'm confused no-one has any policies applied yet, I've used SDS and teachers WITH classes seem to be able to also create new classes and my test teacher and admin staff seem to have a locked down do nothing policy. All users I've checked have global on the left and assigned policy none.. but they have different teams experiences? I'ev manually given myself and my test teacher the "teacher" policy but nothing has changed still can't create a meeting. I did the test teacher before the weekend so it should have taken affect by now?! Help.. I'll apply that script up there in a bit (but as things are mostly working fine, I'm reluctant) EDIT: test Teacher seems all good now? Whilst looking around the left side options suddenly populated and all options seem correct. My personal account not so much. Edited March 16, 2020 by chazzy2501
TechMonkey Posted March 16, 2020 Posted March 16, 2020 I don't think you can create your own, or amend the existing packages but you can amend the individual policies from the individual policy pages. So you can apply the Education Secondary Student policy package to a user and then amend the Education Secondary Student Meeting Policy for example. You can only edit once the Package has been applied. Which is helpful! Many thanks
sparsonsCHS Posted March 16, 2020 Posted March 16, 2020 You can only edit once the Package has been applied. Which is helpful! Many thanks Yes, that's true - forgot to mention that! Apply the package (you can do this individually to a user) then it will let you edit.
artfulmatt Posted April 3, 2020 Posted April 3, 2020 Just what im after, but were getting the error that Grant-CSUserPolicy wasn't a recognized command....even though Teams was an imported module. Uninstalled the module, then tried to add again and now get this error? WARNING: Source Location 'https://www.powershellgallery.com/api/v2/package/MicrosoftTeams/1.0.5' is not valid.
artfulmatt Posted April 3, 2020 Posted April 3, 2020 Yeah tried that and exact same error? I won't install any module ???
browolf Posted September 17, 2020 Posted September 17, 2020 how long does New-CsBatchPolicyPackageAssignmentOperation take? I did 1500 pupils yesterday but it's still "in progress"
psydii Posted September 17, 2020 Posted September 17, 2020 We had this. I logged a ticket and they unstuck it.
AliG Posted September 17, 2020 Posted September 17, 2020 You can apply policies using groups assignment now if it helps?
RobFuller Posted September 17, 2020 Posted September 17, 2020 Add can also be done via the admin web gui very quickly!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now