Thursday, July 10, 2008

Net Command

NET USER - allows for password management and creation of local users.

net user bill hat /add
user bill cat

The example above creates a user called bill with the password of "hat".
The next line changes the password to cat.

I often use this to regularly change all local "administrator" account to a unique value across all workstations.

NET Localgroup - is used to create/delete local groups as well as add/remove members.

net localgroup flames /add
net localgroup flames fog,madness /add
net localgroup flames

The example above creates the group called clowns and adds the members bozo and clairabelle to the group clowns. Finally, it lists all the members of the group.

I often use this to add/remove various DOMAIN groups to/from the local administrators group as the desktop administrator for a group of computer changes.

NET START/STOP service - This command is used to start/stop a service or retreive a list of all running services.

net start (This will list all running services)
net stop workstation (This stops the workstation service)
net start workstation (This restarts the workstaion service)

This is useful when a service has a file locked that needs updating. Simply stop the service, update the file, and restart the service. Sometimes I also redirect the output of the "net start" command to a text file and search that result to see if a required service, such as an anti-virus package, is running. Below is a sample batch file to perform such a task.

net start c:\list.txt
find "Requiredservice" c:\list.txt
if errorlevel=0 goto end


Post a Comment


Subscribe in Bloglines Msn bot last visit powered by MyPagerank.Net Yahoo bot last visit powered by MyPagerank.Net
I heart FeedBurner downtime checker The Ubuntu Counter Project - user number # 31290

Twitter Delicious Facebook Digg Stumbleupon Favorites More

Powered by TadPole