Discourage Posted May 19, 2014 Report post Posted May 19, 2014 Hi all, I hope you can help me with a small problem I am having trying to get a vbs to run to update a computer extensionattribute in AD during OSD. I have created 2 variables on the collection that the TS runs against. These are: OSDComputerName and OSDTechnician. OSDComputerNameis simply to name the machine when launching the TS, and OSDTechnician to, hopefully, populate the computer AD account extensionattribute1 with that value. The script I am using works fine in windows, it works fine if I run the script during the TS, by pressing F8 and running the following: runas /user:uk\useraccount /netonly cmd.exeThen in the new window, under these credentials running the script works fine. (The account I actually use is a Domain Admin account). However, if I simply just let the TS run, the script runs but AD never gets updated. (The script is set in the TS to use this domain admin account on a run command line task). Also, this step is after the config manager client install. SMSTS shows this: Active Directory: The attribute syntax specified to the directory service is invalid. Which leads me to believe that it is passing a blank value OR the account\script cannot read the TS variable to pass to the vbs variable. The script I am using is here: set env = CreateObject("Microsoft.SMS.TSEnvironment") OSDTech = env("OSDTechnician")OSDCompName = env("OSDComputerName") ExtAttr = "ExtensionAttribute1"Set objSysInfo = CreateObject("ADSystemInfo")Set objComputer = GetObject("LDAP://" & objSysInfo.ComputerName)objComputer.Put ExtAttr, OSDTechobjComputer.SetInfo If anyone can help with this, or if anyone has a script that does the same thing that they know works, it would be appreciated. Thanks =) Quote Share this post Link to post Share on other sites More sharing options...
Mikey C Posted May 19, 2014 Report post Posted May 19, 2014 To troubleshoot this, you could try hard coding a value and seeing if the script updates AD with that information when run in the TS, that removes the TS variable being interpreted correctly from the equation. Inversely, you could add another command which interprets the TS variable and does something else, like just create a local text file to confirm it has run, that would avoid AD from the equation. Quote Share this post Link to post Share on other sites More sharing options...
Discourage Posted May 22, 2014 Report post Posted May 22, 2014 Hi, Thanks for the feedback, I have run it with a hardcoded value and it does update AD. So the variable is not working, but does work with a runas. The commandline is using a domain admin account to run too. Any ideas? Quote Share this post Link to post Share on other sites More sharing options...