Executing vb script through SCCM
hi all, I am having a problem with the execution of vb script through SCCM.The vb script work is to take the machine serial number from the BIOS and name the machine with the same serial number.The script runs when placed in the task sequence(gave a msgbox option in the script just to check) but after the operating system deployment it gives an error message like ..." windows could not parse or process the unattend answer file for pass(specialize).the setting specified in the answer file cannot be applied.the error was detected while processing settings for component[Microsoft-windows-shell-setup]". I have placed the script after the "Restart in windows PE" and before the partition In the task sequence i have entered a run command line step where in the command line i have given the command "cscript.exe name of the script" and then i have included the script package with this step.This is my script please have a look... On Error Resume Next Dim objWMIService Dim colItems 'Dim colBattery Dim objSMSEnv Dim strNewName Set objWMIService = GetObject("winmgmts:\\.\root\CIMV2") Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_Bios") 'Set colBattery = objWMIService.ExecQuery("SELECT * FROM Win32_Battery") ' Get the Serial Number For Each objItem In colItems ' Remove all beginning, trailing and containing spaces and change to all upper case strNewName = UCase(Trim(Replace(objItem.SerialNumber, " ", ""))) Next ' Is this a Desktop or a Laptop 'If colBattery.Count = 1 Then ' Is a Laptop ' strNewName = "L" & strNewName 'Else ' Is a Desktop 'strNewName = "W" & strNewName 'End If ' If the name is longer than 15 characters, we need to truncate it If Len(strNewName) > 15 Then ' If the name contains "-" characters (e.g. VM's), remove them If InStr(strNewName, "-") > 0 Then strNewName = Replace(strNewName, "-", "") End If ' If the name is still longer than 15 characters, truncate it to first 15 strNewName = Mid(strNewName, 1, 15) End If ' Set the Environment Variable that controls the Computer Name Set objSMSEnv = CreateObject("Microsoft.SMS.TSEnvironment") objSMSEnv("OSDCOMPUTERNAME") = strNewName Set objSMSEnv = Nothing Set colItems = Nothing 'Set colBattery = Nothing Set objWMIService = Nothing I don't know if the script is wrong or the process of putting it but i have created a package of the script gave a distribution point to it & this package don't have a program. thanks & regards pranay.
July 11th, 2011 2:34am

Hello - Have you seen the below thread? May be this will help you ... http://social.technet.microsoft.com/Forums/en-US/configmgrosd/thread/517248d3-da85-45d1-8b72-56ccbdca0e37 See the reply from Michael PetersenAnoop C Nair - This posting is provided "AS IS" with no warranties or guarantees, and confers no rights. |Please remember to click Mark as Answer on the post that helps you, and to click Unmark as Answer if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Free Windows Admin Tool Kit Click here and download it now
July 11th, 2011 2:50am

I do not think the problem is with your script, but with your Unattened.xml! do you use a custom one in the apply OS step? and if so try and remove and only use one created by SCCM. To test if the computer name is added to the xml. you can open a prompt (F8) and once the WinPE part of the TS finishes, you can check the unattend.xml in windows\panther\unattend\unattend.xml by opening it in notepad.Michael Petersen My Deployment Blog - http://blog.coretech.dk/mip
July 11th, 2011 3:19am

thanks for your reply, @ michael no it's not a custom image but it's the image which i use with most of my deployment and it runs perfectly fine i don't know why in this case after adding the script it's displaying the error message.... m i placing the script correctly or does the position needs to be changed... please help... pranay
Free Windows Admin Tool Kit Click here and download it now
July 12th, 2011 12:32am

Well, all the script does is change the OSDComputername variable, which is automatically added to the Unattend.xml weather or not you make changes to it... so i cant really see how your script could mess that up, unless the name it creates it invalid some how. And as i explained earlier, you can check that from the windows\panther\unattend\unattend.xml file just before the pc reboots from winpe to full osMichael Petersen My Deployment Blog - http://blog.coretech.dk/mip
July 12th, 2011 3:21am

"unless the name it creates it invalid some how" i think this is the thing happening....every time i run the ts i get the error message :- " windows could not parse or process the unattend answer file for pass(specialize).the setting specified in the answer file cannot be applied.the error was detected while processing settings for component[Microsoft-windows-shell-setup]". and after this the machine restarts and does not allow me to login because of which i am not able to check the unattend.xml file... pranay.
Free Windows Admin Tool Kit Click here and download it now
July 12th, 2011 9:20am

Enable the command prompt and press F8 as soon as PE boots up. This will prevent it from rebooting into minisetup after the image is layed. You can then check your unattend.xml prior to windows setup trying to use it.
July 12th, 2011 9:50am

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

Other recent topics Other recent topics