Tips: Windows 2008 server commands

Windows Server 2008 Core Command Guide
What Command
Set DNS IP Netsh int ipv4 set dns
“local area connection”
static 192.168.1.120 primary
Disable firewall Netsh firewall set
opmode mode=disable
add Credential cmdkey /add:
IP_ADDRESS /user:
administrator /pass:password
Changing password Net user administrator*
Set time and date Control timedate.cpl
Show interfaces Netsh interface
ipv4 interfaces
Set interface IP Netsh interface
ipv4 set address
name=”2”
source=static address=
172.16.11.162
mask=255.255.255.0
gateway=172.16.11.1
View hostname Hostname
Change hostname Netdome rename
computer %computername% /newname:NAME
Restart server Shutdown /r t 0
Join server to domain Netdom join servername /domain:DOMAINNAME /userd:administrator /password:*
Server activation C:\windows\system32
>cscript slmgr.vbs /?
Check expiration date Cscript slmgr.vbs -xpr
Activate server Cscript slmgr.vbs -ato
Automatic updates Cscript Scregedit.wsf
Check automatic update status Cscript scregedit.wsf /au /v
Enable automatic updates Cscript scregedti.wsf /au 4
View Roles install on server Oclist
Install Role Ocsetup role_name
(use oclist to
check role names)
View services started Net start
Uninstall role Ocsetup role_name /uninstall
View logs Wevutil qe system
Enable remote desktop Cscript scregedit.wsf /ar 0
Disable remote desktop Cscript scredit.wsf /ar 1
view remote desktop settings Cscript scredit.wsf /ar v
Allow pre windows vista RDP connection Cscript scredit.wsf /cs 0


Log off from server logoff
Start command prompt cmd.exe
(start from taskmgr if
you close existing windows)
Start virtual disk service to manage disks Net start vbs
Check for windows updates immediately Wuauclt /detectnow

Comments