/build/static/layout/Breadcrumb_cap_w.png

PC name is failing on scripted install

I'm trying to build two post install tasks for a scripted install, one is to name the machine using wsname that reads from a data file.  And the second is a powershell script that adds the machine to the domain and joins to the appropriate OU.  I'm using the post install task converter with a reboot in between the two funcitons.  When I deploy the installation, the domain join function works perfectly, but the naming script is failing.  I've tested both functions on a local machine, and they both work.  When I check the wsname log, on the newly imaged machine I get an error that the machine is a member of a domain and to use the RCID switch. I have the naming function as the first post install task. Any ideas?


4 Comments   [ + ] Show comments
  • Can you show the runonce converter script you are using? - mmeyer@vu.com 11 years ago
  • @echo off

    IF /I "%~1" EQU "/DEBUG" (
    SET SWITCH=/debug
    ) else (
    set "SWITCH"=""
    )

    if %PROCESSOR_ARCHITECTURE% equ AMD64 (
    set "TAG=_x64"
    ) ELSE (
    set "TAG="
    )

    start /wait runonceex_converter%TAG%.exe %SWITCH%

    And here is the reboot script:

    taskkill /f /IM runonce.exe
    shutdown -f -r -t 1
    ping 127.0.0.1 -n 30 - toucan911 11 years ago
  • Here is my script. Also I had problems setting up my information in setting up to call the script. Here is my line for that to.
    Script

    @echo off

    IF /I "%~1" EQU "/DEBUG" (
    SET SWITCH=/debug
    ) else (
    set "SWITCH"=""
    )

    if %PROCESSOR_ARCHITECTURE% equ AMD64 (
    set "TAG=_x64"
    ) ELSE (
    set "TAG="
    )

    start /wait runonceex_converter%TAG%.exe %SWITCH%

    Command Line
    call runonceex_converter.bat



    I would be glad to help you if needed - mmeyer@vu.com 11 years ago
  • Make sure when you build the script to include the bat and the two programs in a zip file. Once you have then zipped the command line is showing to call the converter. The problem I had when building this was the call. If you do not have that is caused a fail out for me multiple times. - mmeyer@vu.com 11 years ago

Answers (2)

Posted by: SMal.tmcc 11 years ago
Red Belt
1

Are you using the start /wait in front of your commands so they stay sequenced?

Posted by: nheyne 11 years ago
Red Belt
1

I would also try taking off the second postinstall and just see if the naming task completes on its own.


Comments:
  • When I run the naming function on it's own, it works perfectly. - toucan911 11 years ago
    • Your error above suggests that it's not happening in the correct order. Can you give more details about your wsname task? - nheyne 11 years ago
      • I'm using the wsname task that I got from Kace, it consists of two scripts:

        xcopy /S /E /I source c:\source

        reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" /v V1 /t REG_SZ /d "CMD /C \"C:\source\1_wsname_x64.bat\"" /f

        shutdown -r -t 10

        Second Script:

        REM ***** Edit the DefailtUserName to that of the Administrator.
        REM ***** Change the "password" reference to the Administrators password.
        REM ***** Make sure the DefaultDomainNam is correct.



        REM reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Winlogon" /v AutoAdminLogon /t REG_SZ /d 1 /f
        REM reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultUserName /t REG_SZ /d admin /f
        REM reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultPassword /t REG_SZ /d password /f
        REM reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultDomainName /t REG_SZ /d localhost /f



        REM ***** Reference the Help files for WSNAME to see what options are available.
        REM ***** This command will make the name the SerialNumber of the computer *****
        REM ***** use nambedb.dat file with mac addresses and computer names to set computer name.
        REM ***** c:\source\wsname.exe /RDF:"C:\source\namedb.dat" /DFK:$MAC /EXCLUDEADAPTERS[WIRELESS WIFI WLAN BLUETOOTH PPP VMWARE IPSEC]



        start /wait c:\source\wsname.exe /RDF:C:\source\namedb.txt /DFK:$SERIALNUM - toucan911 11 years ago
  • I think I may know what's going on. Your naming task is just a registry key that triggers a batch file, which is in RunOnce. The postinstall task converter uses RunOnceEx, which runs before anything in RunOnce. If your naming task was the actual batch file, it might work. But it's just the registry entry to trigger the batch file later. So the domain script will always run first with this setup. - nheyne 11 years ago
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ