Created
August 16, 2022 11:16
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Users the the
Connect-ExchangeOnline
command detailed here: https://docs.microsoft.com/en-us/powershell/module/exchange/connect-exchangeonline?view=exchange-psAlso uses the
foreach
from from: https://www.2azure.nl/2019/10/20/exchange-online-set-default-calendar-sharing-permissions-for-all-users/