Windows Server 2008 R2 Thread, PowerShell script to create cmputers in Technical; Hi &
Server 2008 R2 x64, I need help to create 100+ computers, the list is easy:
29th July 2012, 05:04 PM #1
- Rep Power
IDG Tech News
29th July 2012, 05:31 PM #2
Last edited by ChrisH; 29th July 2012 at 05:38 PM.
29th July 2012, 07:20 PM #3
29th July 2012, 09:12 PM #4
Does it have to be PowerShell?
29th July 2012, 10:05 PM #5
Can't you just use dsadd?
dsadd computer <ComputerDN>
30th July 2012, 04:46 PM #6
- Rep Power
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 ?
30th July 2012, 04:58 PM #7
- Rep Power
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 05:04 PM.
30th July 2012, 05:33 PM #8
30th July 2012, 05:36 PM #9
Yes, the newly-joined computer should restart to complete the domain join and begin to receive machine-level Group Policy settings from the domain.
By Norphy in forum Scripts
Last Post: 20th April 2010, 12:37 PM
By fawkers in forum Scripts
Last Post: 24th January 2008, 03:58 PM
By markesmith in forum Scripts
Last Post: 26th April 2007, 04:03 PM
By SwedishChef in forum Scripts
Last Post: 5th July 2006, 09:14 AM
By tosca925 in forum Scripts
Last Post: 12th October 2005, 01:04 AM
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread