Windows server 2003 and Windows XP – How to add windows user to group

Posted by aidas | Posted in Command line, Windows 2003, Windows XP | Posted on 17-05-2009

0

This post will show you how to add local user to group on your Windows machine. Lets say we want to add local user account “testuser” to group “Administrators”.

1. COMMON WAY

Right click mouse on “My computer” and select “Manage” to open Computer Management window. Expand “Local users and groups” and select “Groups”. In the right pane right click on “Administrators” and select “Properties”.

windows user group

In “Administrators properties” window click “Add…” . Type testuser and hit “Check Names” to verify that user exists on local system. Press “OK” and you are done !

2. ADVANCED WAY

To add “testuser” to “Administrators” group open command line on your Windows machine and type:

net localgroup Administrators testuser /add

Windows server 2003 and Windows XP – How to create windows user

Posted by aidas | Posted in Command line, Windows 2003, Windows XP | Posted on 17-05-2009

0

This post will show you how to create local user on your Windows machine. Lets say we want to create local user account named “testuser” with password “Passw0rd”.

1. SIMPLE WAY

Right click mouse on “My computer” and select “Manage” to open Computer Management window. Expand “Local users and groups”, right click on “Users” and select “New User…”

windows user

In “New User” window enter this information:

User name: testuser
Password: Passw0rd
Confirm password: Passw0rd
Disable “User must change password at next logon” option.

Click “Create” button and you are done.

2. ADVANCED WAY

To create local user account “testuser” open command line on your Windows computer and type:

net user testuser Passw0rd /ADD

Windows server 2003 and Windows XP – How to control remote command line

Posted by aidas | Posted in Command line, Tools, Windows 2003, Windows XP | Posted on 16-05-2009

0

This post will show you how to get control of remote command line using psexec . Psexec is part of “pstools” written by Mark Russinovich and can be downloaded here . Lets say we want to connect to server named “testserver” and get control of its command line. To do it open command line on your Windows server 2003 and type:

psexec \\testserver cmd


Windows server 2003 – How to build IPsec policy rule via command line

Posted by aidas | Posted in Command line, Networking, Windows 2003 | Posted on 15-05-2009

0

This post will show you how to build IPsec policy rule using command line on your Windows server 2003.

Lets say we want to block TCP 80 port to make internal web sites inaccessible. First of all we need to create IPsec policy. To do it open command line and type:

netsh ipsec static add policy name=”Block TCP port 80″ description=”Block any internal web sites”

Next step is to create filter for newly created policy. To create it type:

netsh ipsec static add filter filterlist=”80 TCP” srcaddr=any srcport=0 dstaddr=me dstport=80 protocol=tcp mirrored=yes

srcaddr – source address
srcport – source port
dstaddr – destination address
dstport – destination port

Next lets create filter action to block traffic. To do it type:

netsh ipsec static add filteraction name=block action=block

Now we have all needed components to build IPsec policy rule. Policy, filter and filter action. To build policy rule type:

netsh ipsec static add rule name=”Block TCP 80″ policy=”Block TCP port 80″ filterlist=”80 TCP” filteraction=”block”

And the last step is to activate newly created rule. To do it type:

netsh ipsec static set policy name=”Block TCP port 80″ assign=y

Windows server 2003 and Windows XP – How to set service account password via command line

Posted by aidas | Posted in Command line, Windows 2003, Windows XP | Posted on 15-05-2009

0

This post will show you how to notify Windows about service account password change using command line.

Lets say we have service named “Symantec Antivirus” and it runs as local user account named “testuser” (Log On As) . For security purposes we changed password for this user to “NewPassword“. To notify “Symantec Antivirus” that password for its service account was changed open command line and type:

sc config “Symantec Antivirus” password= NewPassword

Note that there is space between equals sign and password value.

Windows server 2003 and Windows XP – How to list DNS servers for your domain via command line

Posted by aidas | Posted in Active directory, Command line, Windows 2003, Windows XP | Posted on 15-05-2009

0

Quick tip for you how to find all DNS servers for your domain. Lets say that we want to list all DNS servers for domain named testdomain.lan . To do it open command line on your Windows server 2003 or Windows XP machine and type:

nslookup testdomain.lan

Windows server 2003 and Windows XP – How to test DNS configuration via command line

Posted by aidas | Posted in Active directory, Command line, Windows 2003, Windows XP | Posted on 15-05-2009

0

This post will show you how to test DNS configuration using command line on your Windows server. To do it open command line and type:

netsh diag show test

This command will perform quick network configuration test by pinging all DNS servers and gateways in your TCP/IP configuration.

Also you can test DNS by runing netdiag tool which is part of Windows Resourse Kit. To diagnose your DNS problems with this tool open command line and type:

netdiag /test:dns

Windows server 2008 – How to reset license activation period via command line

Posted by aidas | Posted in Command line, Windows 2008 | Posted on 14-05-2009

0

By default you have option to use Windows server 2008 for 60 days without activation . Do you know that you can reset this activation period 4 times per installation? In that case actual time of Windows server 2008 usage without activation increases to ~240 days. This post will show you how to reset it. To do it open command line and type:

slmgr -rearm

Windows XP – How to disable fault logging (Dumprep)

Posted by aidas | Posted in Command line, Registry, Windows XP | Posted on 13-05-2009

0

This quick how to will show you the way to ged rid of Dumprep.exe which is responsible for error logging to a file and sending to Microsoft. When serious error hits your system you always get prompt to notify Microsoft by sending error code to it. In some cases this prompting may result performance issues on your system. If you want to disable Dumprep.exe open command line on your Windows XP and type:

REG DELETE HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /V Dumprep /F\

Press Enter.

After that restart your computer.

Windows server 2003 and Windows XP – How to reset Windows time service via command line

Posted by aidas | Posted in Command line, Windows 2003, Windows XP | Posted on 13-05-2009

0

In this short post i will show how to reset Windows time service if it is not working properly on your Windows server 2003 or Windows XP machine. To perform reset open command line ant type:

w32tm /unregister press Enter

w32tm /register press Enter

Windows server 2003 and Windows XP – How to change power management options via command line

Posted by aidas | Posted in Command line, Windows 2003, Windows XP | Posted on 12-05-2009

0

This post will show you how to use command line tool powercfg to change power management options. Lets say we need one power-scheme policy for all our portable computers. In this case we will use command line tool powercfg and create bat script which will be distributed to all portable computers users as logon script. Requirements are:

* power-scheme must be set to “Portable/Laptop”
* plugged in monitor turn off – Never
* on battery monitor turn off – 15 min
* plugged in system standby – Never
* on battery system standby – 25 min
* plugged in hard disks turn off – Never
* on battery hard disks turn off – 45 min

To create script open notepad and type:

REM Set power-scheme to Portable/Laptop
powercfg /setactive “portable/laptop”
REM Set plugged in monitor timeout to Never
powercfg /change “portable/laptop” /monitor-timeout-ac 0
REM Set on battery monitor timeout to 15 minutes
powercfg /change “portable/laptop” /monitor-timeout-dc 15
REM Set plugged in system standby to Never
powercfg /change “portable/laptop” /standby-timeout-ac 0
REM Set on battery system standby to 25 minutes
powercfg /change “portable/laptop” /standby-timeout-dc 25
REM Set plugged in hard disks timeout to Never
powercfg /change “portable/laptop” /disk-timeout-ac 0
REM Set on battery hard disks timeout to 45 minutes
powercfg /change “portable/laptop” /disk-timeout-dc 45

Save file as power.bat and distribute to your notebook users as logon script manually or through group policy

Note that you can type powercfg /? in command line for more power management examples

Windows server 2003 – How to backup IIS metabase via command line

Posted by aidas | Posted in Command line, Scripting, Windows 2003 | Posted on 11-05-2009

0

This article will explain how to backup IIS metabase using command line. To perform backup open command line on your Windows server 2003 and type:

cscript iisback.vbs /backup /b <backupname>