[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 336
  • Last Modified:

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
0
techdrive
Asked:
techdrive
  • 5
  • 5
1 Solution
 
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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
 
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

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 5
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now