Edit: On second thought look here: http://wiki.powergui.org/index.php/New-QADComputer
Server 2008 R2 x64, I need help to create 100+ computers, the list is easy:
saved them at a CSV excell and I need help to create the powershell script.
I manage to create the users script using some examples at the web but can't find computer script.
Thanks for the help!
Last edited by ChrisH; 29th July 2012 at 04:38 PM.
Thanks Chris for the fast reply but all that I know (from other links) and tried and failed
I was hoping for something like this:
which will create the computers..Thanks ahead
Last edited by ItMerkaz; 29th July 2012 at 06:22 PM.
Does it have to be PowerShell?
Can't you just use dsadd?
dsadd computer <ComputerDN>
OK the command works fine.
all I need is to make a powershell script which will import the data from a CSV file out of the command:
New-ADComputer -Path "CN=CampusComputers,DC=AllStudents,DC=local" -Name "Student00" -SamAccountName "Student00" -DisplayName "Student00" -Descriptio "Description00" -Location "MerkazIT" -Enabled $true
Can someone help me with that ?
I am not totally sure but would it be something like
$list = Import-Csv C:\computers.csv
foreach($entry in $list)
Your command replacing the parts of the line with list entry
eg New-ADComputer -Path "CN=CampusComputers,DC=AllStudents,DC=local" -Name $($entry.computerName) -SamAccountName $($entry.samAccount) -DisplayName $($entry.displayName) -Description $($entry.description) -Location $($rentry.location) -Enabled $true
This assuming your list has Name, SamAccountName, DiplayName, Description and Location in the csv
I am not sure if this is right as I do not have much experience in powershell...I will try test it here to and see my own mistake
Last edited by rodent43; 30th July 2012 at 04:04 PM.
just removed the 'try' and 'catch' and it worked like a charm :-)
to everyone helped, also my scripts for the groups and users works great now that the computers joined the AD.
is a restart a must ?
Yes, the newly-joined computer should restart to complete the domain join and begin to receive machine-level Group Policy settings from the domain.
There are currently 1 users browsing this thread. (0 members and 1 guests)