Quantcast
Channel: Configuration Manager 2012 - Operating System Deployment forum
Viewing all articles
Browse latest Browse all 9126

VBS script during task sequence issues

$
0
0

Hi,

I am trying to get AD extensionAttribute1 populated with a variable for the computer account during a task sequence.

I have created a variable called OSDTechnician on the collection, along with the variable OSDComputerName so that the technician enters the machine name and his domain name after selecting the task sequence in PE.

The script is running after the config manager setup step and rebooting into the non winpe image.

The script takes the OSDTechnician variable and 'should' update AD extensionAttribute1 for the machine with the OSDTechnician value. However, it remains blank.

The SMSTS log shows this:

Active Directory: The attribute syntax specified to the directory service is invalid.

Which, to me at least, shows that it passing a blank value.

However, if I run this in the task sequence using F8 and a runas with the domain account I have specified in the command line step, it works. Also, if i echo out the value it works too.

Here is the script I am using:

set env = CreateObject("Microsoft.SMS.TSEnvironment")
OSDTech = env("OSDTechnician")
OSDName = env("OSDComputerName")

SelectYourAttribute = "extensionAttribute1"
    'WriteToYourAttribute= "OSDTechnician"
    DebugMode = "No"

Set objSysInfo = CreateObject("ADSystemInfo")
    Set objComputer = GetObject("LDAP://" & objSysInfo.ComputerName)
   
   objComputer.Put SelectYourAttribute, OSDTech
        objComputer.SetInfo
   
    if DebugMode = "Yes" Then  
       ' MsgBox("Script has reached its end.")
    End If

Any help is appreciated.

Thanks


Viewing all articles
Browse latest Browse all 9126

Trending Articles



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