if ($Office365 -ne "True") { Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010 Add-PSSnapin Microsoft.Exchange.Management.PowerShell.Setup Add-PSSnapin Microsoft.Exchange.Management.Powershell.Support } Write-Host "***************************************************************************" Write-Host "* Script zum Abfragen der Mailbox-Rechte über eine oder mehrere Mailboxen *" Write-Host "***************************************************************************" Write-Host "* Eingabe der Mailbox nach Name oder Parameter: *" Write-Host "* *" Write-Host "* Eingabe: many Es wird ein zusätzlicher Filter für den Namen abgefragt *" Write-Host "* Eingabe: all Es werden alle Mailboxen abgefragt! *" Write-Host "***************************************************************************" $Box = Read-Host "Geben Sie die Zielmailbox ein" if ($Box -eq "many") { $Filter = Read-Host "Suchfilter für die Mailboxen" $users = Get-Mailbox -RecipientTypeDetails UserMailbox | Where-Object { $_.name -match $Filter } ForEach ($mailbox in $users) { Get-MailboxPermission -Identity $mailbox.SamAccountName } } elseif ($Box -eq "all") { $users = Get-Mailbox -RecipientTypeDetails UserMailbox ForEach ($mailbox in $users) { Get-MailboxPermission -Identity $mailbox.SamAccountName } } else { Get-MailboxPermission -Identity $Box } Read-Host 'Press Enter to continue...' | Out-Null