Monday, April 4, 2016

Command-line Tools for windows server 2008 and windows server 2012


Here is a short list of command line tools that are built in to Microsoft Windows Server 2008 and can be used for troubleshooting of the server issues:
  • Auditpol : Displays information and manipulates audit policies. Chkdsk: Checks the file system of a volume for errors (physical and logical).
  • Dcdiag : Analyzes a domain controller’s state at the forest or enterprise level and reports any problems.
  • Logman : Creates and manages event trace session and performance logs.Provides many of the functions of the Performance Monitor, but from the command line.
  • Nltest : Troubleshoots configurations on the OS.
  • Nslookup : Displays information you can use to diagnose DNS infrastructure.
  • Recover : Recovers readable information from a defective disk.
  • Repadmin : Diagnoses Active Directory replication problems between domain controllers.
  • Sc : Allows you to test and debug service programs.
  • Wevtutil : Retrieves information about event logs and publishers, installs event manifests, and runs queries. You can also use it to export, archive, and clear logs.
  • RSoP (Resultant Set of Policy) is a report of all Group Policy settings within Active Directory that shows how those settings can affect a network, or how existing Group Policy Objects (GPOs) affect various combinations of users and computers when the local security policy is applied.
  • Netdiag : The Netdiag command-line diagnostic tool helps to isolate networking and connectivity problems by performing a series of tests to determine the state of your network client.
  •  PoolMon (poolmon.exe), the Memory Pool Monitor, displays data that the operating system collects about memory allocations from the system paged and nonpaged kernel pools, and the memory pools used for Terminal Services sessions. The data is grouped by pool allocation tag.
  • conntrol desk.cpl - View or set display settings.
  • Control intl.cpl - View or set regional and language options, including formats and the keyboard layout.
  • Control sysdm.cpl - View or set system properties.
  • control timedate.cpl - View or set the date, time, and time zone.
  • Cscript slmgr.vbs –ato - Activate the operating system.
  • DiskRaid.exe - Configure software RAID.
  • ipconfig /all - List information about the computer’s IP address configuration.
  • NetDom RenameComputer - Set the server’s name and domain membership.
  • OCList.exe - List roles, role services, and features.
  • OCSetup.exe - Add or remove roles, role services, and features.
  • PNPUtil.exe - Install or update hardware device drivers.
  • Sc query type=driver - List installed device drivers.
  • Scregedit.wsf - Configure the operating system. Use the /cli parameter to list available configuration areas.
  • ServerWerOptin.exe - Configure Windows Error Reporting.
  • SystemInfo - List the system configuration details.

  • Bcdboot : Enables you to quickly set up a system partition, or to repair the boot environment located on the system partition. The system partition is set up by copying a simple set of Boot Configuration Data (BCD) files to an existing empty partition.
  • Bootcfg : Configures, queries, or changes Boot.ini file settings.
  • Bcdedit : Boot Configuration Data (BCD) files provide a store that is used to describe boot applications and boot application settings. The objects and elements in the store effectively replace Boot.ini.
  • BCDEdit : BCDEdit is a command-line tool for managing BCD stores. It can be used for a variety of purposes, including creating new stores, modifying existing stores, adding boot menu parameters, and so on. BCDEdit serves essentially the same purpose as Bootcfg.exe on earlier versions of Windows.                                             
  • Cacls : Displays or modifies discretionary access control lists (DACL) on specified files.
  • Certutil : Certutil.exe is a command-line program that is installed as part of Certificate Services. You can use Certutil.exe to dump and display certification authority (CA) configuration information, configure Certificate Services, backup and restore CA components, and verify certificates, key pairs, and certificate chains.
  • Chglogon : Enables or disables logons from client sessions on an RD Session Host server, or displays current logon status.
  • Chgport : Lists or changes the COM port mappings to be compatible with MS-DOS applications.
  • Chkdsk : Checks the file system and file system metadata of a volume for logical and physical errors. If used without parameters, chkdsk displays only the status of the volume and does not fix any errors. If used with the /f, /r, /x, or /b parameters, it fixes errors on the volume.
  • Chkntfs : Displays or modifies automatic disk checking when the computer is started. If used without options, chkntfs displays the file system of the specified volume. If automatic file checking is scheduled to run, chkntfs displays whether the specified volume is dirty or is scheduled to be checked the next time the computer is started.
  • Cluadmin : Enables you to connect to a failover cluster (formerly known as server cluster). Used without parameters, cluadmin starts Cluster Administrator, the tool used to configure and manage failover clusters.
  • Dcgpofix : Recreates the default Group Policy Objects (GPOs) for a domain.
  • Dcpromo : Installs and removes Active Directory Domain Services (AD DS).
  • Defrag : Locates and consolidates fragmented files on local volumes to improve system performance.
  • Djoin : Provisions a computer account in a domain and requests an offline domain join when a computer restarts
  • Dsquery : Dsquery is a command-line tool that is built into Windows Server 2008. It is available if you have the Active Directory Domain Services (AD DS) server role installed. To use dsquery, you must run the dsquery command from an elevated command prompt
  • Gpupdate : Updates Group Policy settings
  • Gpresult : Displays the resultant set of policy information that can be used to identify issues with Group Policy.
  • Gpfixup : Fix domain name dependencies in Group Policy Objects and Group Policy links after a domain rename operation
  • Klist : Displays a list of currently cached Kerberos tickets.
  • Logoff : Logs off a user from a session on a Remote Desktop Session Host (RD Session Host) server and deletes the session from the server.
  • Msiexec : Provides the means to install, modify, and perform operations on Windows Installer from the command line.
  • Msinfo32 : Opens the System Information tool to display a comprehensive view of the hardware, system components, and software environment on the local computer. For examples of how this command can be used.
  • Mstsc : Creates connections to Remote Desktop Session Host (RD Session Host) servers or other remote computers, edits an existing Remote Desktop Connection (.rdp) configuration file, and migrates legacy connection files that were created with Client Connection Manager to new .rdp connection files.
  • Nbtstat : Displays NetBIOS over TCP/IP (NetBT) protocol statistics, NetBIOS name tables for both the local computer and remote computers, and the NetBIOS name cache. Nbtstat allows a refresh of the NetBIOS name cache and the names registered with Windows Internet Name Service (WINS). Used without parameters, nbtstat displays.
  • Netdiag : The Netdiag command-line diagnostic tool helps to isolate networking and connectivity problems by performing a series of tests to determine the state of your network client. These tests and the key network status information that they expose give network administrators and support personnel a more direct means of identifying and isolating network problems. Moreover, because this tool does not require parameters or switches to be specified, support personnel and network administrators can focus on analyzing the output rather than on training users how to use the tool.
  • Netdom : Netdom is a command-line tool that is built into Windows Server 2008 and Windows Server 2008 R2. It is available if you have the Active Directory Domain Services (AD DS) server role installed. It is also available if you install the Active Directory Domain Services Tools that are part of the Remote Server Administration Tools (RSAT).
  • Netsh : Netsh is a command-line scripting utility that allows you to, either locally or remotely, display or modify the network configuration of a currently running computer.
  • Netstat : Displays active TCP connections, ports on which the computer is listening, Ethernet statistics, the IP routing table, IPv4 statistics (for the IP, ICMP, TCP, and UDP protocols), and IPv6 statistics (for the IPv6, ICMPv6, TCP over IPv6, and UDP over IPv6 protocols). Used without parameters, netstat displays active TCP connections.
  • Net use : Connects a computer to or disconnects a computer from a shared resource, or displays information about computer connections. The command also controls persistent net connections. Used without parameters, net use retrieves a list of network connections.
  • Nslookup : Displays information that you can use to diagnose Domain Name System (DNS) infrastructure. Before using this tool, you should be familiar with how DNS works. The Nslookup command-line tool is available only if you have installed the TCP/IP protocol.
  • Ntbackup : The ntbackup command is not available in Windows Vista or Windows Server 2008. Instead, you should use the wbadmin command and subcommands to back up and restore your computer and files from a command prompt.
  • You cannot recover backups that you created with ntbackup by using wbadmin. However, a version of ntbackup is available as a download for Windows Server 2008 and Windows Vista users who want to recover backups that they created using ntbackup. This downloadable version of ntbackup enables you to perform recoveries only of legacy backups, and it cannot be used on computers running Windows Server 2008 or Windows Vista to create new backups.
  • Ntdsutil : Ntdsutil.exe is a command-line tool that provides management facilities for Active Directory Domain Services (AD DS) and Active Directory Lightweight Directory Services (AD LDS). You can use the ntdsutil commands to perform database maintenance of AD DS, manage and control single master operations, and remove metadata left behind by domain controllers that were removed from the network without being properly uninstalled. This tool is intended for use by experienced administrators.
  • Perfmon : Start Windows Reliability and Performance Monitor in a specific standalone mode.
  • Regsvr32 : Registers .dll files as command components in the registry.
  • Reg : Performs operations on registry subkey information and values in registry entries. The reg commands include:
  • Reg add
  • Reg compare
  • Reg copy
  • Reg delete
  • Reg export
  • Reg import
  • Reg load
  • Reg query
  • Reg restore
  • Reg save
  • Reg unload
  • Repadmin : Repadmin.exe is built into Windows Server 2008 and Windows Server 2008 R2. It is available if you have the AD DS or the AD LDS server role installed. It is also available if you install the Active Directory Domain Services Tools that are part of the Remote Server Administration Tools (RSAT).
  • Robocopy : Copies file data.
  • Systeminfo : Displays detailed configuration information about a computer and its operating system, including operating system configuration, security information, product ID, and hardware properties (such as RAM, disk space, and network cards).
  • Servermanagercmd : This command is available only on servers that are running Windows Server 2008 or Windows Server 2008 R2. Servermanagercmd.exe has been deprecated, and is not available in Windows Server 2012.
Installs and removes roles, role services, and features. Also displays the list of all roles, role services, and features available, and shows which are installed on this computer. For additional information about the roles, role services, and features that you can specify by using this tool.
  • Taskkill: Ends one or more tasks or processes. Processes can be ended by process ID or image name. Taskkill replaces the kill tool.
  • Tasklist: Displays a list of currently running processes on the local computer or on a remote computer. Tasklist replaces the tlist tool.
  • Telnet: Communicates with a computer running the Telnet Server service and also use to check the port status.
  • Sysadmin: Displays current volume shadow copy backups and all installed shadow copy writers and providers.
  • W32tm: You can use the W32tm.exe tool to configure Windows Time service (W32time) settings. You can also use W32tm.exe to diagnose problems with the time service. W32tm.exe is the preferred command-line tool for configuring, monitoring, or troubleshooting the Windows.
  • Wbadmin: Enables you to back up and restore your operating system, volumes, files, folders, and applications from a command prompt.
To configure a regularly scheduled backup, you must be a member of the Administrators group. To perform all other tasks with this command, you must be a member of the Backup Operators or the Administrators group, or you must have been delegated the appropriate permissions.
You must run wbadmin from an elevated command prompt. (To open an elevated command prompt, right-click Command Prompt, and then click Run as administrator.)

  • Auditpol : Displays information and manipulates audit policies. Chkdsk: Checks the file system of a volume for errors (physical and logical).
  • Dcdiag : Analyzes a domain controller’s state at the forest or enterprise level and reports any problems.
  • Logman : Creates and manages event trace session and performance logs.Provides many of the functions of the Performance Monitor, but from the command line.
  • Nltest : Troubleshoots configurations on the OS.
  • Nslookup : Displays information you can use to diagnose DNS infrastructure.
  • Recover : Recovers readable information from a defective disk.
  • Repadmin : Diagnoses Active Directory replication problems between domain controllers.
  • Sc : Allows you to test and debug service programs.
  • Wevtutil : Retrieves information about event logs and publishers, installs event manifests, and runs queries. You can also use it to export, archive, and clear logs.
  • RSoP (Resultant Set of Policy) is a report of all Group Policy settings within Active Directory that shows how those settings can affect a network, or how existing Group Policy Objects (GPOs) affect various combinations of users and computers when the local security policy is applied.
  • Netdiag : The Netdiag command-line diagnostic tool helps to isolate networking and connectivity problems by performing a series of tests to determine the state of your network client.
  •  PoolMon (poolmon.exe), the Memory Pool Monitor, displays data that the operating system collects about memory allocations from the system paged and nonpaged kernel pools, and the memory pools used for Terminal Services sessions. The data is grouped by pool allocation tag.
  • conntrol desk.cpl - View or set display settings.
  • Control intl.cpl - View or set regional and language options, including formats and the keyboard layout.
  • Control sysdm.cpl - View or set system properties.
  • control timedate.cpl - View or set the date, time, and time zone.
  • Cscript slmgr.vbs –ato - Activate the operating system.
  • DiskRaid.exe - Configure software RAID.
  • ipconfig /all - List information about the computer’s IP address configuration.
  • NetDom RenameComputer - Set the server’s name and domain membership.
  • OCList.exe - List roles, role services, and features.
  • OCSetup.exe - Add or remove roles, role services, and features.
  • PNPUtil.exe - Install or update hardware device drivers.
  • Sc query type=driver - List installed device drivers.
  • Scregedit.wsf - Configure the operating system. Use the /cli parameter to list available configuration areas.
  • ServerWerOptin.exe - Configure Windows Error Reporting.
  • SystemInfo - List the system configuration details.
  • Bcdboot : Enables you to quickly set up a system partition, or to repair the boot environment located on the system partition. The system partition is set up by copying a simple set of Boot Configuration Data (BCD) files to an existing empty partition.
  • Bootcfg : Configures, queries, or changes Boot.ini file settings.
  • Bcdedit : Boot Configuration Data (BCD) files provide a store that is used to describe boot applications and boot application settings. The objects and elements in the store effectively replace Boot.ini.
  • BCDEdit : BCDEdit is a command-line tool for managing BCD stores. It can be used for a variety of purposes, including creating new stores, modifying existing stores, adding boot menu parameters, and so on. BCDEdit serves essentially the same purpose as Bootcfg.exe on earlier versions of Windows.                                             
  • Cacls : Displays or modifies discretionary access control lists (DACL) on specified files.
  • Certutil : Certutil.exe is a command-line program that is installed as part of Certificate Services. You can use Certutil.exe to dump and display certification authority (CA) configuration information, configure Certificate Services, backup and restore CA components, and verify certificates, key pairs, and certificate chains.
  • Chglogon : Enables or disables logons from client sessions on an RD Session Host server, or displays current logon status.
  • Chgport : Lists or changes the COM port mappings to be compatible with MS-DOS applications.
  • Chkdsk : Checks the file system and file system metadata of a volume for logical and physical errors. If used without parameters, chkdsk displays only the status of the volume and does not fix any errors. If used with the /f, /r, /x, or /b parameters, it fixes errors on the volume.
  • Chkntfs : Displays or modifies automatic disk checking when the computer is started. If used without options, chkntfs displays the file system of the specified volume. If automatic file checking is scheduled to run, chkntfs displays whether the specified volume is dirty or is scheduled to be checked the next time the computer is started.
  • Cluadmin : Enables you to connect to a failover cluster (formerly known as server cluster). Used without parameters, cluadmin starts Cluster Administrator, the tool used to configure and manage failover clusters.
  • Dcgpofix : Recreates the default Group Policy Objects (GPOs) for a domain.
  • Dcpromo : Installs and removes Active Directory Domain Services (AD DS).
  • Defrag : Locates and consolidates fragmented files on local volumes to improve system performance.
  • Djoin : Provisions a computer account in a domain and requests an offline domain join when a computer restarts
  • Dsquery : Dsquery is a command-line tool that is built into Windows Server 2008. It is available if you have the Active Directory Domain Services (AD DS) server role installed. To use dsquery, you must run the dsquery command from an elevated command prompt
  • Gpupdate : Updates Group Policy settings
  • Gpresult : Displays the resultant set of policy information that can be used to identify issues with Group Policy.
  • Gpfixup : Fix domain name dependencies in Group Policy Objects and Group Policy links after a domain rename operation
  • Klist : Displays a list of currently cached Kerberos tickets.
  • Logoff : Logs off a user from a session on a Remote Desktop Session Host (RD Session Host) server and deletes the session from the server.
  • Msiexec : Provides the means to install, modify, and perform operations on Windows Installer from the command line.
  • Msinfo32 : Opens the System Information tool to display a comprehensive view of the hardware, system components, and software environment on the local computer. For examples of how this command can be used.
  • Mstsc : Creates connections to Remote Desktop Session Host (RD Session Host) servers or other remote computers, edits an existing Remote Desktop Connection (.rdp) configuration file, and migrates legacy connection files that were created with Client Connection Manager to new .rdp connection files.
  • Nbtstat : Displays NetBIOS over TCP/IP (NetBT) protocol statistics, NetBIOS name tables for both the local computer and remote computers, and the NetBIOS name cache. Nbtstat allows a refresh of the NetBIOS name cache and the names registered with Windows Internet Name Service (WINS). Used without parameters, nbtstat displays.
  • Netdiag : The Netdiag command-line diagnostic tool helps to isolate networking and connectivity problems by performing a series of tests to determine the state of your network client. These tests and the key network status information that they expose give network administrators and support personnel a more direct means of identifying and isolating network problems. Moreover, because this tool does not require parameters or switches to be specified, support personnel and network administrators can focus on analyzing the output rather than on training users how to use the tool.
  • Netdom : Netdom is a command-line tool that is built into Windows Server 2008 and Windows Server 2008 R2. It is available if you have the Active Directory Domain Services (AD DS) server role installed. It is also available if you install the Active Directory Domain Services Tools that are part of the Remote Server Administration Tools (RSAT).
  • Netsh : Netsh is a command-line scripting utility that allows you to, either locally or remotely, display or modify the network configuration of a currently running computer.
  • Netstat : Displays active TCP connections, ports on which the computer is listening, Ethernet statistics, the IP routing table, IPv4 statistics (for the IP, ICMP, TCP, and UDP protocols), and IPv6 statistics (for the IPv6, ICMPv6, TCP over IPv6, and UDP over IPv6 protocols). Used without parameters, netstat displays active TCP connections.
  • Net use : Connects a computer to or disconnects a computer from a shared resource, or displays information about computer connections. The command also controls persistent net connections. Used without parameters, net use retrieves a list of network connections.
  • Nslookup : Displays information that you can use to diagnose Domain Name System (DNS) infrastructure. Before using this tool, you should be familiar with how DNS works. The Nslookup command-line tool is available only if you have installed the TCP/IP protocol.
  • Ntbackup : The ntbackup command is not available in Windows Vista or Windows Server 2008. Instead, you should use the wbadmin command and subcommands to back up and restore your computer and files from a command prompt.
  • You cannot recover backups that you created with ntbackup by using wbadmin. However, a version of ntbackup is available as a download for Windows Server 2008 and Windows Vista users who want to recover backups that they created using ntbackup. This downloadable version of ntbackup enables you to perform recoveries only of legacy backups, and it cannot be used on computers running Windows Server 2008 or Windows Vista to create new backups.
  • Ntdsutil : Ntdsutil.exe is a command-line tool that provides management facilities for Active Directory Domain Services (AD DS) and Active Directory Lightweight Directory Services (AD LDS). You can use the ntdsutil commands to perform database maintenance of AD DS, manage and control single master operations, and remove metadata left behind by domain controllers that were removed from the network without being properly uninstalled. This tool is intended for use by experienced administrators.
  • Perfmon : Start Windows Reliability and Performance Monitor in a specific standalone mode.
  • Regsvr32 : Registers .dll files as command components in the registry.
  • Reg : Performs operations on registry subkey information and values in registry entries. The reg commands include:
  1. Reg add
  2. Reg compare
  3. Reg copy
  4. Reg delete
  5. Reg export
  6. Reg import
  7. Reg load
  8. Reg query
  9. Reg restore
  10. Reg save
  11. Reg unload
  • Repadmin : Repadmin.exe is built into Windows Server 2008 and Windows Server 2008 R2. It is available if you have the AD DS or the AD LDS server role installed. It is also available if you install the Active Directory Domain Services Tools that are part of the Remote Server Administration Tools (RSAT).
  • Robocopy : Copies file data.
  • Systeminfo : Displays detailed configuration information about a computer and its operating system, including operating system configuration, security information, product ID, and hardware properties (such as RAM, disk space, and network cards).
  • Servermanagercmd : This command is available only on servers that are running Windows Server 2008 or Windows Server 2008 R2. Servermanagercmd.exe has been deprecated, and is not available in Windows Server 2012.Installs and removes roles, role services, and features. Also displays the list of all roles, role services, and features available, and shows which are installed on this computer. For additional information about the roles, role services, and features that you can specify by using this tool.
  • Taskkill: Ends one or more tasks or processes. Processes can be ended by process ID or image name. Taskkill replaces the kill tool.
  • Tasklist: Displays a list of currently running processes on the local computer or on a remote computer. Tasklist replaces the tlist tool.
  • Telnet: Communicates with a computer running the Telnet Server service and also use to check the port status.
  • Sysadmin: Displays current volume shadow copy backups and all installed shadow copy writers and providers.
  • W32tm: You can use the W32tm.exe tool to configure Windows Time service (W32time) settings. You can also use W32tm.exe to diagnose problems with the time service. W32tm.exe is the preferred command-line tool for configuring, monitoring, or troubleshooting the Windows.
  • Wbadmin: Enables you to back up and restore your operating system, volumes, files, folders, and applications from a command prompt. To configure a regularly scheduled backup, you must be a member of the Administrators group. To perform all other tasks with this command, you must be a member of the Backup Operators or the Administrators group, or you must have been delegated the appropriate permissions.You must run wbadmin from an elevated command prompt. (To open an elevated command prompt, right-click Command Prompt, and then click Run as administrator.)
  • Wdsutil : WDSUTIL is a command-line utility used for managing your Windows Deployment Services server.
  • Wmic : Displays WMI information inside an interactive command shell.
  • WEVUtil.exe - View and search event logs.
  • Wmic datafile where name=“FullFilePath” get version - List a file’s version.
  • Wmic nicconfig index=9 call enabledhcp - Set the computer to use dynamic IP addressing rather than static IP addressing.
  • Wmic nicconfig index=9 call enablestatic(“IPAddress”), (“SubnetMask”) - Set a computer’s static IP address and network mask.
  • Wmic nicconfig index=9 call setgateways(“GatewayIPAddress”) - Set or change the default gateway.
  • Wmic product get name /value “ - List installed MSI applications by name.
  • Wmic product where name=“Name” call uninstall - Uninstall an MSI application.
  • Wmic qfe list - List installed updates and hotfixes.
  • Wusa.exe PatchName.msu /quiet - Apply an update or hotfix to the operating system.

1 comment:

  1. Most of commands have been covered.
    Please leave your feedback.

    ReplyDelete