powershell send as access for each user

Greetings,

What is the easiest way to determine if users samaccountname has send as access to their own mailbox for like an entire Organizational unit and also full access, thanks

exchange 2010
techdriveAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

SubsunCommented:
Are you trying to see if a particular user has send as access for all mailbox in organization or just trying to export all send as access permission details?

For all users you can try..
Get-Mailbox -ResultSize Unlimited | Get-ADPermission | ? {$_.Deny -eq $false -and $_.ExtendedRights -like "*Send-As*" -and $_.IsInherited -eq $false -and !($_.User -like "NT AUTHORITY\SELF")} | Select User,Identity,@{N="AccessRights";E={$_.AccessRights}},@{N="ExtendedRights";E={$_.ExtendedRights}} | Export-Csv C:\report.csv -nti

Open in new window


For a particular user.. For example if you want to find the mailboxes where user Domain\subsun has send as access, then In the above code replace -and !($_.User -like "NT AUTHORITY\SELF") with
-and ($_.User -like "Domain\Subsun")
Get-Mailbox -ResultSize Unlimited | Get-ADPermission | ? {$_.Deny -eq $false -and $_.ExtendedRights -like "*Send-As*" -and $_.IsInherited -eq $false -and ($_.User -like "Domain\Subsun")} | Select User,Identity,@{N="AccessRights";E={$_.AccessRights}},@{N="ExtendedRights";E={$_.ExtendedRights}} | Export-Csv C:\report.csv -nti

Open in new window

0
techdriveAuthor Commented:
Subsun,

Yes I am trying to see if a particular user (well in my case a list of users) have access to their own account. Both send as and full access. I tried to google this but amazing all references point to users who need to see access to other accounts but not verify for their own.
0
SubsunCommented:
All users will have access to their own mailbox. Are you trying to find if they assigned permission manually? I mean other than the SELF access?
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

techdriveAuthor Commented:
Well we have certain users who do not permission to their own mailbox and here is why. There was a forest trust setup and now no longer there. Because of this trust being broken some users have access via the trust and some were manually added. It would be nice to see those that were manually added if possible and thanks again for your help.
0
SubsunCommented:
Are you looking for self permission for users mailbox? I mean if it is there or not..
0
techdriveAuthor Commented:
Self permissions would suffice. Just learned that in exchange 2007 and up NT Authority Self is what is needed to be assigned for a user to have access to that mailbox. WOW, did not know this.
0
SubsunCommented:
Try the following code.. You need to put the users which you want to check in C:\Users.txt..
GC C:\Users.txt | %{
	New-object PSObject -Property @{
	User = $_
	SendAS =  [Bool](Get-MailboxPermission $_ | ?{$_.AccessRights -like "*FullAccess*" -and $_.User -like "NT AUTHORITY\SELF"})
	FullAccess = [Bool](Get-ADPermission $_ | ?{$_.ExtendedRights -like "*Send-As*" -and $_.User -like "NT AUTHORITY\SELF"})
	}
} | Export-Csv C:\report.csv -nti

Open in new window

C:\Users.txt format
UserA
UserB
UserC

Open in new window

Run the code from Exchange Management Shell
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
techdriveAuthor Commented:
Last request and I really appreciate your help. Is there a way I can automate adding them if they are missing.
0
SubsunCommented:
Yes.. but for additional requests please open a new question.. :-)
0
techdriveAuthor Commented:
no problem thanks for your help
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Powershell

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.