Solved

Script or batch to create Windows user

Posted on 2014-12-13
2
204 Views
Last Modified: 2014-12-28
I need to auto create a new Windows 7/2003/2008 user account that is a local admin but that is hidden from the user login screen.  I would like the username to be backup_imager and the password to be something complex that I can tweak within the script or batch.  I want to be able to run this on the local computer and it create the new user account, add it to the administrators group and then hide it.
0
Comment
Question by:murryc
2 Comments
 
LVL 68

Accepted Solution

by:
Qlemo earned 500 total points
ID: 40498032
To hide users from the logon screen, they need to appear in
HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList as a DWord value set to 0. So in a cmd batch:
@echo off
net user  backup_imager SomethingComplexThatICanTweak /add
net localgroup administrators backup_imager /add
reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList" /v backup_imager /t REG_DWord /d 0

Open in new window

This script does not perform any error handling, so applying it twice will result in some messages.
0
 

Author Comment

by:murryc
ID: 40520450
Perfect!
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Over the years I have built up my own little library of code snippets that I refer to when programming or writing a script.  Many of these have come from the web or adaptations from snippets I find on the Web.  Periodically I add to them when I come…
How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now