Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

script, batch file, windows 7, username create script

Posted on 2014-03-05
6
6,693 Views
Last Modified: 2014-03-13
Hi experts,

looking for your help....

we have some deployment happening this month, the below users need to be created for all client pc..not domain environment.

Need to create the below user accounts after installing the win 7, can you please help me is it possible to create users running batch file ?



Username 1 :abunlock
Password : Bact!qaz
Group : Users
User cannot change password.
Password Never Expire

Username 2 :auser
Password : Bact!qaz
Group : Users
User cannot change password.
User Must Change password at next logon

Username 1 :abce
Password : Bact!qaz
Group : Administrators
User cannot change password.
Password Never Expire
0
Comment
Question by:Skumar_CCSA
6 Comments
 
LVL 10

Expert Comment

by:Korbus
ID: 39908445
0
 
LVL 36

Expert Comment

by:Mahesh
ID: 39908637
The best option I can see to fulfill your requirement is to use GP preferences

Create brand new GPO and navigate to computer configuration\preferences and navigate to users
There you can create new local users in update mode with required password and remaining password and also you can set their group membership as well

Once you have done, apply this policy on OU containing computers
During next reboot \ GPO update interval new users will be created on client computers
Once it get created next time policy will check if user already exists, then it will skip their recreation.
If some body deletes them, policy will recreate them

Check below link for more information
http://technet.microsoft.com/en-us/library/cc771917.aspx 

Check below link for step by step
http://blog.korteksolutions.com/how-to-create-local-accounts-via-group-policy/

Also if computer configuration is not working then move the settings to the User section of preferences instead of Computer, then enabled group policy loopback processing to apply it to the computer.
Loop back processing can be found under computer configuration\administrative templates\system\group policy in the same GPO

Mahesh
0
 
LVL 10

Expert Comment

by:Korbus
ID: 39908689
Mahesh,
Don't you need a domain and windows server to use group policy?
0
Easy, flexible multimedia distribution & control

Coming soon!  Ideal for large-scale A/V applications, ATEN's VM3200 Modular Matrix Switch is an all-in-one solution that simplifies video wall integration. Easily customize display layouts to see what you want, how you want it in 4k.

 

Author Comment

by:Skumar_CCSA
ID: 39908763
No domain enviornment...
This need to be done through script....
After installing window 7..admin  will run the script and it  will creAte users .
0
 
LVL 10

Accepted Solution

by:
Pramod Ubhe earned 500 total points
ID: 39908968
Method 1 - run a powershell script for multiple computers

Get-Content c:\servers.txt | foreach {
#Create the account
$username = "user1"
$comp = [adsi] "WinNT://$_"
$user = $comp.Create("User", $username)
$user.SetPassword("P@ssw0rd")
$user.SetInfo()
#Set password to never expire
$ADS_UF_DONT_EXPIRE_PASSWD = 0x10000
$user.userflags = $ADS_UF_DONT_EXPIRE_PASSWD
$user.SetInfo()
#Add the account to the local admins group
$group = [ADSI]"WinNT://$_/Administrators,group"
$group.add("WinNT://$_/$username")
}

Method 2 - create batch file with below commands
net user user1 Passw0rd1 /add /passwordchg:no
net localgroup Administrators user1 /add
wmic.exe UserAccount Where Name="user1" Set PasswordExpires=FALSE

Method 3 - create a vb script with below commands
strComputer = "atl-ws-01"
Set colAccounts = GetObject("WinNT://" & strComputer & "")
Set objUser = colAccounts.Create("user", "Admin2")
objUser.SetPassword "09iu%4et"
objUser.SetInfo


***remember to modify these commands for your requirement and test them on test computer/environment, i have also included commands to add accounts in admin group but you can remove it if required.
0
 
LVL 36

Expert Comment

by:Mahesh
ID: 39925857
Ya, Korbus,

You are right

GPO won't work

I think I have over looked question
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup" or a blinking cursor with black screen. A loop for Auto repair will start but fix nothing.  You will be panic as there are no back…
When you try to share a printer , you may receive one of the following error messages. Error message when you use the Add Printer Wizard to share a printer: Windows could not share your printer. Operation could not be completed (Error 0x000006…
This Micro Tutorial will teach you how to change your appearance and customize your Windows 7 interface to your unique preference. This will be demonstrated using Windows 7 operating system.
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

808 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