Windows server 2008 and Windows Vista – How to change your license key via command line

Posted by aidas | Posted in Command line, Windows 2008, Windows Vista | Posted on 22-06-2009

0

This post will show you quick way to change license key on your Windows server 2008 or Windows Vista using command line.

Lets say we want to change our license key to AAAAA-BBBBB-CCCCC-DDDDD-EEEEE (Note that this is not legal license key !!!) .

To change key open command line (Start>Run>cmd) and type:

slmgr -ipk AAAAA-BBBBB-CCCCC-DDDDD-EEEEE

key_change

Press “Enter” and You are done !

Windows – How to reset local user password to random one

Posted by Thomas | Posted in Command line, Windows 2003, Windows XP | Posted on 22-06-2009

0

This post will show you how to randomly reset local user password on you Windows machine using command line.

Lets say we have local user named “testuser” and we want randomly reset its password.

For this press Start>Run, type CMD and press “OK” .

In command line type:

net user testuser /random

random_password

Press “Enter”.

Password will be reseted and it will be shown to you after you pressed “Enter” button.

The output will be similar to:

random_password2

Good job!

Windows server 2008 – How to create computer account in Active Directory via command line

Posted by Thomas | Posted in Active directory, Command line, Windows 2008 | Posted on 18-06-2009

0

This post will show you how to create new computer account in active directory using command line.

Lets say, in our scenario,  we want to create  new computer account named “TestPC1″ in default Computers container. Also note that our domain is named “testdomain.com” in this case.

To do it open command line on your Windows server 2008 and type:

dsadd computer cn=TestPC1,cn=Computers,dc=testdomain,dc=com

Windows server 2003 – How to list all Organizational Units via command line

Posted by aidas | Posted in Active directory, Command line, Windows 2003 | Posted on 17-06-2009

0

This post will show how to list all Organizational Units in your domain using command line tool netdom. To list all OU in domain named “testdomain.com” type:

netdom query /d:testdomain.com OU

Note that netdom is part of Windows server 2003 support tools. They can be found on your OS CD (Support\Tools directory).

Windows server 2003 – How to check FSMO role holders

Posted by aidas | Posted in Command line, Scripting, Windows 2003 | Posted on 14-06-2009

0

I`ll show you two quick ways to check FSMO roles on Windows 2003 server.

1. open command line and type :

netdom query fsmo

2. copy this code to notepad and save as fsmo.vbs script :

Set objRootDSE = GetObject(”LDAP://rootDSE”)

Set objSchema = GetObject _
(”LDAP://” & objRootDSE.Get(”schemaNamingContext”))
strSchemaMaster = objSchema.Get(”fSMORoleOwner”)
Set objNtds = GetObject(”LDAP://” & strSchemaMaster)
Set objComputer = GetObject(objNtds.Parent)
WScript.Echo “Forest-wide Schema Master FSMO: ” & objComputer.Name

Set objNtds = Nothing
Set objComputer = Nothing

Set objPartitions = GetObject(”LDAP://CN=Partitions,” & _
objRootDSE.Get(”configurationNamingContext”))
strDomainNamingMaster = objPartitions.Get(”fSMORoleOwner”)
Set objNtds = GetObject(”LDAP://” & strDomainNamingMaster)
Set objComputer = GetObject(objNtds.Parent)
WScript.Echo “Forest-wide Domain Naming Master FSMO: ” & objComputer.Name

Set objDomain = GetObject _
(”LDAP://” & objRootDSE.Get(”defaultNamingContext”))
strPdcEmulator = objDomain.Get(”fSMORoleOwner”)
Set objNtds = GetObject(”LDAP://” & strPdcEmulator)
Set objComputer = GetObject(objNtds.Parent)
WScript.Echo “Domain’s PDC Emulator FSMO: ” & objComputer.Name

Set objRidManager = GetObject(”LDAP://CN=RID Manager$,CN=System,” & _
objRootDSE.Get(”defaultNamingContext”))
strRidMaster = objRidManager.Get(”fSMORoleOwner”)
Set objNtds = GetObject(”LDAP://” & strRidMaster)
Set objComputer = GetObject(objNtds.Parent)
WScript.Echo “Domain’s RID Master FSMO: ” & objComputer.Name

Set objInfrastructure = GetObject(”LDAP://CN=Infrastructure,” & _
objRootDSE.Get(”defaultNamingContext”))
strInfrastructureMaster = objInfrastructure.Get(”fSMORoleOwner”)
Set objNtds = GetObject(”LDAP://” & strInfrastructureMaster)
Set objComputer = GetObject(objNtds.Parent)
WScript.Echo “Domain’s Infrastructure Master FSMO: ” & objComputer.Name

Then open command line and type:

cscript fsmo.vbs



Windows server 2008 – How to list IIS websites on Windows 2008

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

0

This post will show you how to list IIS 7.0 websites on your Windows server 2008 using command line tool appcmd .

Appcmd tool is used to query, create and configure IIS 7.0 server properties, web sites and application pools.

To list all web sites on IIS 7.0 open command line and type:

appcmd list sites

Done!

Windows server 2008 – How to open secure command line on remote server

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

0

This post will show you how to open secure command line on remote Windows server 2008. All communications between client and remote host will be encrypted by Kerberos or NTLM keys. Lets say we want to connect to server named “testserver”. To do it open command line on your Windows server 2008 and type:

winrs -r:testserver cmd

Windows server 2003 and Windows XP – How to reset winsock catalog

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

0

This post will show you how to clear up Winsock Catalog on your Windows server 2003 or Windows XP machine. To do it open command line and type:

netsh winsock reset

Restart your computer after this.

Note that you might need to run IP reset afterwards to completely rebuild your IP stack.

? Winsock catalog – is the interface between your applications and internet. Many spyware reside there when they infect your OS.

Windows server 2008 – How to perform full system backup via command line

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

0

This post will show you how to create full system backup of your Windows server 2008 using command line. Lets say we want to create full system backup and place it to network share \\Backupserver\Data . Open command line and type:

wbadmin start backup -backuptarget \\Backupserver\Data -allCritical -vssFull

Windows server 2003 and Windows XP – How to reset IP stack

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

0

This post will show you the way how to reset IP stack on your Windows server 2003 or Windows XP machine. Lets say we want to reset IP stack and write log to C:\resetlog.txt file. Note that log file is not optional parameter. To perform reset open command line and type:

netsh int ip reset C:\resetlog.txt

Windows server 2003 and Windows XP – How to reset Windows user password

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

0

This post will show you how to change windows user password. Lets say we have local user account “testuser” and want to change its password to Passw0rd .

1. COMMON WAY

Right click mouse on “My computer” and select “Manage” to open Computer Management window. Expand “Local users and groups” and select “Users”. In the right pane right click mouse on “testuser” user and select “Set Password…”

user_password

Click “Proceed” and type new password two times as requested.

2. ADVANCED WAY

To change password open command line and type:

net user testuser Passw0rd

To change password without showing it:

net user testuser *

Windows server 2003 and Windows XP – How to enable or disable 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 enable or disable Windows user. Lets say we have local user account “testuser” and we want to disable it.

1. COMMON WAY

Right click mouse on “My computer” and select “Manage” to open Computer Management window. Expand “Local users and groups” and select “Users”. In the right pane right click mouse on “testuser” user and select “Properties”. In “testuser Properties” window select “General” tab.

Windows user disable

To disable “testuser” check “Account is disabled”, hit “OK” and you are done.

If you want to enable “testuser” account remove check mark from “Account is disabled” and hit “OK”.

2. ADVANCED WAY

To disable “testuser” account open command line on your Windows machine and type:

net user testuser /active:no

To enable “testuser” account type:

net user testuser /active:yes