Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Find all Exchange mailboxes on which user "$adUser" has "$accRights" access rights
- # First expression just to narrow search from 'А*' to 'Я*' (from first to last letter;
- # Russian mailbox identities have names like "Алла Пугачёва" or "Яков Свердлов")
- $adUser = 'domain\User'
- $accRights = 'FullAccess'
- [int][char]'а'..[int][char]'я' | foreach { get-mailbox "$([char]$_)*" -erroraction SilentlyContinue | Get-MailboxPermission | where { ($_.AccessRights -contains $accRights ) -and ($_.User -like $adUser) } } | ft Identity, User, AccessRights
Add Comment
Please, Sign In to add comment