
There were no error codes in any of the logs, but it did not perform the task. In ALL attempts, I was using the Run Command Line with powershell.exe -noprofile -executionpolicy bypass

– Elsewhere in the Sequence after booting into Windows with/without a “Run As Account” (Failed) – right after the OSD name, before Revert Powershell with/without a “Run As Account” (Failed) Set-ADComputer $Computer -Location $ADLocation If (($ComputerModel -match "Precision") -OR ($ComputerModel -match "Optiplex")) $SerialNumber = (Get-WmiObject -Class Win32_BIOS | Select-Object SerialNumber).SerialNumber $ComputerModel = (Get-WmiObject -Class Win32_ComputerSystem | Select-Object Model).Model We’ll then get something like 1234567-WS or 1234567-LAP in the $OSDComputerName variable. Next we create a new COM object from the class. The value of $OSDComputerName will then be put into the newly created COM object. In each if condition we combine $SerialNumber with a dash and at the end a suffix for either a workstation or laptop. Then we create two if conditions depending on the computer model (in this case laptop or workstation). We begin with populating two variables, $ComputerModel and $SerialNumber data from WMI. In this blog post I’m performing OSD on Dell systems, but the script can easily be modified to support other vendors. Secondly we want to name the computer by using the serial number and a suffix, e.g if it’s a workstation or laptop. First we need to determine what computer model the OS is being deployed on.

In this blog post we’ll be renaming the computer based upon two critera.
#MAC SEARCH COMPUTER FOR MATCHING IMAGE HOW TO#
I’ve previously blogged about how to do it with VB script, you can find that blog here. There are various of methods out there today on how you can automate the process of naming computers during OSD.
