Solved

script, batch file, windows 7, username create script

Posted on 2014-03-05
6
6,639 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
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 

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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
wondershare 17 55
Removing Administrative privilege 4 92
Elderly Mom computer-how to use her computer to monitor her health 4 28
Previous versions always empty 9 29
OfficeMate Freezes on login or does not load after login credentials are input.
You may have a outside contractor who comes in once a week or seasonal to do some work in your office but you only want to give him access to the programs and files he needs and keep privet all other documents and programs, can you do this on a loca…
This Micro Tutorial will teach you the basics of configuring your computer to improve its speed. It will also teach you how to disable programs that are running in the background simultaneously. This will be demonstrated using Windows 7 operating…
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum editing capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.

813 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