Here is our situation: We use CM12 and OSD and ,OSD (CM12 in general) is tied tightly to AD group objects. Wee need to pre-populate computers AD so that when CM12 scans a given OU it then sees that computer name and pulls it into CM12. Then when a tech performs a PXE OSD build the system should not be considered an unknown computer and just build the TS selected without being prompted for a hostname. We do not let teh system auto name as MININT- will not work well in our environment. This is not happening with our new computers only those that have been in the domain already. The issue is that MSFT has removed the ability to add a PC to the domain using the guid section, basicly enabling the option to be a managed computer, to tie the physical hardware to AD and as result to CM12. Technically, it can be done but ONLY if you are on a server that has WDS enabled and not via spreadsheet (at least not that I could find). Having the ability to do this would GREATLY increase the success rate of the auto deployment of apps during the OSD process and speed up overall delivery of a PC to a user. Many Thanks in advance for any info you can provide. Roger Truss Windows Administrator Brunswick Corporation
Hi Roger, I believe this question should go to someone in Change Manager 2012 for the assistance you need or to the Windows Deployment Server team. This is because I don't used these products. Sorry
The script describes in full how to create a single computer account. I'd like to automate a creation of computer objects in AD, based on user names; preferrably using an input from a CSV file. For example, foreach $sAMAccountName $computername = $displayname&"-PC" Sorry if this is somewhat mistakenly written, I'm just starting in PowerShell. Thanks in advance.
Hi Serhad, I'll try my best to answer the question. Some characters do not display correctly within this area when typing code so bare with me. I haven't tested the code but it should work. If you have issues let me know. Please test the code with two test computer names to see if it works before proceeding. 1.)Create a csv file in notepad and save it as "ComputerList.csv" on your C drive 2.)Still in notepad, Type in "name" on the first line. 3.)On each line after that, add the computer names you want to create, one computer name per line. Example ComputerList.cs v File: name ComputerName1 ComputerName2 ComputerName3 Now for the powershell code part. 4.) Create a function called CreateComputer at the top of your script. PowerShell functions must be at the top of the script before you call them. 5.) Basically, place the code from this website in this function. 6.) Now write the code below this function importing csv file and looping through the names. Powershell Code Example: Function CreateComputer { $ComputerName = $args[0] $objDomain = New-Object System.Director yServices.Direc toryEntry $objComputer = $objDomain.Crea te("computer", "CN=" + $ComputerName) $objComputer.Pu t("sAMAccountNa me",$ComputerNa me + "$") # A dollar sign must be appended to the end of every computer sAMAccountName. $objComputer.Pu t("Description" ,"Some Descriptive text") $objComputer.Pu t("userAccountC ontrol", 4128) $objComputer.Se tInfo() } $Computers = Import-Csv -Path "C:\ComputerLis tFile.csv" foreach ($Computer in $Computers) { CreateComputer $Computer.Name }