First you will need to connect to the following 365 services and bypass the security in powershell for the process
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
Connect-ExchangeOnline
Connect-MsolService
Then run this
Get-EXOMailbox -Filter {recipienttypedetails -eq "SharedMailbox"} | get-MsolUser | Select-Object UserPrincipalName,blockcredential | Where {$_.BlockCredential -eq $False} | ForEach-Object { Set-MsolUser -UserPrincipalName $_.UserPrincipalName -BlockCredential $true}
No comments:
Post a Comment