Share via


Netsh RAS Diagnostic Context Commands

Applies To: Windows Server 2008, Windows Server 2008 R2

The following commands are specific to the ras diagnostics context within the Netsh environment.

To view the command syntax, click a command:

  • dump

Set commands

  • set cmtracing

  • set loglevel

  • set modemtracing

  • set rastracing

  • set securityeventlog

  • set tracefacilities

Show commands

  • show all

  • show cmtracing

  • show configuration

  • show installation

  • show loglevel

  • show logs

  • show modemtracing

  • show rastracing

  • show securityeventlog

  • show tracefacilities

Netsh commands for RAS diagnostics

The following entries provide details for each command.

dump

Displays the configuration of Remote Access Diagnostics in script form.

Syntax

dump

Remarks

  • You can dump the contents of the current configuration to a file that can be used to restore altered configuration settings.

Example

The following commands save the current configuration as a script in the c:\test\rasdiagcfg.dmp file.

  • From the command prompt:

    netsh ras diagnostics dump > c:\test\rasdiagcfg.dmp

  • From the netsh ras diagnostics context prompt:

    set file open c:\test\rasdiagcfg.dmp

    dump

    set file close

You can use the netsh exec command to run the script created by the netsh dump command.

show installation

Creates a Remote Access Diagnostic Report that includes only diagnostics results for Information Files, Installation Check, Installed Networking Components, and Registry Check and delivers the report to a location you specify.

Syntax

show installation

type = ] { file | email }

destination = ] { FileLocation | EmailAddress }

[ [ compression = ] { enabled | disabled } ]

[ [ hours = ] NumberOfHours ]

[ [ verbose = ] { enabled | disabled } ]

Parameters

  • type = ] { file | email }
    Specifies whether the report should be saved to a file or sent to an e-mail address.
  • destination = ] { FileLocation | EmailAddress }
    Required. Specifies the full path and file name to which the report should be saved or the full e-mail address to which the report should be sent. If there are any spaces, you must place the parameter inside quotation marks.
  • compression = ] { enabled | disabled }
    Specifies whether to compress the report into a .cab file. If you do not specify this parameter, the report is compressed if you send it to an e-mail address but not if you save it to a file.
  • hours = ] NumberOfHours
    Specifies the number of past hours for which to show activity in the report. This parameter must be an integer between 1 and 24. If you do not specify this parameter, all past information is included.
  • verbose = ] { enabled | disabled }
    Specifies the amount of data to include in the report. If you do not specify this parameter, only minimal data is included.

Remarks

  • When saved as a file, the Remote Access Diagnostic Report is saved as an HTML file (.htm).

Example

To save a diagnostic report to c:\test\rasdiag.htm, type:

show installation type=file destination="c:\test\rasdiag.htm"

show loglevel

Shows the global logging level for Routing and Remote Access service.

Syntax

show loglevel

set loglevel

Sets the global logging level for Routing and Remote Access service.

Syntax

set loglevel

state = ] { error | warn | all | none }

Parameters

  • state = ] { error | warn | all | none }
    Required. Specifies the level of global logging. The none parameter specifies that no events are logged. The error parameter specifies that only errors are logged. The warn parameter specifies that errors and warnings are logged. The all parameter specifies that all events are logged.

show logs

Creates a Remote Access Diagnostic Report that contains only diagnostics results for Tracing Logs, Modem Logs, Connection Manager Logs, IP Security Log, Remote Access Event Logs, and Security Event Logs and delivers the report to a location you specify.

Syntax

show logs

type = ] { file | email }

destination = ] { FileLocation | EmailAddress }

[ [ compression = ] { enabled | disabled } ]

[ [ hours = ] NumberOfHours ]

[ [ verbose = ] { enabled | disabled } ]

Parameters

  • type = ] { file | email }
    Specifies whether the report should be saved to a file or sent to an e-mail address.
  • destination = ] { FileLocation | EmailAddress }
    Required. Specifies the full path and file name to which the report should be saved or the full e-mail address to which the report should be sent. If there are any spaces, you must place the parameter inside quotation marks.
  • compression = ] { enabled | disabled }
    Specifies whether to compress the report into a .cab file. If you do not specify this parameter, the report is compressed if you send it to an e-mail address but not if you save it to a file.
  • hours = ] NumberOfHours
    Specifies the number of past hours for which to show activity in the report. This parameter must be an integer between 1 and 24. If you do not specify this parameter, all past information is included.
  • verbose = ] { enabled | disabled }
    Specifies the amount of data to include in the report. If you do not specify this parameter, only minimal data is included.

Remarks

  • When saved as a file, the Remote Access Diagnostic Report is saved as an HTML file (.htm).

Example

To save a diagnostic report to c:\test\rasdiag.htm, type:

show logs type=file destination="c:\test\rasdiag.htm"

show configuration

Creates a Remote Access Diagnostic Report that includes only diagnostics results for Installed Devices, Process Information, Command-line Utilities, and Phone Book Files and delivers the report to a location you specify.

Syntax

show configuration

type = ] { file | email }

destination = ] { FileLocation | EmailAddress }

[ [ compression = ] { enabled | disabled } ]

[ [ hours = ] NumberOfHours ]

[ [ verbose = ] { enabled | disabled } ]

Parameters

  • type = ] { file | email }
    Specifies whether the report should be saved to a file or sent to an e-mail address.
  • destination = ] { FileLocation | EmailAddress }
    Required. Specifies the full path and file name to which the report should be saved or the full e-mail address to which the report should be sent. If there are any spaces, you must place the parameter inside quotation marks.
  • compression = ] { enabled | disabled }
    Specifies whether to compress the report into a .cab file. If you do not specify this parameter, the report is compressed if you send it to an e-mail address but not if you save it to a file.
  • hours = ] NumberOfHours
    Specifies the number of past hours for which to show activity in the report. This parameter must be an integer between 1 and 24. If you do not specify this parameter, all past information is included.
  • verbose = ] { enabled | disabled }
    Specifies the amount of data to include in the report. If you do not specify this parameter, only minimal data is included.

Remarks

  • When saved as a file, the Remote Access Diagnostic Report is saved as an HTML file (.htm).

Example

To save a diagnostic report to c:\test\rasdiag.htm, type:

show configuration type=file destination="c:\test\rasdiag.htm"

show all

Creates a Remote Access Diagnostic Report for all remote access logs and delivers the report to a location you specify.

Syntax

show all

type = ] { file | email }

destination = ] { FileLocation | EmailAddress }

[ [ compression = ] { enabled | disabled } ]

[ [ hours = ] NumberOfHours ]

[ [ verbose = ] { enabled | disabled } ]

Parameters

  • type = ] { file | email }
    Specifies whether the report should be saved to a file or sent to an e-mail address.
  • destination = ] { FileLocation | EmailAddress }
    Required. Specifies the full path and file name to which the report should be saved or the full e-mail address to which the report should be sent. If there are any spaces, you must place the parameter inside quotation marks.
  • compression = ] { enabled | disabled }
    Specifies whether to compress the report into a .cab file. If you do not specify this parameter, the report is compressed if you send it to an e-mail address but not if you save it to a file.
  • hours = ] NumberOfHours
    Specifies the number of past hours for which to show activity in the report. This parameter must be an integer between 1 and 24. If you do not specify this parameter, all past information is included.
  • verbose = ] { enabled | disabled }
    Specifies the amount of data to include in the report. If you do not specify this parameter, only minimal data is included.

Remarks

  • When saved as a file, the Remote Access Diagnostic Report is saved as an HTML file (.htm).

  • The Remote Access Diagnostic Report that you create by using the show all command contains all diagnostic information available. You can use other commands, such as show configuration, to create reports that contain a narrower scope of information.

Example

To save a diagnostic report to c:\test\rasdiag.htm that includes all diagnostic information, type:

show all type=file destination="c:\test\rasdiag.htm"

show cmtracing

Shows whether information about Connection Manager connections is being logged.

Syntax

show cmtracing

set cmtracing

Enables or disables logging of information about all Connection Manager connections.

Syntax

set cmtracingenabled | disabled }

Parameters

  • enabled | disabled }
    Required. Specifies whether you want information about Connection Manager connections to be logged. The enabled parameter specifies that you want information to be logged. The disabled parameter specifies that you do not want information to be logged.

Remarks

  • Each log file for a Connection Manager connection contains information that is specific to the history of that connection. Each Connection Manager connection generates a unique log file. Depending on the configuration of the connection, the log file might be saved in any of various locations.

  • This command will be overridden for a particular connection if the user enables or disables logging for that connection or if the user installs and uses a Connection Manager profile for which an administrator has enabled or disabled logging.

show modemtracing

Shows whether modem tracing is enabled or disabled.

Syntax

show modemtracing

set modemtracing

Enables or disables modem tracing for all modems installed for the local computer.

Syntax

set modemtracingenabled | disabled }

Parameters

  • enabled | disabled }
    Required. Specifies whether you want modem activity for each modem to be logged. The enabled parameter specifies that you want activity to be logged. The disabled parameter specifies that you do not want activity to be logged.

Remarks

  • This command enables or disables the logging of modem activity for all modems. If you want to enable or disable modem logging for a specific modem, you should configure the modem in Device Manager.

show rastracing

Shows whether tracing for the given component is enabled. If no component is specified, shows the state of all components.

Syntax

show rastracingcomponent = ] Component

Parameters

  • component = ] Component
    Specifies the component for which you want to determine whether tracing is enabled or disabled. If no component is specified, the state of all components is displayed.

set rastracing

Enables or disables tracing and logging of all activity for all remote access components or for a specific remote access component.

Syntax

set rastracing

component = ] { Component | *} { enabled | disabled }

state = ] { enabled | disabled }

Parameters

  • component = ] { Component | *}
    Required. Specifies whether you want to enable or disable tracing and logging for a component that you specify or for all components. The Component parameter specifies the component for which you want to enable or disable tracing and logging. Use '*' to denote all components.
  • state = ] { enabled | disabled }
    Required. Specifies whether you want activity to be traced and logged. The enabled parameter specifies that you want activity to be traced and logged. The disabled parameter specifies that you do not want activity to be traced and logged.

Remarks

  • If you enable tracing and logging, a log file named Component.log is created in the %windir%\tracing directory for each component being traced.

show securityeventlog

Shows whether security events are being logged.

Syntax

show securityeventlog

set securityeventlog

Enables or disables logging of all security events.

Syntax

set securityeventlog

state = ] { enabled | disabled }

Parameters

  • state = ] { enabled | disabled }
    Required. Specifies whether you want security events to be logged. The enabled parameter specifies that you want security events to be logged. The disabled parameter specifies that you do not want security events to be logged.

Remarks

  • You can also view security event logs in the Event Viewer.

show tracefacilities

Shows whether all activity for all remote access components or for a remote access component that you specify is being traced and logged.

Syntax

show tracefacilities

set tracefacilities

Enables or disables tracing and logging of all activity for all remote access components that are configured on the local computer.

Syntax

set tracefacilities

state= ] { enabled | disabled | clear }

Parameters

  • state = ] { enabled | disabled | clear }
    Required. Specifies whether you want to enable tracing for all remote access components, to disable tracing, or to clear all logs generated by tracefacilities. The enabled parameter specifies that you want to enable tracing. The disabled parameter specifies that you want to disable tracing. The clear parameter specifies that you want to clear all logs.