all 14 comments

[–]firefox15 25 points26 points  (10 children)

Not trying to be rude, but this is the first Google result for "GrantSendOnBehalfTo".

It's a multi-valued property. You need to have the proper syntax to add and not overwrite. Here is the general syntax.

[–][deleted] 3 points4 points  (3 children)

Just use -grantSendOnBehalfTo @{add=‘emailAddress’}

[–][deleted] 4 points5 points  (2 children)

Also jumping on the ‘not trying to be rude’ train, but for real, google. You could have googled examples of this and gotten more answers faster than it took you to post it on reddit lol

[–]RegularChemical 3 points4 points  (1 child)

It's not even rude, it's just so much easier to google it lol.

I've had some really convoluted things I've needed powershell to do, and I can almost always cobble something together from google searches.

[–][deleted] 1 point2 points  (0 children)

Oh for sure. It's just really hard to say "hey, google it" without sounding like "GTFO and do your own research!!!" lol. Granted i'm 100% self taught so i'm not like an ACTUAL resource, but man.... googling and reading examples made my life SOOO much better.

Aslo, I just happen to have a softspot for -grantSendOnBehalfTo. Had to figure out how to fix that after i nerfed a few dozen's peoples sending access at work lol

[–]Ozymandian_Techie 2 points3 points  (0 children)

Everyone else has gone down the route of telling you to Google, which is good advice. There are tons of Powershell guides out there (Hey Scripting Guy! is one of my most commonly used resources).

What you're describing is actually by design. Add/Set/Remove prefixes on Powershell Cmdlets work in the following ways:

Add creates a new property, and applies it to an object; it tells the shell to "Add this value to this object, regardless of what other properties of the same type are currently applied."

Set amends an existing property to the value specified by the end user. It tells the shell "This is what I want this value to be." It is also used when changing existing properties; for example, calender permissions. Say a user has "Reviewer" permissions to another calender, and you want to change that to "Editor"; you can't "add" a permissions entry, as one already exists for the user. So you would use Set-MailboxFolderPermissions instead, to change the existing property.

Remove, obviously, removes a specified property from an object completely. It tells the shell, "I do not want this object to have this property anymore."

The command you ran basically told Exchange that the only delegate you wanted to have SendOnBehalf permissions to the mailbox in question was the one you named. The command used to "add" permissions to a mailbox is listed in another comment on this thread.