• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 467
  • Last Modified:

Need a Script to add local user

Need a powershell script or batch file that I can run during a light touch deployment (MDT) of Windows 7 that will add a LOCAL user, make the user auto login, and add a few IE favorites for that local user.

THANKS.
0
tfgeorge
Asked:
tfgeorge
  • 2
1 Solution
 
johnb6767Commented:
Untested, but I dont see why this wouldnt work.....

Please test on a physical build first.....
@echo off
net user John P@ssw0rd /add
REM Change Administrators to the group needed locally, or REM/Remove the line below
net localgroup Administrators John /add

REM Adding the Autologon....
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v "AutoAdminLogon" /d "1" /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v "DefaultPassword" /d "P@ssw0rd" /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v "DefaultUsername" /d "John" /f

REM Adding a Runonce at logon to copy favorites.....
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" /v "FavoritesCopy" /d "\\pathto\server\storingfavorites\favorites.bat" /f
exit

Save the following in "\\pathto\server\storingfavorites\" as favorites.bat

@echo off
copy  /Y "\\pathto\server\storingfavorites\*" "%userprofile%\Favorites\"
exit

Open in new window

0
 
tfgeorgeAuthor Commented:
John, I'll play with it. The user needs to be NON-admin
0
 
johnb6767Commented:
Glad it worked....
0

Featured Post

 The Evil-ution of Network Security Threats

What are the hacks that forever changed the security industry? To answer that question, we created an exciting new eBook that takes you on a trip through hacking history. It explores the top hacks from the 80s to 2010s, why they mattered, and how the security industry responded.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now