kuzum
asked on
importing users to Security group
Dear experts
could you please help me with this one?
I have a security group that I exported users via PowerShell to a csv file and I now need to import those users into a new Universal security group but I am receiving an error from PowerShell during import process.
this is the full code I used.
Import-Module ActiveDirectory
$list =import-csv "H:\temp\export\usg_users. csv
foreach ($user in $list) {
add-ADGroupMember -identity USG-Security GroupNAme -member $user.SamAccountname
}
error is
Add-ADgroupmember: A positional parameter cannot be found that accepts argument "GroupNAme"
there is a - and space in the actual security group name in AD. so name is written such as USG-Customer Services
any ideas why I am receiving this please? thanks.
could you please help me with this one?
I have a security group that I exported users via PowerShell to a csv file and I now need to import those users into a new Universal security group but I am receiving an error from PowerShell during import process.
this is the full code I used.
Import-Module ActiveDirectory
$list =import-csv "H:\temp\export\usg_users.
foreach ($user in $list) {
add-ADGroupMember -identity USG-Security GroupNAme -member $user.SamAccountname
}
error is
Add-ADgroupmember: A positional parameter cannot be found that accepts argument "GroupNAme"
there is a - and space in the actual security group name in AD. so name is written such as USG-Customer Services
any ideas why I am receiving this please? thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I used " " and it also did the worked just after posting the question. Thanks for your time.