Jump to content

Recommended Posts

Posted

Hi all,

 

I was wondering whether anyone has go an script or automated way of enabling non-default policies in O365?

 

I have created a number of users and wondered if there are a poweshell commands to change the ABP and other policies?

I have over 1500 users to change....

Posted

Yep I've got a powershell script that we have running every hour during the day to set students policies

 

We chunk the students into groups of 50 based on those that are unlicensed

$users = Get-MsolUser -UnlicensedUsersOnly -Synchronized -MaxResults 50 | Where-Object {$_.UserPrincipalName -like "STU????*" }
if (!($users)) {exit;}

foreach ($user in $users)
{
Set-Mailbox -Identity $user.UserPrincipalName -AddressBookPolicy "ABP_Students" -RoleAssignmentPolicy "Pupil Role Assignment Policy" -SharingPolicy "Pupil Sharing Policy"
#Set the OWA Mailbox Policy
Set-CASMailbox -Identity $user.UserPrincipalName -OwaMailboxPolicy "Pupils"
}

  • Thanks 1

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 account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...