Windows IT Pro is the leading independent community for IT professionals deploying Microsoft Windows server and client applications and technologies.
  
  
  Advanced Search 


November 1997

NET Commands


RSS
Subscribe to Windows IT Pro | See More Systems Administration Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!

Run the NET GROUP and NET LOCAL GROUP commands on any other global and local groups to obtain a list of members, again redirecting the output to a text file. Convert these text files to batch files that will add the appropriate groups, and place the newly added users into them. Don't worry about usernames that are not part of Engineering. The new domain will not recognize them and will ignore them.

Finally, run the original batch file that added the Engineering users to the new domain. But this time, run it on the original domain and change the /add switch to /del. This command will remove the users from the original domain. If you want, you can remove any groups that you no longer need.

This approach has a few potential pitfalls. For example, you will encounter an error if you are trying to add a user with a name that already exists on the domain. If you do not spot the error, you might add the wrong user to a group. However, this approach works just fine if your original domain has outgrown the estimated number of users. You simply add a new domain and populate it with users from the original domain. Because the new domain is empty, you won't encounter conflicts when moving usernames.

Security is another issue. The new accounts will not have passwords unless you assign them in the batch file. And although the added users should have passwords that adhere to the minimum password-length policy, I was able to add user accounts with blank passwords and log on using these accounts with no restrictions. Even when I specified in the NET USE command that a password was required, I was still able to log on to a new account with no password, and I wasn't prompted to change the password. In fact, the one option I could not find was to force the user to change the password at the next logon, which is the default when you add a user through the User Manager interface.

Security Policy Settings
Now that you have added all those users, NET ACCOUNTS will let you modify the password and logon requirements for all the accounts in your accounts database, changing settings for minimum password length and password expiration. You can even use NET ACCOUNTS to force a synchronization of accounts, with the command

net accounts /sync

Run this command from a Primary Domain Controller (PDC) to synchronize all the Backup Domain Controllers (BDCs) with the PDC. If you run it from a BDC, you synchronize only that one server with the PDC.

Server Configuration and Control
You can display and configure the settings for a service with the NET CONFIG command, and start, pause, and stop a service with the NET START, NET PAUSE, and NET STOP commands followed by the service name. You can configure the server service and the workstation service with the NET CONFIG SERVER or NET CONFIG WORKSTATION command. You can stop services such as SQL Server (which runs as a service) by adding the name of the service to the appropriate NET command:

net stop MSSQLServer

And of course, you can do the same to any NT service, including the browser, the server service, and the net logon service.

Batch Files
Because you run all these commands from the command prompt, you can combine them into batch files. You can run the batch file interactively or at a scheduled time using NT's built-in AT command. (For more information on using the AT command to schedule jobs, see Windows NT Help or type

at /?

at the command prompt for a list of parameters.)

I showed you some examples for adding users and groups to a domain. Other possible uses include stopping services at night or before scheduled maintenance operations, such as backups or disk defragmenting. Once the scheduled operation is complete, you can restart the services.

A Quick Help Message Lookup
Suppose users call you and say that they just ran into an operating system error, and they have the error number but not much more information. If they are running NT, you can quickly get a short explanation of the error. Type

net helpmsg <message#>

For example, NET HELPMSG 2182 will tell you that you are trying to start a service that is already running. OK, so this command doesn't produce a comprehensive message database, but it's available on the system if you need it.

Synchronize Your Clocks
Systems administrators often use the NET TIME command to synchronize the time on servers, and sometimes on client workstations, around the network. Keeping the time synchronized is important for applications such as Systems Management Server (SMS) and for tasks such as scheduled backups of user files.

You can include the NET TIME command in a user's login script, to make sure that the user's computer is always synchronized with the server. The syntax is

net time //server_name /set /y

to synchronize the clock of the local computer with that of the server you specify. And yes, it works even across time zones.

Back to Basics
You can do so much with NET commands. Try them out on your network, and see how you can use them to automate and simplify tasks. (For more useful NET commands, see Mark Minasi, "Knowing the Angles of NetBIOS Suffixes," February 1997, and "Inside a NetBIOS Name Resolution," March 1997.) In these days of browser interfaces and wizards, people forget plain old command line utilities and batch files. They typify an older generation of software: programs that did only one thing but did it well and did it fast. Command line utilities have a place, even in a modern operating system.

End of Article

   Previous  1  [2]  Next  


Reader Comments
Great article! DOS client is alive and well. Still a very handy tool to put in your bag whether your installing a new OS, or doing brute force connections to a network share.

However, I have been searching for eons to find documentation re 'DOS Client'.

Where is there a decent explanation of the error codes and what they mean?

Paul Jensen, MCSE+I, MCT March 15, 2000


I found this site very helpful. I am looking for an issue which I couldn't. I am getting error message whenever i try to start the Net Logon service on NT member server. "error 1787: sam database has no computer account" Can you help?

Kamran Khan May 23, 2001


i am trying to map a printer to a local computer but all the time i am getting error 5 and also its always asking for username and password but before it was fine
even with admin password its not working again

hamed April 02, 2004


Good article but i still dont know how to make a administrative account through this. All i can do is make a limited one.

john mcgarrah May 15, 2004


would be better if it described commands in more detail.

Anonymous User October 24, 2004 (Article Rating: )


The article is too good
well can any one help me in tracing a user through a domain and knowing as to from which workstation dose he logs in
OR can I know as to in a particular given point of time how many computers are working or are in a running process in a given domain. I want this info very urgently, if any one finds a solution to this please post it thanks and have a great day


Anonymous User January 16, 2005


You must be a registered user or online subscriber to comment on this article. Please log on before posting a comment. Are you a new visitor? Register now




Top Viewed ArticlesView all articles
Command Prompt Tricks

One reader shares his tip for setting up the command prompt to reflect a remote path. ...

WinInfo Short Takes: Week of November 23, 2009

An often irreverent look at some of the week's other news, including some post-PDC some soul searching, a Google Chrome OS announcement and a Microsoft response, Windows 7 off to a supposedly strong start, the Jonas Brothers and Xbox 360, and so much more ...

2009 Windows IT Pro Editors' Best and Community Choice Awards

Picking a favorite product from an impressive crowd of competitive offerings is never an easy task, and such was the case with our Editors' Best and Community Choice awards this year. ...


Related Events Deep Dive into Windows Server 2008 R2 presented by John Savill

Configuration Manager SP1 and R2 Overview

Check out our list of Free Email Newsletters!

Windows OSs eBooks Understanding and Leveraging Code Signing Technologies

A Guide to Windows Certification and Public Keys

SQL Server Administration for Oracle DBAs

Related Windows OSs Resources Introducing Left-Brain.com, the online IT bookstore
Looking for books, CDs, toolkits, eBooks? Prime your mind at Left-Brain.com

Discover Windows IT Pro eLearning Series!
Clear & detailed technical information and helpful how-to's, all in our trademark no-nonsense format


Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro DevProConnections IT Job Hound
Left-Brain.com Technology Resource Directory asp.netPRO ITTV Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 © 2009 Penton Media, Inc. Terms of Use | Privacy Statement