[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Command line user configuration

Posted on 2007-10-13
5
Medium Priority
?
626 Views
Last Modified: 2008-01-09
Hi,
I am using the following command to add users to my Windows Server 2003

net user *username* *password* /add /passwordchg:no /fullname:*Users name* /comment:*comments*

However I would like to also set the password to never expire, and to set the Remote Access Permission of the user to "Allow Access". I can't find any options within this command, or alternatvie commands that could be used to achieve this. Are there any command options or alternatvie commands to do this?
0
Comment
Question by:tonygoodchild
  • 2
  • 2
5 Comments
 
LVL 70

Expert Comment

by:KCTS
ID: 20071508
If this is a domain then you need to be entering domain accounts in Active Directory not local accounts on the PCs.

You can use DSadd to add users to the domain - see http://www.computerperformance.co.uk/Logon/DSadd_add_user.htm
0
 

Author Comment

by:tonygoodchild
ID: 20071519
Hi, no this isn't a domain, these have been set up as local users, all they are doing is connecting in to a VPN to access local resources on the server.
0
 
LVL 70

Expert Comment

by:KCTS
ID: 20071557
0
 
LVL 26

Accepted Solution

by:
Farhan Kazi earned 2000 total points
ID: 20071694
Greetings Tonygoodchild,

* Following statment will set "PasswordExpires" attribute:

WMIC USERACCOUNT WHERE "Name='Username'" SET PasswordExpires=FALSE

To add users to Terminal Services RDP permissions:

WMIC RDPERMISSIONS WHERE TerminalName="RDP-Tcp" Call AddAccount "%COMPUTERNAME%\\Username",X

X: The type of access to be granted:
0 = WINSTATION_GUEST_ACCESS
1 = WINSTATION_USER_ACCESS
2 = WINSTATION_ALL_ACCESS

Like:
WMIC RDPERMISSIONS WHERE TerminalName="RDP-Tcp" Call AddAccount "%COMPUTERNAME%\\farhankazi",2

To verify above permission:
1. Open Terminal Services Configuration.
2. In the Connections folder, right-click RDP-Tcp.
3. Click Properties.
4. On the Permissions tab you will find users who have permissions

Hope this helps!
Farhan
0
 
LVL 26

Assisted Solution

by:Farhan Kazi
Farhan Kazi earned 2000 total points
ID: 20071737
Oh sorry I just saw you want dial-in permission, try following:

NetSh RAS set user name=<UserNameHere> dialin=PERMIT

Like:
NetSh RAS set user name=farhankazi dialin=PERMIT

Hope this helps!
Farhan
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Know what services you can and cannot, should and should not combine on your server.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…

872 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