tisdag 14 april 2015

Bulk computers from .csv to a Group

Could happen that a college need you to add a whole bunch of computer to a security group, and you have it in a .csv and want to add them. Can be easily done by a powershell script. Like this:

$sourced = Import-Csv "C:\temp\Bulk-computers.csv"
foreach ($s in $sourced)
{
    Add-ADGroupMember -Identity GROUP1 -members $s.name

}

Very important that in the top of the .CSV file, you need a section with name, otherwise it wont work. Like this:











Good luck
/P

Inga kommentarer:

Skicka en kommentar