Querying Computer Name in WinPE
Hi all! We currently use computer name-based WMI queries to determine which domain a new computer should be joined to. Here's an example (paraphrased): Join USA domain if SELECT * FROM Win32_ComputerSystem WHERE Name LIKE "mx%" OR "us% OR "br%" equals TRUE. This is working successfully, and the hope is to use a similar query to assign Language Packs and regional settings. A computer starting with "mx%" would be configured with the Spanish LP and the Mexico keyboard layout, for example. The problem is that Domains are joined much later in the Task Sequence than when Language Packs can be installed. Specifically, the domain is joined after the Task Sequence has rebooted into the newly loaded Windows image. Language Packs, on the other hand, can only be installed under WinPE and must be done BEFORE the "Setup Windows and ConfigMgr" step. The problem is that the Name value within Win32_ComputerSystem is not set until after the system reboots into the new Windows image. Since the value is NULL when queried under WinPE, the statement is judged to be FALSE and the step is skipped. I've tried to find a ComputerSystem.Name value in WinPE, but there doesn't appear to be one. Does anyone know if there's a way to create or assign such a value? Two notes: 1) We specify the computer name when importing the computer information (in the context menu for Computer Association). We enter the desired Computer Name and MAC address and add the record to an specially created OSD collection. 2) I see the Computer Name listed in the unattend.xml file in C:\Windows\Panther\Unattend. Is that loaded in WMI anywhere? Thanks for any help!
July 20th, 2012 3:53pm

Hi, If you have imported the computername you should have a variable for it available in the TS that you can use, OSDComputername or _SMSTSMachineName. Then you can use that in you Query for names using the Task Sequence variable instead of querying WMI for the computername. You could also install the language packs after the OS installation is complete = Add a Language Pack Online = Dism /online /Add-Package /PackagePath:C:\test\LangPacks\lp.cab I assume we are talking about windows 7 in this case. So you could do it either way.. Regards, Jrgen-- My System Center blog ccmexec.com -- Twitter @ccmexec
Free Windows Admin Tool Kit Click here and download it now
July 20th, 2012 4:04pm

Thanks! Sorry for not specifying the OS, it's Windows 7 Enterprise x64. Checking the SMSTS.log file I found that that the OSDComputerName variable does match the computer name. Is there way to check a partial name? For example, I'd like to have the group run if OSDComputerName stars with mx. The closest I've been able to come has been OSDComputerName equals mx% but that returns a result of FALSE. I was orignally looking at installing Language Packs online, but several of sites don't have external internet connections. Thanks again for help!
July 20th, 2012 7:03pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics