' Sample script to Tattoo the registry during a SCCM task seqeunce with usefull information ' Written by Jorgen@ccmexec.com dim osd dim oreg dim strkeypath Dim env const HKEY_LOCAL_MACHINE = &H80000002 set env = CreateObject("Microsoft.SMS.TSEnvironment") Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv") 'Variables 'Main Registry Key path strKeyPath = "SOFTWARE\CCMEXEC" 'Values IntallDateTime = formatdatetime(date,2) & " " & formatdatetime(time,3) AdvertisementID = env("_SMSTSAdvertID") Organisation = env("_SMSTSOrgName") TaskSequenceID = env("_SMSTSPackageID") Packagename = env("_SMSTSPackageName") MediaType = env("_SMSTSMediaType") TSVersion = env("TSVersion") ClientVersion = env("Clientversion") MachineName = env("_SMSTSMachineName") Installationmode = ("_SMSTSLaunchMode") 'Create the main Registry Key oReg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath 'Write Values to the Registry Call writereg ("Installed Date", IntallDateTime) Call writereg ("AdvertisementID",AdvertisementID) Call writereg ("Organisation",Organisation) Call writereg ("Task Sequence Name",Packagename) Call writereg ("Media Type",MediaType) Call writereg ("Task Sequence version",TSVersion) Call writereg ("Client Version", ClientVersion) Call writereg ("Computername", MachineName) Call writereg ("Installation Type", Installationmode) '----------- Write to registry --------------- Function writereg(strValueName, strValue) oReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue End Function