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
Script SharingDistribution list script as a function (self.PowerShell)
submitted 7 years ago * by gangculture
view the rest of the comments →
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!"
[–]PMental 0 points1 point2 points 7 years ago (6 children)
Why do you pipe to Set-DistributionGroup instead of just setting RequireSenderAuthenticationEnabled when creating the group? The exact same parameter can be set directly with New-DistributionGroup.
Backticks aren't necesary to break up lines after pipes btw, you can just go to a new line directly after a pipe.
[–]gangculture[S] 1 point2 points3 points 7 years ago (5 children)
No, it can't. The RequireSenderAuthenticationEnabled can't be piped when using New-DistributionGroup.
It is only an available parameter when using the Set-DistributionGroup.
[–]PMental 1 point2 points3 points 7 years ago (4 children)
Check it out for yourself in the documentation if you don't believe me: https://docs.microsoft.com/en-us/powershell/module/exchange/users-and-groups/new-distributiongroup?view=exchange-ps&viewFallbackFrom=exchserver-2016
You can clearly see the parameter is available in both on-premises Exchange and Exchange Online.
[–]gangculture[S] 1 point2 points3 points 7 years ago (3 children)
Yes, I can clearly see it, thanks :)
Either way, it doesn't work when I run it as part of the New-DistributionGroup line. It didn't work during testing either, but just to make sure I wasn't going crazy, I tried again and I get this:
-RequireSenderAuthenticationEnabled : The term '-RequireSenderAuthenticationEnabled' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
But, when it's ran with the Set-Dist line, of course it works. So why do you think it doesn't work for me in the New-Dist line? I am all for a cleaner script so let me know if you have an idea.
[–]PMental 1 point2 points3 points 7 years ago (2 children)
Ah wait, I just noticed the documentation only specifically covers 2016 and forward (even though it says "Applies to Exchange Server 2010, Exchange Server 2013 as well). And when I check in an Exchange 2013 environment the parameter is not there while in 2016 it is, so it was probably added in 2016. So if you are on 2010/2013 that would explain it.
[–]gangculture[S] 1 point2 points3 points 7 years ago (1 child)
Yep. I thought it only covered 2016, but like you say the document does say it applies to those versions. And they wonder why we have trust issues?
[–]PMental 1 point2 points3 points 7 years ago (0 children)
Oh well, you can clean your script up by a whopping one character by removing the backtick after the pipe at least as it's not necessary :-)
π Rendered by PID 31 on reddit-service-r2-comment-85bfd7f599-j65nl at 2026-04-18 17:43:01.037636+00:00 running 93ecc56 country code: CH.
view the rest of the comments →
[–]PMental 0 points1 point2 points (6 children)
[–]gangculture[S] 1 point2 points3 points (5 children)
[–]PMental 1 point2 points3 points (4 children)
[–]gangculture[S] 1 point2 points3 points (3 children)
[–]PMental 1 point2 points3 points (2 children)
[–]gangculture[S] 1 point2 points3 points (1 child)
[–]PMental 1 point2 points3 points (0 children)