Jump to content


Discourage

OSD VBS issue

Recommended Posts

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.exe
Then 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, OSDTech
objComputer.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 =)

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.