Microsoft
Software
Hardware
Network
Question : add-adgroupmember with a variable.
Hello,
I`m building script one of the things i have to do is the following:
$grpmembers = "user1,user2,user3"
$dataadgrp = "grdatatest"
add-adgroupmember -identity $dataadgrp -members $grpmembers
but it doenst work.
It only works when i do this:
add-adgroupmember -identity $dataadgrp -members user1,user2,user3
this is the error that i get:
Add-ADGroupMember : Cannot find an object with identity: 'user1,user2,user'
Thanks
Regards
Hans
Answer : add-adgroupmember with a variable.
$grpmembers = "user1,user2,user3" should be:
$grpmembers = "user1","user2","user3"
Random Solutions
how to make vlookup work
Record pone calls in remote desktop
server name
Computer reboots severat times a day
Why does my outlook show three tasks for every email I mark?
MS Excel 2007 & PDF - Exporting to PDF takes long hours!
In Perl, how do I add a value to the list, then check to see if the value exist before adding a new value
Computer playing random ads without any open windows
How do I use a volume license key on a HP computer with restore CD
Two SCCM primary site in active directory