Share via


ADding bulk users on send on behalf to

Question

Wednesday, April 16, 2014 3:47 PM

I am using this command to add send on behalf

Get-mailbox "Sid test 1" | Set-mailbox -Grantsendonbehalfto "Sid Test 2","Sid Test 3".

When i check the results it only adds 1 mailbox.

Please advise

All replies (9)

Wednesday, April 16, 2014 3:52 PM

Hi,

Try it this way:

http://blogs.technet.com/b/manjubn/archive/2012/10/02/grantsendonbehalfto-permissions-for-mailbox-overwrites-existing-permission.aspx

EDIT: Obviously skip Ex2. Also, the documentation for the parameter specifically mentions using DNs, so you may need to try that too.

Don't retire TechNet! - (Don't give up yet - 12,830+ strong and growing)


Wednesday, April 16, 2014 4:15 PM

I need to add mailbox usig hte dislay name, i tried

Get-mailbox "Sid test 1" | Set-mailbox -Grantsendonbehalfto "Sid Test 2","Sid Test 3".

Only adds 1 mailbox 

The value @{Add="<value1>", "<value2>", "<value3>"} does it have to be e-mail address or can it be samaccount name


Wednesday, April 16, 2014 4:25 PM

I tried this code

$users = Get-Content E:\Users\raosid\Users.txt
$users| foreach
{

set-mailbox ‘Sid test 1’ –Grantsendonbehalfto @{add=$users}

}

The users.txt file contains the samaccountname.

It did not work. please advise

I also tried this code

$users = Get-Content E:\Users\raosid\Users.txt
$users | foreach
{
Get-Mailbox "Sid test 1" | Set-Mailbox -GrantSendOnBehalfTo $users
}

Did not work


Thursday, April 17, 2014 7:32 AM

can anyone please assist


Thursday, April 17, 2014 10:00 AM

param ($inputfile='.\SendAs.csv')

# Uses full name with spaces - no quotes
# Headers for the CSV are Mailbox and Proxyuser

$csv = Import-Csv $inputfile
$csv | ForEach-Object -Process{
$mbx = Get-mailbox $_.mailbox
$ad = $mbx.name


Write-Host Giving $_.proxyuser SendAs rights to $ad

Add-ADPermission -Identity $ad –User $_.proxyuser -AccessRights ExtendedRight -ExtendedRights "Send As"

} 

Thursday, April 17, 2014 10:04 AM

The previous script can use display names (as well as SamAccountName) but the problem with Display Names is that they aren't necessarily unique and this can cause issues if multiple users are found with the same display name.

The script isn't that clever and will probably abort at this point.


Tuesday, April 22, 2014 2:48 PM

I need send on behalf script not send as 


Tuesday, August 15, 2017 8:19 AM

i just Create this for Bulk SendOnBehalf Access, Tested.. 

$csv = Import-Csv C:\users.csv 

$csv | ForEach-Object -Process{
$users = $_.name
$name = @{Add="$users"}

Set-Mailbox $_.mail -GrantSendOnBehalfTo $name

}


Tuesday, August 15, 2017 8:20 AM

Just try this 

#Create this for Bulk SendOnBehalf Access.. 

$csv = Import-Csv C:\users.csv 

$csv | ForEach-Object -Process{
$users = $_.name
$name = @{Add="$users"}

Set-Mailbox $_.mail -GrantSendOnBehalfTo $name

}

GrantSendOnBehalfTo and Full Access Rights for bulk AD Users from CSV file

<g class="gr_ gr_8 gr-alert gr_gramm gr_inline_cards gr_run_anim Style multiReplace" data-gr-id="8" id="8">Reference :</g> https://gallery.technet.microsoft.com/exchange/Grant-SendOnBehalf-and-175fee83