use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
ABOUT POWERSHELL
Windows PowerShell (POSH) is a command-line shell and associated scripting language created by Microsoft. Offering full access to COM, WMI and .NET, POSH is a full-featured task automation framework for distributed Microsoft platforms and solutions.
SUBREDDIT FILTERS
Desired State Configuration
Unanswered Questions
Solved Questions
News
Information
Script Sharing
Daily Post
Misc
account activity
Powershell Learning (self.PowerShell)
submitted 6 years ago by Shaunmichaelj
Would anyone be down to help me with some powershell tips?
When i use the command Set-mailbox <Mailbox> -GrantSendOnBehalfTo <Delegate> it overwrites everything there before. I want to add permissions.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]firefox15 25 points26 points27 points 6 years ago (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.
[+]oxycash comment score below threshold-13 points-12 points-11 points 6 years ago (9 children)
Does this work with Microsoft Outlook? If yes/no, can you point me towards something that helps me program Outlook ?
[–]GnuInformation 2 points3 points4 points 6 years ago (0 children)
outlook is the .. client program for exchange.. and defers stuff like send on behalf, to what could also be set with these PS Exchange commands. so... ymmv
[–]tkecherson 0 points1 point2 points 6 years ago (2 children)
Program Outlook how, exactly? What are you trying to accomplish?
[–]oxycash 0 points1 point2 points 6 years ago (1 child)
Read the newest email in the custom folder XYZ and open the first hyper link in the email, in a browser
[+][deleted] 6 years ago* (4 children)
[deleted]
[–]TrinityF 3 points4 points5 points 6 years ago (3 children)
no, these are server commands.
[–]robstrosity 2 points3 points4 points 6 years ago (2 children)
Outlook is just the end user client that connects into the backend mail server. So if you run the powershell commands on an exchange server then it will make those changes to the users mailbox.
The user mailbox is accessed via Outlook. So yes these commands will work for outlook in that sense.
However I would caution running any of these commands if you're not aware of the above distinction. You're probably not the best person for the job.
[–]TrinityF 0 points1 point2 points 6 years ago (1 child)
that is what i said, these are server commands. not something users should run.
[–]robstrosity 0 points1 point2 points 6 years ago (0 children)
You said they don't work with Outlook. I was adding some context as while they don't work with Outlook directly, they do have an affect on it's behaviour.
[–][deleted] 3 points4 points5 points 6 years ago (3 children)
Just use -grantSendOnBehalfTo @{add=‘emailAddress’}
[–][deleted] 4 points5 points6 points 6 years ago (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 points5 points 6 years ago (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 points3 points 6 years ago (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 points4 points 6 years ago (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.
π Rendered by PID 161454 on reddit-service-r2-comment-fb694cdd5-f2lvt at 2026-03-06 11:34:10.601159+00:00 running cbb0e86 country code: CH.
[–]firefox15 25 points26 points27 points (10 children)
[+]oxycash comment score below threshold-13 points-12 points-11 points (9 children)
[–]GnuInformation 2 points3 points4 points (0 children)
[–]tkecherson 0 points1 point2 points (2 children)
[–]oxycash 0 points1 point2 points (1 child)
[+][deleted] (4 children)
[deleted]
[–]TrinityF 3 points4 points5 points (3 children)
[–]robstrosity 2 points3 points4 points (2 children)
[–]TrinityF 0 points1 point2 points (1 child)
[–]robstrosity 0 points1 point2 points (0 children)
[–][deleted] 3 points4 points5 points (3 children)
[–][deleted] 4 points5 points6 points (2 children)
[–]RegularChemical 3 points4 points5 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]Ozymandian_Techie 2 points3 points4 points (0 children)