Running command line on task sequence to add local admin user account. RRS feed

  • Question

  • I have created a batch file details below called LocalAdmin details below;

    net user Admin password /add

    net localgroup Administrators admin /add

    net accounts /MxPWAge:unlimited

    I have dropped it into MDTProduction scripts folder.

    On a deploy work bench on task sequence I added a run command line task called Admin users. On command line box I typed 

    cmd.exe /c MDTProduction/Scripts/LocalAdmin.bat

    Start in %SCRIPTROOT%

    The task fails when I deploy an image.

    When I run commands above as administrator manually using cmd they work fine.

    My MDTProduction is running on an external USB drive d:\

    Any help will be appreciated.


    • Edited by ColeMacha Friday, March 2, 2018 8:38 AM
    Friday, March 2, 2018 8:36 AM

All replies