I am putting together a pretty complex server build process using task sequences. As part of this process, I wrote a VBScript that among other things starts by enumerating the domain that the target machine is a member of.
Running the script from the command line works perfectly.
Running a Task sequence that first boots to WinPE, installs Windows 2003 x64, joins the domain, reboots, installs software, then runs the script, the script fails to obtain the domain information <null value>.
If a run a second task sequence that contains only a 'run command line' step to execute the script, on that same exact machine that was just built using the previous TS, it works perfectly!
For the life of me, I cannot figure out why a TS that runs through an entire build process fails, where the one that does nothing but runs the command works. I should point out specifically that it is the last step of the build TS, meaning it is indeed booted back to the installed OS, and not running from PE. In both instances, I do not specific an account to run the command line under, I let it use the SCCM account.
I tried two different methods to obtain the current domain, including accessing the %USERDOMAIN% env variable, and a RegRead to HKLM\Software\Microsoft\Windows NT\CurrentVersion\WinLogon\DefaultDomainName
I am not using the WMI Win32_ComputerSystem domainname value since it returns the fully qualified domain name, not the friendly one which is what I need.
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.
I am putting together a pretty complex server build process using task sequences. As part of this process, I wrote a VBScript that among other things starts by enumerating the domain that the target machine is a member of.
Running the script from the command line works perfectly.
Running a Task sequence that first boots to WinPE, installs Windows 2003 x64, joins the domain, reboots, installs software, then runs the script, the script fails to obtain the domain information <null value>.
If a run a second task sequence that contains only a 'run command line' step to execute the script, on that same exact machine that was just built using the previous TS, it works perfectly!
For the life of me, I cannot figure out why a TS that runs through an entire build process fails, where the one that does nothing but runs the command works. I should point out specifically that it is the last step of the build TS, meaning it is indeed booted back to the installed OS, and not running from PE. In both instances, I do not specific an account to run the command line under, I let it use the SCCM account.
I tried two different methods to obtain the current domain, including accessing the %USERDOMAIN% env variable, and a RegRead to HKLM\Software\Microsoft\Windows NT\CurrentVersion\WinLogon\DefaultDomainName
I am not using the WMI Win32_ComputerSystem domainname value since it returns the fully qualified domain name, not the friendly one which is what I need.
Share this post
Link to post
Share on other sites