Hi there.<\/p>\n
I have a bunch of groups Local and Global that I need to change the manager for.<\/p>\n
Here is what I have:<\/p>\n
$list = Import-Csv .\\Group-Manager.csv<\/p>\n
$list | Foreach { $boss = Get-ADuser -Identity $.Manager ; Set-ADGroup -Identity $<\/em>.Group -Replace @{manager=$boss.SAMAccountName} }<\/p>\n Here is my error:<\/p>\n Set-ADGroup : The name reference is invalid Any help is appreciated.<\/p>\n Also, the CSV is has Group and Manager headings.<\/p>","upvoteCount":4,"answerCount":4,"datePublished":"2021-02-11T20:50:46.000Z","author":{"@type":"Person","name":"spiceuser-wrgud","url":"https://community.spiceworks.com/u/spiceuser-wrgud"},"acceptedAnswer":{"@type":"Answer","text":" a group does not have a manager. try like so<\/p>\n Hi there.<\/p>\n I have a bunch of groups Local and Global that I need to change the manager for.<\/p>\n Here is what I have:<\/p>\n $list = Import-Csv .\\Group-Manager.csv<\/p>\n $list | Foreach { $boss = Get-ADuser -Identity $.Manager ; Set-ADGroup -Identity $<\/em>.Group -Replace @{manager=$boss.SAMAccountName} }<\/p>\n Here is my error:<\/p>\n Set-ADGroup : The name reference is invalid Any help is appreciated.<\/p>\n Also, the CSV is has Group and Manager headings.<\/p>","upvoteCount":4,"datePublished":"2021-02-11T20:50:46.000Z","url":"https://community.spiceworks.com/t/how-to-add-a-manager-attribute-for-a-group-in-bulk/790475/1","author":{"@type":"Person","name":"spiceuser-wrgud","url":"https://community.spiceworks.com/u/spiceuser-wrgud"}},{"@type":"Answer","text":" If you post code, please use the ‘Insert Code’ button. Please and thank you!<\/p>\n
\nAt line:3 char:61<\/p>\n\n
<\/code><\/pre>\n<\/li>\n
$list = Import-Csv .\\Group-Manager.csv\n\n$list | Foreach { \n $boss = Get-ADuser -Identity $_.Manager\n Set-ADGroup -Identity $_.Group -ManagedBy $boss\n}\n<\/code><\/pre>","upvoteCount":2,"datePublished":"2021-02-11T21:15:57.000Z","url":"https://community.spiceworks.com/t/how-to-add-a-manager-attribute-for-a-group-in-bulk/790475/3","author":{"@type":"Person","name":"Neally","url":"https://community.spiceworks.com/u/Neally"}},"suggestedAnswer":[{"@type":"Answer","text":"
\nAt line:3 char:61<\/p>\n\n
<\/code><\/pre>\n<\/li>\n