none
adding local administrator in task sequence RRS feed

  • Question

  • Hi,

    Is there a way to create local account other than changing unattended.xml   

    Thanks

    Monday, September 25, 2017 3:12 PM

Answers

All replies

  • Lots of ways to do this:

    1. Edit unattend.xml: https://social.technet.microsoft.com/Forums/en-US/eec05a3c-0f3e-4531-8176-c2b1bbb674dc/create-new-admin-account-in-mdt?forum=mdt

    2. Prestage the computer under Advanced Configuration -> Database -> Computers.  Add the computer and go into Properties.  On the Administrators tab you can add an existing local user on the image or domain user as an admin.

    3. Add a new Run Command Line step to your task sequence and use "net user" command or use some form of scripting whether it be batch, Powershell, VBS, etc.

    Batch: 

    net user "owner" "mypassword" /add
    net localgroup "Administrators" "owner" /add
    WMIC USERACCOUNT WHERE "Name='owner'" SET PasswordExpires=FALSE
    WMIC USERACCOUNT WHERE "Name='owner'" SET Passwordchangeable=FALSE

    In PowerShell you could use new cmdlet Add-LocalGroupMember which greatly simplifies the process of adding a user to admin group: https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.localaccounts/add-localgroupmember?view=powershell-5.1


    Cheers,
    Anton

    Vacuum Breather Blog | Wing Commander Saga | Twitter

    Note: Posts are provided "AS IS" without warranty of any kind. If posts are helpful please don't forget to rate them as "Helpful" or as "Answer".

    • Proposed as answer by Anton Romanyuk Monday, September 25, 2017 6:25 PM
    • Marked as answer by supportsib Tuesday, September 26, 2017 5:19 PM
    Monday, September 25, 2017 4:03 PM
  • Hi,

    3. Add a new Run Command Line step to your task sequence and use "net user" command or use some form of scripting whether it be batch, Powershell, VBS, etc.

    In task sequence where we should add the  'run command line ' 

    ?


    Monday, September 25, 2017 5:35 PM
  • At some point during "State Restore" phase as you need to run this in full OS.

    Cheers,
    Anton

    Vacuum Breather Blog | Wing Commander Saga | Twitter

    Note: Posts are provided "AS IS" without warranty of any kind. If posts are helpful please don't forget to rate them as "Helpful" or as "Answer".

    Monday, September 25, 2017 6:25 PM
  • For you number 3 solution - I added this to my MDT task sequence as an application and once install I get a window that opens and says "The password entered is longer than 14 characters. Computers with Windows prior to Windows 2000 will not be able to use this account. Do you want to continue this operation? (Y/N) [Y]: "

    is there a way to get rid of this message so it install without answering or silently I guess? Thanks 

    Monday, January 14, 2019 8:57 PM