Export (0) Print
Expand All

Netsh Commands for Peer-to-Peer Networking (P2P)

Updated: February 8, 2008

Applies To: Windows Server 2008

Peer-to-peer (P2P) technologies are used to facilitate real-time communication and collaboration across distributed networks. In the peer-to-peer model, without using Internet servers, each computer user can do the following:

  • Exchange data

  • Share resources

  • Locate other users

  • Communicate

  • Collaborate directly in real time

By using peer-to-peer technologies, applications that coordinate the use of computer CPU cycles and storage can share resources among large or small groups of computers connected to the Internet. P2P is configured and administered by using Netsh commands.

You can run these commands from the command prompt for the Netsh P2P context. For these commands to work at the command prompt, you must type netsh p2p before typing commands and parameters as they appear in the syntax below.

For more information about netsh, see Netsh Overview and Enter a Netsh Context.

For information on how to interpret netsh command syntax, see Formatting Legend.

The following commands are available at the p2p> prompt, which is rooted within the netsh environment.

To view the command syntax, click a command:

Changes to the netsh p2p collab context.

Creates a script that contains the current configuration. If saved to a

file, this script can be used to restore altered configuration settings.

Changes to the netsh p2p group context.

Changes to the netsh p2p idmgr context.

Changes to the netsh p2p pnrp context.

The following commands are available at the p2p collab> prompt, which is rooted within the netsh environment.

To view the command syntax, click a command:

Changes to the netsh p2p collab contact context.

The following commands are available at the p2p collab contact> prompt, which is rooted within the netsh environment.

To view the command syntax, click a command:

Deletes a contact from the contact store.

delete peer name

Exports the Me contact to a file name. This file can be later copied to another machine and is imported there.

Export file name

Imports a contact from a file to the contact store.

import file name

Sets the properties of a contact.

set {Id=<Peer Name>]<FriendlyName=<friendly name>Watch=<true | false> WatchPerm=<allow | block>}

Displays all contacts.

show contacts

Displays the contents of the contact XML file.

show xml file name

The following commands are available at the p2p group> prompt, which is rooted within the netsh environment.

To view the command syntax, click a command:

Changes to the netsh p2p group database context.

Resolves a participant in the group and lists its address.

resolve {ANY | REMOTE} <group P2PID> [<cloud name>]

Lists access control list (ACL) information.

show acl { identity <identity P2PID> | db <identity P2PID> <group P2PID>| <File path> }

Resolves a participant in the current node and lists its address.

show address <group P2PID> [ <cloud name> ]

The following commands are available at the p2p group database> prompt, which is rooted within the netsh environment.

To view the command syntax, click a command:

Lists database stats for given <identity P2PID> <group P2PID>.

show statistics <identity P2PID> <group P2PID>

The following commands are available at the p2p idmgr> prompt, which is rooted within the netsh environment.

To view the command syntax, click a command:

Deletes groups from identities.

delete group <identity P2PID> { <group P2PID> | ALL | EXPIRED }

Deletes identities.

delete identity <identity P2PID> { <identity P2PID> | ALL | QUIET }

Displays identity and related group information.

show groups { <identity P2PID> | ALL } [ EXPIRED ]

Displays identity information.

show identities { ALL | <identity P2PID> }

Displays a count of identities and associated groups.

show statistics

The following commands are available at the p2p pnrp> prompt, which is rooted within the netsh environment.

To view the command syntax, click a command:

Changes to the netsh p2p pnrp cloud context.

Changes to the netsh p2p pnrp diagnostics context.

Changes to the netsh p2p pnrp peer context.

The following commands are available at the p2p pnrp> prompt, which is rooted within the netsh environment.

To view the command syntax, click a command:

Deletes all cache entries.

flush [cloud=]<cloud name>

flush Global_

Detects and repairs Peer Name Resolution Protocol (PNRP) cloud fragmentation.

repair [cloud=]<cloud name>

repair Global_

Displays cloud bootstrap configuration and status.

show initialization [[cloud=]{ * | <cloud name>}]

Use * for all clouds. Default is Global_.

show initialization cloud=Global_

show initialization *

Displays a list of clouds.

show list [[cloud=] <cloud name>]

Default is all clouds.

show list Global_

show list

Displays all names registered on the local machine.

show names [[cloud=]{ * | <cloud name>}]

Default is all clouds.

show names cloud=Global_

show names

Displays PNRP mode configuration parameters.

show pnrpmode [[cloud=]<cloud name>]

Default is all clouds. The mode can be one of the following: RO (Resolve-only), Auto.

show pnrpmode Global_

Displays PNRP seed server configuration parameters.

show seed [cloud=]<cloud name>

Show seed Global_

Displays cloud statistics.

show statistics [[cloud=]{ * | <cloud name>}]

Default is all clouds.

Show statistics names cloud=Global_

show statistics names

Bootstraps a cloud.

start [cloud=]<cloud name>

start Global_

Queries a specified host for the addresses of other members of the cloud.

synchronize host [host=]<host name> [cloud=]<cloud name>

synchronize host host1 Global_

Queries the seed server for the addresses of other members of the cloud.

synchronize seed [cloud=]<cloud name>

synchronize seed Global_

The following commands are available at the p2p pnrp> prompt, which is rooted within the netsh environment.

To view the command syntax, click a command:

Tests PNRP connectivity to a node by specifying an address or a host name.

ping host [host=]{<ip address> | <host name>} [cloud=]<cloud name>

ping host myhost Global_

Tests PNRP connectivity to the configured seed server.

ping seed [cloud=]<cloud name>

ping seed Global_

The following commands are available at the p2p pnrp> prompt, which is rooted within the netsh environment.

To view the command syntax, click a command:

Registers a peer name. (Note that the registration will only last as long as the Netsh instance.)

add registration [peername=]<peer name> [cloud=]<cloud name>

[[comment]=<comment>]

Peer name
  • <canonical pnrp name>|<dns encoded pnrp name>

Cloud
The cloud where the name should be registered. Default is all Clouds.

Comment
The comment that should be registered for the name.

add registration peername=0.0

add registration 0.0 Global_

Unregisters a peer name.

delete registration [peername=]{ * | <peer name>} [cloud=]<cloud name>

Peername
  • <canonical pnrp name>|<dns-encoded pnrp name>

Cloud
The cloud from which the name should be unregistered. Default is all Clouds.

delete registration *

delete registration peername=0.0 cloud=Global_

Search for multiple registrations of a peer name in the specified cloud.

enumerate [peername=]<peer name> [cloud=]<cloud name>

[[maxresults=]<number>]

Peername
  • <canonical pnrp name>|<dns-encoded pnrp name>

Cloud
The cloud where the enumeration should happen.

Maxresults
Should be a number between one and 500. Default is 50.

enumerate 0.0 cloud=Global_ maxresults=2

enumerate peername=0.0 cloud=Global_

Resolves a peer name.

resolve [peername=]<peer name> [[cloud=]<cloud name>]

Peername
  • <canonical pnrp name>|<dns-encoded pnrp name>

resolve peername=0.0 cloud=Global_

resolve 0.anyname

Copies the console output to a file.

set file [ mode= ] { open [ name= ] <filename> | append [ name = ]<filename> | close }

Mode
One of the following values:

  • Open: Creates a new file or overwrites an existing file and streams the console output to the file.

  • Append: Opens an existing file and streams the console output to the end of the existing file.

  • Close: Stops streaming and closes a file.

Name
Name of the file (full path optional)

set file open c:\logfiles\logfile.txt

The above command creates a file and logs all output to it.

Configure the PNRP Machine Name Publication Service.

set machinename [[name=]<PeerName>] [[publish=]Start|Stop] [[autopublish=]enable|disable]

Name
The name to use as the machine name. If value is null, a secured name is automatically generated.

Publish
If set to 'start,' will cause the name to start being published immediately. If set to 'stop,' will stop the publication of the name.

Autopublish
Sets whether or not automatic publication is enabled. When autopublish is enabled, the machine automatically begins publishing the name at boot.

This command allows the user to control the publication of a Peer Name

for the machine using the Peer Name Resolution Protocol (PNRP).

If you use this functionality, it will allow you to resolve the Peer

Name of this machine from other remote machines subject to network

reachability. If you start publication through this command without

setting a name, then a secured name will be automatically generated

for you and will be visible through the 'show machinename' command.

set machinename publish=start autopublish=enable

Sets the current mode to online or offline.

set mode [ mode= ] { online | offline }

Mode
One of the following values:

  • online: Commit changes immediately

  • offline: Delay commit until explicitly requested

Set mode online

Converts standard peer names to DNS encoded peer names and vice versa.

show convertedname [peername=]<peer name>

show convertedname 0.anyname

Display the PNRP Machine Name Publication Service configuration.

show machinename

show machinename

List peer names registered by this instance of netsh.

show registration [[cloud=]<cloud name>]

show registration cloud=Global_

Resolves a peer name with path tracing.

traceroute [peername =]<peer name> [cloud=]<cloud name>

traceroute peername=0.0 Global_

traceroute 0.anyname Global_

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft