Avatar of Alicia Perillo
Alicia Perillo
Flag for United States of America asked on

remove mailbox send as permissions

Hello Experts,

I inadvertently granted "Send As" permissions to all mailboxes using this script:
Get-Mailbox | Set-Mailbox -GrantSendOnBehalfTo "$a", "$b", "$c", "$d"

Can you help me to reverse this, i.e., to remove all the "Send As" permissions for these string variables?

Any help would be appreciated.  Thanks!

Alicia
ExchangeEmail ServersPowershell

Avatar of undefined
Last Comment
Alicia Perillo

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Will Szymkowski

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Alicia Perillo

ASKER
Will,

Does this command remove all send on behalf of for all users even the users who are set up correctly?

Thanks,

Alicia
Alicia Perillo

ASKER
Will,

I hesitate to run the command because I'm not sure if it will remove all "Send On Behalf" permissions.  There are many mailboxes that have "Send On Behalf" permissions set up correctly. Can you answer this question?  

Thanks,
Alicia
Will Szymkowski

This command will remove all SendOnBehalfOf permissions on all mailboxes.

Will.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
Alicia Perillo

ASKER
Okay, then can you give me a command to list all SendOnBehalf permissions.  I can run that command and then I'll be able to re-do the correct SendOnBehalf permissions after I run: Get-Mailbox -ResultSize "unlimited" | Set-Mailbox -GrantSendOnBehalfTo $null
Will Szymkowski

You can use the following command to accomplish this...
get-mailbox -resultsize "unlimited" | ? {$_.GrantSendOnBehalfTo -ne $null} | Select Name, GrantSendOnBehalfTo| Export-csv "c:\SendOnBehalf.csv" -NoTypeInformation

Open in new window


Will.
Alicia Perillo

ASKER
The only problem is that as per my first post: I inadvertently granted all users incorrect SendOnBehalf permissions, so I need to know what users, i.e., individuals who had previous SendOnBehalf permissions.  I need the results to show specifics, e.g., Mailbox and who has (individual user names) SendOnBehalf permissions for that Mailbox.  

-Alicia
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Will Szymkowski

So you have basically overwritten all of the previous Send On Behalf Of users that were present. You did not += in the script? So you only see the new users that have been added.

Unfortunately, unless you have auditing enabled you will not be able to track those changes.

What you can try doing is using search-adminAuditLog. However this will only show you the changes that happened it will not show you the previous values that were changed.

For auditing like this you should have something in place like
http://www.lepide.com/lepideauditor/exchange.html

Will.
Alicia Perillo

ASKER
So, then we don't have an answer.

What's the protocol here?  If I grant you the points for accepted answer then the next person who searches the site for a similar issue won't be getting good information.  

Alicia
Will Szymkowski

In your initial question

Can you help me to reverse this, i.e., to remove all the "Send On Behalf Of" (corrected) permissions for these string variables?

I have provided a way to remove these permissions using powershell for all mailboxes. However, if you have overwritten data within Exchange specifically then you need auditing software in place to track those changes.

So from my perspective the answer is half completed. So when closing you can grade the answer as you see fit based on the options i have provided.

Ultimately I have provided a solution to remove the permissions you had applied but there is no way of knowning what users were present before this change happened, unless you are using auditing software.

This cannot be done with powershell.

So from my end i have answered everything i can.

Will.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
Alicia Perillo

ASKER
Will,

I appreciate your help!  Thanks!

Alicia