Fix missing } and unabbreviated
This commit is contained in:
parent
6b228fa6cb
commit
13f5b7c06b
@ -165,8 +165,8 @@ do
|
|||||||
displayname = $mailbox.DisplayName
|
displayname = $mailbox.DisplayName
|
||||||
emailAddress = $mailbox.PrimarySmtpAddress
|
emailAddress = $mailbox.PrimarySmtpAddress
|
||||||
sendOnBehalfOf = $mailbox.GrantSendOnBehalfTo
|
sendOnBehalfOf = $mailbox.GrantSendOnBehalfTo
|
||||||
sendAs = Get-ADPermission $mailbox.identity | where {($_.ExtendedRights -like “*Send-As*”) -and -not ($_.User -like “NT AUTHORITY\SELF”) -and -not ($_.User -like “s-1-5-21*”)} | % {$_.User}
|
sendAs = Get-ADPermission $mailbox.identity | Where-Object {($_.ExtendedRights -like “*Send-As*”) -and -not ($_.User -like “NT AUTHORITY\SELF”) -and -not ($_.User -like “s-1-5-21*”)} | ForEach-Object {$_.User}
|
||||||
fullAccess = Get-MailboxPermission $mailbox.Identity | ?{($_.IsInherited -eq $False) -and -not ($_.User -match “NT AUTHORITY”)} |Select User,Identity,@{Name=”AccessRights”;Expression={$_.AccessRights}} | % {$_.User}
|
fullAccess = Get-MailboxPermission $mailbox.Identity | Where-Object {($_.IsInherited -eq $False) -and -not ($_.User -match “NT AUTHORITY”)} |Select-Object User,Identity,@{Name=”AccessRights”;Expression={$_.AccessRights}} | ForEach-Object {$_.User}
|
||||||
}
|
}
|
||||||
|
|
||||||
#Add the objects to the permissions array
|
#Add the objects to the permissions array
|
||||||
@ -195,8 +195,8 @@ do
|
|||||||
displayname = $mailbox.DisplayName
|
displayname = $mailbox.DisplayName
|
||||||
emailAddress = $mailbox.PrimarySmtpAddress
|
emailAddress = $mailbox.PrimarySmtpAddress
|
||||||
sendOnBehalfOf = $mailbox.GrantSendOnBehalfTo
|
sendOnBehalfOf = $mailbox.GrantSendOnBehalfTo
|
||||||
sendAs = Get-ADPermission $mailbox.identity | where {($_.ExtendedRights -like “*Send-As*”) -and -not ($_.User -like “NT AUTHORITY\SELF”) -and -not ($_.User -like “s-1-5-21*”)} | % {$_.User}
|
sendAs = Get-ADPermission $mailbox.identity | Where-Object {($_.ExtendedRights -like “*Send-As*”) -and -not ($_.User -like “NT AUTHORITY\SELF”) -and -not ($_.User -like “s-1-5-21*”)} | ForEach-Object {$_.User}
|
||||||
fullAccess = Get-MailboxPermission $mailbox.Identity | ?{($_.IsInherited -eq $False) -and -not ($_.User -match “NT AUTHORITY”)} |Select User,Identity,@{Name=”AccessRights”;Expression={$_.AccessRights}} | % {$_.User}
|
fullAccess = Get-MailboxPermission $mailbox.Identity | Where-Object {($_.IsInherited -eq $False) -and -not ($_.User -match “NT AUTHORITY”)} |Select-Object User,Identity,@{Name=”AccessRights”;Expression={$_.AccessRights}} | ForEach-Object {$_.User}
|
||||||
}
|
}
|
||||||
|
|
||||||
#Add the objects to the permissions array
|
#Add the objects to the permissions array
|
||||||
@ -207,7 +207,7 @@ do
|
|||||||
$permissionsArray | Format-Table
|
$permissionsArray | Format-Table
|
||||||
$permissionsArray | Export-Csv -NoTypeInformation $csvSavePath
|
$permissionsArray | Export-Csv -NoTypeInformation $csvSavePath
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Read-Host -Prompt 'Press Enter to Continue'
|
Read-Host -Prompt 'Press Enter to Continue'
|
||||||
}
|
}
|
||||||
until ($selection -eq 'q')
|
until ($selection -eq 'q')
|
||||||
|
Loading…
Reference in New Issue
Block a user