IT tutorials
 
Windows
 

Using Windows Home Server’s Command-Line Tools : Working with the Command-Line Tools (part 5)

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
5/29/2013 7:39:30 PM
SYSTEMINFO: Returning System Configuration Data

If you want to get information about various aspects of your computer, a good place to start is the SYSTEMINFO command-line tool, which displays data about the following aspects of your system:

  • The operating system name, version, and configuration type

  • The registered owner and organization

  • The original install date

  • The system uptime

  • The computer manufacturer, make, and model

  • The system processors

  • The BIOS version

  • The total and available physical memory

  • The paging file’s maximum size, available size, in-use value, and location

  • The installed hotfixes

  • The network interface card data, such as the name, connection, Dynamic Host Configuration Protocol (DHCP) status, and IP address (or addresses)

You can see all this data (and more), as well as control the output, by running SYSTEMINFO with the following syntax:

SYSTEMINFO [/S ComputerName] [/U [Domain]\UserName] [/P Password] [/FO Format] [/NH]

					  

/S ComputerNameThe name of the remote computer for which you want to view the system configuration.
/U [Domain]\UserNameThe username and, optionally, the domain, of the account under which you want to run the SYSTEMINFO command.
/P PasswordThe password of the account you specified with /U.
/FO FormatThe output format, where format is one of the following values:
 table—The output is displayed in a row-and-column format, with headers in the first row and values in subsequent rows.
 list—The output is displayed in a two-column list, with the headers in the first column and values in the second column.
 csv—The output is displayed with headers and values separated by commas. The headers appear on the first line.
/NHTells SYSTEMINFO not to include column headers when you use the /FO switch with either table or csv.

The output of SYSTEMINFO is quite long, so pipe it through the MORE command to see the output one screen at a time:

systeminfo | more

If you want to examine the output in another program or import the results into Excel or Access, redirect the output to a file and use the appropriate format. For example, Excel can read .csv files, so you can redirect the SYSTEMINFO output to a .csv file while using csv as the output format:

systeminfo /fo csv > systeminfo.csv

TYPEPERF: Monitoring Performance

You can get the same benefit without the System Monitor GUI by using the powerful TYPEPERF command-line tool. Here’s the syntax:

TYPEPERF [counter1 [counter2 ...]] [-CF file] [-O file] [-F format]
 [-SI interval] [-SC samples] [-Q [object]] [-QX [object]] [-CONFIG file] [-S computer]

counter1 [counter2 ...]Specifies the path of the performance counter to monitor. If you want to track multiple counters, separate each counter path with a space. If any path includes spaces, surround the path with quotation marks.
-CF fileLoads the counters from file, where file is a text file that lists the counter paths on separate lines.
-O fileSpecifies the path and name of the file that will store the performance data.
-F formatSpecifies the format for the output file format given by the /O switch, where format is one of the following values:
 csv—The output is displayed with each counter separated by a comma and each sample on its own line. This is the default output format.
 tsv—The output is displayed with each counter separated by a tab and each sample on its own line.
 bin—The output is displayed in binary format.
 sql—The output is displayed in SQL log format.
-SI intervalSpecifies the time interval between samples. The interval parameter uses the form [mm:]ss. The default interval is 1 second.
-SC samplesSpecifies the number of samples to collect. If you omit this switch, TYPEPERF samples continuously until you press Ctrl+C to cancel.
-Q [object]Lists the available counters for object without instances.
-QX [object]Lists the available counters for object with instances.
-CONFIG fileSpecifies the pathname of the settings file that contains the TYPEPERF parameters you want to run.
-S computerSpecifies that the performance counters should be monitored on the PC named computer if no computer name is specified in the counter path.
-YAnswers yes to any prompts generated by TYPEPERF.

The official syntax of a counter path looks like this:

[\\Computer]\Object([Parent/][Instance][#Index])\Counter

ComputerThe computer on which the counter is to be monitored. If you omit a computer name, TYPEPERF monitors the counter on the local computer.
ObjectThe performance object—such as Processor, Memory, or PhysicalDisk—that contains the counter.
ParentThe container instance of the specified Instance.
InstanceThe instance of the Object, if it has multiple instances. For example, in a two- (or dual-core) processor system, the instances are 0 (for the first processor), 1 (for the second processor), or _Total (for both processors combined). You can also using an asterisk (*) to represent all the instances in Object.
IndexThe index number of the specified Instance.
CounterThe name of the performance counter. You can also use an asterisk (*) to represent all the counters in Object (Instance).

In practice, however, you rarely use the Computer, Parent, and Index parts of the path, so most counter paths use one of the following two formats:

\Object\Counter
\Object(Instance)\Counter

For example, here’s the path for the Memory object’s Available MBytes counter:

\Memory\Available MBytes

Here’s a TYPEPERF command that displays five samples of this counter:

typeperf "\Memory\Available Mbytes" -sc 5

Similarly, here’s the path for the Processor object’s % Processor Time counter, using the first processor instance:

\Processor(0)\% Processor Time

Here’s a TYPEPERF command that displays 10 samples of this counter every 3 seconds and saves the results to a file named ProcessorTime.txt:

typeperf "\Processor(0)\% Processor Time" -sc 10 -si 3 -o ProcessorTime.txt

To use the -CONFIG parameter with TYPEPERF, you need to create a text file that stores the command-line parameters you want to use. This configuration file consists of a series of parameter/value pairs that use the following general format:

[Parameter]
Value

Here, Parameter is text that specifies a TYPEPERF parameter—such as F for the -F parameter and S for the -S parameter. Use C to specify one or more counter paths—and Value as the value you want to assign to the parameter.

For example, consider the following command:

typeperf "\PhysicalDisk(_Total)\% Idle Time" -si 5 -sc 10 -o idletime.txt

To run the same command using the -CONFIG parameter, you first need to create a file with the following text:

[c]
\PhysicalDisk(_Total)\% Idle Time
[si]
5
[sc]
10
[o]
idletime.txt

If this file is named IdleTimeCounter.txt, you can run it at any time with the following command (assuming IdleTimeCounter.txt resides in the current folder):

typeperf -config IdleTimeCounter.txt

WHOAMI: Getting Information About the Current User

The WHOAMI command gives you information about the user who is currently logged on to the computer:

WHOAMI [/UPN | /FQDN | LOGONID] [/USER | /GROUPS | /PRIV] [/ALL] [/FO format]

					  

/UPN(Domains only) Returns the current user’s name using the user principal name (UPN) format.
/FQDN(Domains only) Returns the current user’s name using the fully qualified domain name (FQDN) format.
/LOGONIDReturns the current user’s security identifier (SID).
/USERReturns the current username using the computer\user format.
/GROUPSReturns the groups of which the current user is a member.
/PRIVReturns the current user’s privileges.
/ALLReturns the current user’s SID, username, groups, and privileges.
/FO formatThe output format, where format is one of the following values:
 table—The output is displayed in a row-and-column format, with headers in the first row and values in subsequent rows.
 list—The output is displayed in a two-column list, with the headers in the first column and values in the second column.
 csv—The output is displayed with headers and values separated by commas. The headers appear on the first line.

You probably won’t use this command often on the Windows Home Server computer because you’ll almost always be logged on as Administrator. However, WHOAMI is useful when you’re working on a client computer and you’re not sure who is currently logged on.

For example, the following command redirects the current user’s SID, username, groups, and privileges to a file named whoami.txt using the list format:

whoami /all /fo list > whoami.txt
 
Others
 
- Using Windows Home Server’s Command-Line Tools : Working with the Command-Line Tools (part 4) - Shutting Down or Restarting a Computer
- Using Windows Home Server’s Command-Line Tools : Working with the Command-Line Tools (part 3)
- Using Windows Home Server’s Command-Line Tools : Working with the Command-Line Tools (part 2) - Working with File and Folder Management Tools
- Using Windows Home Server’s Command-Line Tools : Working with the Command-Line Tools (part 1) - Working with Disk Management Tools
- Windows 8 : Security - Action Center
- Windows 8 : Security - Windows Defender
- Windows Vista : Exploring Expert File and Folder Techniques - Customizing Windows Explorer
- Windows Vista : Exploring Expert File and Folder Techniques - Shadow Copies and Transactional NTFS
- Windows Vista : Exploring Expert File and Folder Techniques - Grouping, Stacking, and Filtering with Metadata
- Windows 7 : Troubleshooting Your Internet Connection (part 5)
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
Technology FAQ
- Is possible to just to use a wireless router to extend wireless access to wireless access points?
- Ruby - Insert Struct to MySql
- how to find my Symantec pcAnywhere serial number
- About direct X / Open GL issue
- How to determine eclipse version?
- What SAN cert Exchange 2010 for UM, OA?
- How do I populate a SQL Express table from Excel file?
- code for express check out with Paypal.
- Problem with Templated User Control
- ShellExecute SW_HIDE
programming4us programming4us