?
Solved

Bypass distributiongroup setting

Posted on 2014-08-08
3
Medium Priority
?
236 Views
Last Modified: 2014-08-08
Hi Exports, I have this script that sets the RequireSenderAuthentication setting on true.
It works like a charm but now I have 3 DistributionGroup where the setting should be on false.
Can someone please help me to edit this file so I can reach my goal?

This how the script looks like:

Get-DistributionGroup | where {$_.RequireSenderAuthenticationEnabled -eq $False} | Set-DistributionGroup -RequireSenderAuthenticationEnabled $True

Kind regards,

Len
0
Comment
Question by:KNBsysteembeheer01
  • 2
3 Comments
 
LVL 17

Accepted Solution

by:
Premkumar Yogeswaran earned 2000 total points
ID: 40248323
Hi,
Try to add the custom attribute1 with common word for the 3 Distribution groups. Like below and then try to query the command.

Set-DistributionGroup Group1 -CustomAttribute1 "Restricted"

Open in new window


Get-DistributionGroup | where {$_.RequireSenderAuthenticationEnabled -eq $False -and $_.CustomAttribute1 -ne "Restricted" } | Set-DistributionGroup -RequireSenderAuthenticationEnabled $True

Open in new window

0
 

Author Closing Comment

by:KNBsysteembeheer01
ID: 40248343
Premkumar! You're the man! Thanks a lot for your help.
I've tested it and it worked great!

Kind regards,

Len
0
 
LVL 17

Expert Comment

by:Premkumar Yogeswaran
ID: 40248435
Thanks for the grade len

Cheers,
Prem
0

Featured Post

Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A walk-through example of how to obtain and apply new DID phone numbers to your cloud PBX enabled users that are configured in Office 365. Whether you have 1, 10 or 100+ users in your tenant, it's quite easy to get them phone-enabled and making/rece…
Are you looking for the options available for exporting EDB files to PST? You may be confused as they are different in different Exchange versions. Here, I will discuss some options available.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Loops Section Overview
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question