landesk unattend error on specialize computername ldhostname
You are in landesk 9.0 (sp2 or SP3…) and you had made a sysprep /generalize instead of /audit.
Let me explain you why you should do “/audit” : If you don’t use the audit mode process you’ll lose the ability to change each computer name on the fly back to whatever it was before as the option to edit the unattend.xml and inject it before rebooting into the finalized windows state. Unless we add this script to the provisioning task after the image is laid down and booted back into that final Windows state. Yes, if you do “/generalize” it doesn’t want to interpret %ldhostname% in the unattend.xml file.
don’t panic… you not have to rebegin all. here the solution:
In the “System Configuration” section of the provisioning template add (in first position):
1) copy to c:\windows\system32 renamecomp.exe (on target computer)
2) Execute file – c:\windows\system32\renamecomp.exe %ldHostName%
3) Reboot/Restart
4) and continue the template: Join Domain… etc
some time, it does not work, so not panic at all. There is another solution:
1) make this file (renamecompe.vbs) into …\landesk\scripts on your core server:
Dim colNamedArguments : Set colNamedArguments = WScript.Arguments.Named
VbsPath = Left(WScript.ScriptFullName,InStrRev(WScript.ScriptFullName,"\"))
UsrName = colNamedArguments.Item("username")
Password = colNamedArguments.Item("password")
Name = colNamedArguments.Item("NewCompName")
Set objWMIService = GetObject("Winmgmts:root\cimv2")
For Each objComputer in _
objWMIService.InstancesOf("Win32_ComputerSystem")
Return = objComputer.rename(Name,Password,Username)
WScript.Echo Err.Number
Next
2) on your template create these sections\tasks:
a) on OS installation:
b) on system configuration:
the command-line parameters is:
[/username:%localadministrator% /password:%LDPass% /NewCompName:%ldHostName%]
YES : “%localadministrator%”. I hope for you, you do not disable local administrator before capture. And Add localadministrator into public variable with the local administrator account name
.
..
…
….
…..ouch!
lol….. : if you disable it…. do it:
add this in the beginning of renamecomp.vbs to reactive localadmin account:
Dim oWsh, sCmd1,sCmd2
Set oWsh = CreateObject("WScript.Shell")
‘for EN:
sCmd1 = "cmd /c net user administrator /active:yes"
‘for FR:
sCmd2 = "cmd /c net user administrateur /active:yes"
iRetVal1 = oWsh.Run(sCmd1, 0, true)
iRetVal2 = oWsh.Run(sCmd2, 0, true)
/image%2F0881799%2F20140610%2Fob_a8c7fe_logo2.jpg)
Commenter cet article