Windows IT Pro is the authoritative and independent resource for windows nt, windows 2000, windows 2003, windows xp. Features a collection of resources and magazines for windows IT professionals.
  
  
  Advanced Search 


July 2008

Command-line Tools in Windows Server 2008

Manage servers, make backups, and customize your system with these great tools
RSS
Subscribe to Windows IT Pro | See More Backup and Recovery Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!

Executive Summary:

Windows Server 2008 provides command-line tools for managing your Microsoft Windows systems. You can use Icacls to update and back up access control lists (ACLs), Wbadmin or Robocopy for system backups, and WinRS to open a secure command window with a remote host. Oclist and Ocsetup are tools that work only with Server Core installations. ServerManagerCmd, a command-line version of Windows Server 2008's Server Manager, lets you script Server Manager actions.

Like every release of the Windows Server OS before it, Windows Server 2008 includes a set of new command-line tools, some of which come from previous resource kits or support tools and others are new. Although Server 2008 includes Windows PowerShell, none of these new commands are PowerShell commands. For a complete list of commands in Server 2008, you can download the Windows Command Reference from Microsoft’s Web site (https://www.microsoft.com/downloads/details.aspx?FamilyID=5fb255ff-72da-4b08-a504-1b10266cf72a). Here are my favorite new commands in Server 2008.

10. Oclist—Microsoft added the command-oriented Server Core as an installation option for Server 2008, and it has its own commands. Oclist queries the installed roles on your Server Core system. To list the status of all Server Core roles, you can run the command

oclist
9. Ocsetup—The Ocsetup command is used to install and remove roles and features from a Server Core system. The following example shows how to add the DHCP Server role:
start /w ocsetup DHCPServerCore
8. Bcdedit—Like Windows Vista, Server 2008 uses a new boot process that saves the system boot configuration in the Boot Configuration Data (BCD) store. The primary tool for editing Server 2008’s BCD store is the Bcdedit command, which supports many command-line options. To list the contents of the store, run
bcdedit /enum
7. Icacls—The Icacls command replaces the older Cacls and Xacls commands. Icacls lets you list, update, and back up the ACLs for files and directories. The following example shows how you can save the ACLs for the C:\temp directory:
icacls c:\temp /save tempacl
6. Mklink—The Mklink command creates a symbolic link in the file system that redirects all requests to a location you specify. Symbolic links are transparent to users, appearing as normal files or directories. The following example shows how to create a symbolic link named alsotemp for the C:\temp directory:
mklink /d alsotemp c:\temp
5. Robocopy—A staple in the Windows Resource Kit for years, Robocopy is more capable than the standard Windows Copy and Xcopy commands, and it’s able to resume after network outages as well as correctly copy file attributes, alternate streams, and security information. The following example shows how to use Robocopy to create a mirrored copy of the MyData directory and all its subfolders on the share named Backups on MyServer:
robocopy "C:\MyData" "\\MyServer\Backups" /MIR /R:2 /NP
4. Wbadmin—Wbadmin is used for Server 2008 backup and restore operations. The following example shows how to use Wbadmin to perform a full system backup to the share named Backups on MyServer: wbadmin start backup -backuptarget \\MyServer\Backups
-allCritical -vssFull

3. WinRS—The WinRS command lets you open a secure command window with a remote host. All communications between the client and the host are encrypted using Kerberos or NT LAN Manager (NTLM) keys. The following example connects to the server named MyServer and displays the command shell:

winrs -r:MyServer cmd

2. Appcmd—Appcmd.exe is a new command-line tool that can be found in the \%WinDir%\System32\InetSrv directory. Appcmd is used to query, create, and configure Microsoft IIS 7.0 server properties, Web sites, and application pools. To list all sites on the system, you can use the following command:

appcmd list sites

1. ServerManagerCmd—Without a doubt, the coolest commandline tool in Server 2008 is ServerManagerCmd.exe, which is the command-line version of the new Server Manager. This command essentially lets you script all of the Server Manager actions. To list all the installed roles and features on a Server 2008 system, you can enter

servermanagercmd.exe -query

End of Article



Reader Comments
The article is of great value especially for the network admins. I enjoyed it a lot.
Irfan Akram

Irfan Akram July 10, 2008 (Article Rating: )


You must log on before posting a comment.

If you don't have a username & password, please register now.




Top Viewed ArticlesView all articles
PsExec

This freeware utility lets you execute processes on a remote system and redirect output to the local system. ...

Microsoft Delivers Service Pack 2 Beta 2 for Vista, Server 2008

Microsoft on Tuesday announced the availability of the Beta 2 version of Service Pack 2 (SP2) for Windows Vista and Windows Server 2008. Since both operating systems were developed from the same code base, they have a common servicing structure and thus ...

Command Prompt Tricks

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


Related Articles Windows Without Windows

A First Look at Windows Server 2008 Hyper-V

Q. How do I use the command line to install Windows Server 2008 Roles and Features?

Q. How can I stop Server Manager from running when I start Windows Server 2008?

Windows OSs Whitepapers Why SaaS is the Right Solution for Log Management

Related Events SQL Server 2008 – Can You Wait? | Philadelphia

Virtualization, Automation and Databases

SQL Server 2008 – Can You Wait? | Atlanta

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 Become a VIP member of the Windows IT Pro community!
Get it all with the VIP CD and VIP access. A $500+ value for only $279!

Subscribe to Windows IT Pro!
Solve your toughest technical problems with our experts and access 10,000 + articles online. 30% off

Monthly Online Pass - Only $5.95!
Get instant access to 10,000+ articles from Windows IT Pro Magazine!

TechNet Virtual Labs
Evaluate and test Microsoft's newest products.


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 Windows Dev Pro IT Job Hound ITTV
IT Library Technology Resource Directory Connected Home Windows Excavator Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 Copyright © 2008 Penton Media, Inc., All rights reserved. Terms and Use | Privacy Statement | Reprints and Licensing