Create_User.bat


@ECHO OFF
REM Get username and password from user’s input
set var1=%1
set var2=%2

REM Don’t allow user to change password
NET USER %var1% %var2% /add /expires:never /passwordchg:no

REM User’s password never expire
wmic useraccount where “Name=’%var1%'” set Passwordexpires=false

REM Add user to remote desktop group
NET localgroup “Remote Desktop Users” %var1% /add

REM Create user profile
runasspc.exe /program:”c:\windows\system32\reg.exe” /user:”%var1%” /password:”%var2%” /quiet

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s