Need Exchange Powershell script

Need a powershell script that would add a user to the managed by  list to all groups that have a current managed by user set. (Yes groups that already have a managed by user).

Thanks in advance!

LVL 12
Gary DewrellSenior Network AdministratorAsked:
Who is Participating?
 
Gary DewrellConnect With a Mentor Senior Network AdministratorAuthor Commented:
I found that modifing any parameter resulted in the Membership Approval settings being corrected. I wrote this script.
$count = 0
get-distributiongroup | where-object {$_.Managedby} | foreach-object {
$count += 1
write-host "$_.Alias"
set-distributiongroup -identity $_.Alias -CustomAttribute15 ""
}
Write-host "Total changed $count"

This resolved my issue.
0
 
Chris DentPowerShell DeveloperCommented:

ManagedBy is not a list, it's a single entry. Do you want to overwrite the entry? Or do you only need to give them rights to modify membership?

Chris
0
 
Gary DewrellSenior Network AdministratorAuthor Commented:
Hey Chris I am able to add multiple people to the Managed by properties within the GUI.

But it may not be needed let me explain the issue I am trying to solve.

On almost all of my Distribution Groups the Membership Approval settings are grayed out. The only fix i have found is to either:
1. Delete the currnet managed by user and readd it.
2. Add a second managed by user and then remove it.

So the goal is to make some change so that the Membership Approval section starts working.  
0
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
Chris DentPowerShell DeveloperCommented:

Sorry I missed Exchange 2010. It's possible they've changed it, but everything prior to that certainly has managedBy as a single user. You can work around that by adding permission to write the member attribute on the group, but that's not quite the same as approval settings.

Chris
0
 
Gary DewrellSenior Network AdministratorAuthor Commented:
Correct that is why I thought add myself as a Managed by member and then removing it may fix the problem since that is what fixes the problem in the GUI>
0
 
Gary DewrellSenior Network AdministratorAuthor Commented:
Fixed my on problem See last post for details.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.