Quantcast
Channel: Configuration Manager 2007 Operating System Deployment forum
Viewing all articles
Browse latest Browse all 1063

Reading Task Sequence variables in x64 environment ?

$
0
0

Hello! I created an HTA which asks for domain, business unit, automatically detects the computer and chassis model and store these infos in custom TS Environment variables… In my process of creating x86 image, at the end of my Task Sequence, I run a Run Command Line step which writes theses infos in the registry.

cscript.exe TS-AddRegInfos.vbs (that runs from a package). This step is working #1 in x86

...and here what TS-AddRegInfos.vbs looks like:

Dim oReg, strkeypath, TsEnv
Const HKEY_LOCAL_MACHINE = &H80000002
Set TSEnv = CreateObject ("Microsoft.SMS.TSEnvironment") 
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")

strKeyPath = "SOFTWARE\XXXX\Image"

ChoixDomaine = TSEnv("CSRDNDomain")
Modele = TSEnv("modelName")
ChoixOU = TSEnv("CSRDNOU")
ChoixImage = TSEnv("Image")
DateInstallation = TSEnv("BuildTime")

 
'Write Values to the Registry
 
Call WriteReg ("Domaine", CSRDNDomain)
Call WriteReg ("Model", Modele)
Call WriteReg ("OU", ChoixOU)
Call WriteReg ("TypeImage", ChoixImage)
Call WriteReg ("DateInstall", DateInstallation)
'----------- Write to registry ---------------
Function WriteReg(strValueName, strValue)
	oReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
End Function

I am having issues writing these infos on my x64 images. I know that the SMS.TSEnvironment doesn’t exist in x64 but I was wondering if there is a workaround ?

I tried checking/unchecking « Disable 64 bit file redirection », Start in : C:\Windows\SysWOW64 with no luck… I also tried (in debug mode, F8) to call the vbs from C:\Windows\SysWOW64\cscript.exe TS-AddRegInfos.vbs with no luck either…

Any idea if the following is possible or if there is a workaround to read the TS values from an x64 machine to write them to registry? This is very useful in x86 but I am having a hard time implementing this in x64... We are using ConfigMgr 07 SP2 and deploying to Windows 7 SP1 x64

Thanks !


Viewing all articles
Browse latest Browse all 1063

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>