Search the Community
Showing results for tags 'OSD Task Sequence'.
-
Just thought I'd share a script I wrote this morning. I currently have a task sequence that builds various devices and takes the OSDComputerName variable from the Asset Tag BIOS field. The Surface Pro 3 works a little different, in that you can't set this field directly from the BIOS, you need to set it using a CLI utility (available here - http://www.microsoft.com/en-us/download/details.aspx?id=44076).This usually means booting a brand new device, going through the OOBE stuff, running the CLI utility, then restarting into PXE and continuing with imaging as normal. The below .vbs script first checks if there is an existing asset tag entered, and if not prompts the user to enter a machine name, which it then uses in the Task Sequence and sets the tag locally using the utility, so the next time the device is built it just takes the tag straight from the BIOS. Dim objWMIService Dim colItems Dim objSMSEnv Dim strNewName Dim WshShell Dim strCurDir Set objWMIService = GetObject("winmgmts:\\.\root\CIMV2") Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_SystemEnclosure") 'Get the current Asset Tag For Each objItem In colItems 'Remove all beginning, trailing and containing spaces and switch to uppercase strNewName = objItem.SMBIOSAssetTag Next wscript.echo "Currently using " & strNewName & " as OSDComputerName" If left(strNewName,4) <> "SomeString" Then Do While X = 0 strNewName = InputBox ("Please enter a machine name i.e. HP-XXXXXX","Enter Machine Name...") If strNewName = "" Then Wscript.Echo "You must enter a machine name." Else Set WshShell = WScript.CreateObject("WScript.Shell") strCurDir = WshShell.CurrentDirectory WshShell.Run strCurDir & "\AssetTag -s " & UCase(strNewName), 0 wscript.echo "Currently using " & strNewName & " as OSDComputerName Set objSMSEnv = CreateObject("Microsoft.SMS.TSEnvironment") wscript.echo "Set Task Sequence variable OSDComputerName to: " & strNewName objSMSEnv("OSDComputerName") = UCase(strNewName) Exit Do End If Loop Else Wscript.Echo strNewName Set objSMSEnv = CreateObject("Microsoft.SMS.TSEnvironment") wscript.echo "Set Task Sequence variable OSDComputerName to: " & strNewName objSMSEnv("OSDComputerName") = UCase(strNewName) End If Set WshShell = Nothing I deployed it by having AssetTag.exe and script file in a folder on my SCCM OSD scripts directory, then created a simple package without program and pointed at this location. After distributing to my local DPs I then created a Run Command Line task sequence item and added the name of the script file into the Command Line area, making sure to reference the package containing the script.
-
- surface pro 3
- OSDcomputername
-
(and 3 more)
Tagged with:
-
Hello All, I'm not sure if someone has already started a discussion thread for this topic already. In my task sequence, any application that i add fails to install. When I run my apps inside of my OSD I never do get any error code. My co-worker who is also trying this said he received an error code of 1603 "Fatal error during installation." That was for Quick Time which when deployed by itself installs just fine. Also, all my other apps when deploying them outside of an OSD task sequence the applications install with no problems. Here are two smsts.log files from a co-worker's machine I have attached. Any suggestions would be greatly appreciated. Thanks! Paul AppEnforce.log smsts.log smsts-20130626-110217.log
-
- OSD Task Sequence
- Applications Fail to Install
- (and 1 more)