Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ajtrichards/162dd0d87be55bda6d2b88fdd473ab25 to your computer and use it in GitHub Desktop.
Save ajtrichards/162dd0d87be55bda6d2b88fdd473ab25 to your computer and use it in GitHub Desktop.
Powershell command to find all users in the Office365 installation and update the calendar permission to show Limited Details.
pwsh -Command 'Install-Module -Name PSWSMan'
pwsh -Command 'Install-Module -Name ExchangeOnlineManagement'
sudo pwsh -Command 'Install-WSMan'
Connect-ExchangeOnline -UserPrincipalName YOUR_EMAIL_ADDRESS
foreach($user in Get-Mailbox -RecipientTypeDetails UserMailbox) {
$cal = $user.alias+":\calendar"
write-host $cal
Set-MailboxFolderPermission -Identity $cal -User Default -AccessRights LimitedDetails
}
@ajtrichards
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment