• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 471
  • 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

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