techdrive
asked on
full mailbox permissions sendas permissions
I was asked to pull user accounts who have the sendas permissions and the full mailbox permissions assigned to users in our organization. At first this appeared to be an easy task but after hours of banging my head against the wall I am not getting the correct results. I have modified and changed these commands below a lot. My output are a few but not all mailboxes. Can someone please help me do the following. I need a script to list users who have full mailbox and sendas permission. I would also like to customize it so that If I wanted to get one user it would work also. This is probably suitable for another script altogether. Any help would be much appreciative.
get-user -Identity "user" | get-mailbox | %{$foo = $_; Get-MailboxPermission $foo | ?{$_.AccessRights -eq "FullAccess" -and $_.IsInherited -eq $false}} | ft {$foo},User,AccessRights
Get-Mailbox | Get-MailboxPermission | Where-Object { ($_.AccessRights -eq "*fullaccess*") -and ($_.User -like "*user*") }
get-user -Identity "user" | get-mailbox | %{$foo = $_; Get-MailboxPermission $foo | ?{$_.AccessRights -eq "FullAccess" -and $_.IsInherited -eq $false}} | ft {$foo},User,AccessRights
Get-Mailbox | Get-MailboxPermission | Where-Object { ($_.AccessRights -eq "*fullaccess*") -and ($_.User -like "*user*") }
ASKER
Thanks about to try this now. Do you also have a solution where I can run this for one particuliar user and not all, thanks.
ASKER
Yes this is the same exact command I ran to try to get a single user from this page and this was not pulling all of the mailboxes where full access for mailboxes were applied.
Get-Mailbox | Get-MailboxPermission | Where-Object { ($_.AccessRights -eq "*fullaccess*") -and ($_.User -like "*rajith*") } Please reference my original statement.
Get-Mailbox | Get-MailboxPermission | Where-Object { ($_.AccessRights -eq "*fullaccess*") -and ($_.User -like "*rajith*") } Please reference my original statement.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks for your help it works like a charm
get-mailbox -resultsize unlimited | get-mailboxpermission | where { ($_.accessrights -eq "fullaccess") -and ($_.isinherited -eq $false) -and -not ($_.user -like "NT Authority\self")} | ft identity,user -autosize | out-file c:\log\users.txt