Reputation: 49
We run a "hybrid" Exchange environment where Office365 looks at some attributes on AD groups. One of the ExtendedAttributes, msExchRequireAuthToSendTo, controls whether or not an "outside" user can send to a distribution list held in AD.
This ExtendedAttribute has three possible settings: True / False / "Not Set" - in order to prevent "outside" users from sending spam, the value has to be True. The default is "Not Set".
I can set either True or False like this:
$InternalDistro = (Get-ADGroup -filter 'name -eq "CoolDistroList"')
Set-ADGroup $InternalDistro -Replace @{msExchRequireAuthToSendTo = $False}
Is there a way to set the value BACK to the default value of "Not Set"? I tried $Null but that returns an error:
Set-ADGroup : Cannot bind parameter 'Replace' to the target. Exception setting "Replace": "Object reference not set to an
instance of an object."
At line:2 char:38
+ ... ADGroup $InternalDistro -Replace @{msExchRequireAuthToSendTo = $Null}
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : WriteError: (:) [Set-ADGroup], ParameterBindingException
+ FullyQualifiedErrorId : ParameterBindingFailed,Microsoft.ActiveDirectory.Management.Commands.SetADGroup
Any suggestions would be appreciated - thanks for thinking about this!
Upvotes: 1
Views: 14440
Reputation: 49
Is there a purpose to setting it back to 'Not Set' rather than 'False'? If so use the -Clear parameter: Set-ADGroup $InternalDistro -Clear 'msExchRequireAuthToSendTo' – TheMadTechnician
This works perfectly, posting as the answer - all credit to @TheMadTechnician!
Upvotes: 1