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


powershell add send as full access permissions

Posted on 2014-08-23
Medium Priority
Last Modified: 2014-08-27
Guys thanks for your help so far. I got this code to check for existing permissions. If the permissions are not there looking for a snippet of code in powershell to add them

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
Question by:techdrive
  • 2
LVL 40

Accepted Solution

Subsun earned 2000 total points
ID: 40281125
Updated code for automatically fixing the full mailbox and send as permission with some reporting. Check and let me know if you have any question regarding the code..
GC C:\Users.txt | %{
$user = $_
If (!(Get-MailboxPermission $user | ?{$_.AccessRights -like "*FullAccess*" -and $_.User -like "NT AUTHORITY\SELF"})) {
	ADD-MailboxPermission -Identity $user -User 'NT AUTHORITY\SELF' -InheritanceType 'All' -AccessRights 'FullAccess' -EA STOP | Out-Null
	$FullAccess = $true
	$Ffixed = "Fixed"
	$FullAccess = $False
	$Ffixed = "Not Fixed"
	$FullAccess = $true
	$Ffixed = "UnChanged"
If (!(Get-ADPermission $user | ?{$_.ExtendedRights -like "*Send-As*" -and $_.User -like "NT AUTHORITY\SELF"})){
	Try {ADD-ADPermission -Identity $user -User 'NT AUTHORITY\SELF' -ExtendedRights 'send-as' -EA STOP | Out-Null
	$SendAS = $True
	$Sfixed = "Fixed"
	$SendAS = $false
	$Sfixed = "Not Fixed"
	$SendAS = $True
	$Sfixed = "UnChanged"
	New-object PSObject -Property @{
	User = $User
	SendAS = $SendAS
	SendASFixed = $SFixed
	FullAccess = $FullAccess
	FullAccessFixed = $FFixed
} | Select User,SendAS,SendASFixed,FullAccess,FullAccessFixed |Export-Csv C:\report.csv -nti

Open in new window

LVL 40

Expert Comment

ID: 40287642
If you don't have any further queries, Please don't forget to close the question.. :-)

Author Comment

ID: 40288361

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
There can be many situations demanding the conversion of Outlook OST files to PST format and as such, there is no shortage of automated tools to perform this conversion. However, what makes Stellar OST to PST converter stand above the rest? Let us e…
The basic steps you have just learned will be implemented in this video. The basic steps are shown to configure an Exchange DAG in a live working Exchange Server Environment and manage the same (Exchange Server 2010 Software is used in a Windows Ser…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Suggested Courses

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question