troubleshooting Question

Powershell Group Management

Avatar of JCJohnson76
JCJohnson76 asked on
Powershell
3 Comments1 Solution52 ViewsLast Modified:
Need Help Changing over 300 groups "Managedby" field to another user.

These user does not need permission change for the group but only to be added to the Managedby fields of the group

This needs to be done using a csv file.  

The script that I wrote below does not work

$GroupLists = Import-CSV c:\<pathtofile>
Foreach ($Grp in $Grouplists) {
$Grp.samaccountname
$Grp.Groups
Set-ADgroup -Managedby $Grp.Managedby
}


Please note my CSV file has two columns  Groups, SamAccountName
Also please take note that the Group column has the DistinguishName listed & not the Group Name or Displayname

Can someone provide me with proper syntax for this issue

Thanks
Appreciate it
ASKER CERTIFIED SOLUTION
nashiooka

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros