$credentials = Get-Credential -Credential pnovotny@lotraco.cz Write-Output "Getting the Exchange Online cmdlets" $Session = New-PSSession -ConnectionUri https://outlook.office365.com/powershell-liveid/ ` -ConfigurationName Microsoft.Exchange -Credential $credentials ` -Authentication Basic -AllowRedirection Import-PSSession $Session Get-Mailbox -RecipientTypeDetails UserMailbox -ResultSize Unlimited | Foreach-Object{ $mbx = $_ | Select ExchangeGuid, UserPrincipalName, DataBase $userFolder = $_.alias +":\Kalendář" Set-MailboxFolderPermission -Identity $userFolder -User Default -AccessRights Reviewer }