8
0
Skriptentwickung/test/Get-MailboxRights-from-Exchange-for-MailStore.ps1
2024-01-24 16:42:38 +01:00

18 lines
1.5 KiB
PowerShell

$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://mc2-vmx01-com01.mc2.local/PowerShell/ -Authentication Kerberos -Credential $UserCredential
Import-PSSession $Session
$test = Get-Mailbox mkaufmann_hp | Get-MailboxPermission | ?{($_.IsInherited -eq $False) -and -not ($_.User -match NT AUTHORITY) -and -not ($_.User -match NT-AUTORITÄT)} | Select User,@{Name=AccessRights;Expression={$_.AccessRights}}
$test = Get-Mailbox "hkeller" | Get-MailboxPermission | ?{($_.IsInherited -eq $False) -and -not ($_.User -match NT AUTHORITY) -and -not ($_.User -match NT-AUTORITÄT)} | Select User,@{Name=AccessRights;Expression={$_.AccessRights}}
#Get-Mailbox {Zu überprüfende Mailbox} | Get-MailboxPermission -User {AD-Benutzer}
#Get-Mailbox -ResultSize Unlimited |Get-MailboxPermission -User {ADBenutzer} | Format-Table Identity,AccessRights, Deny
#$user =”Krishna.k” get-mailbox -identity $user| Get-MailboxPermission | ?{($_.IsInherited -eq $False) -and -not ($_.User -match “NT AUTHORITY”)}
#Get-mailbox | Get-MailboxPermission | ?{($_.IsInherited -eq $False) -and -not ($_.User -match “NT AUTHORITY”)} |Select User,Identity,@{Name=”AccessRights”;Expression={$_.AccessRights}} | Export-csv C:\mailboxPermission.csv
#im MailStore:
#users-list
#SetUserPrivilegesOnFolder --userName=nvo --folder=mkaufmann --privileges=read
#Remove-PSSession $Session