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:

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.

Netsh P2P

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

To view the command syntax, click a command:

collab

Changes to the netsh p2p collab context.

dump

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

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

group

Changes to the netsh p2p group context.

idmgr

Changes to the netsh p2p idmgr context.

pnrp

Changes to the netsh p2p pnrp context.

Netsh P2P collab

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:

contact

Changes to the netsh p2p collab contact context.

Netsh P2P collab contact

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:

delete

Deletes a contact from the contact store.

Syntax

delete peer name

export

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

Syntax

Export file name

import

Imports a contact from a file to the contact store.

Syntax

import file name

set

Sets the properties of a contact.

Syntax

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

show contacts

Displays all contacts.

Syntax

show contacts

show xml

Displays the contents of the contact XML file.

Syntax

show xml file name

Netsh P2P group

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:

database

Changes to the netsh p2p group database context.

resolve

Resolves a participant in the group and lists its address.

Syntax

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

show acl

Lists access control list (ACL) information.

Syntax

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

show address

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

Syntax

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

Netsh P2P group database

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:

show statistics

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

Syntax

show statistics <identity P2PID> <group P2PID>

Netsh P2P idmgr

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:

delete group

Deletes groups from identities.

Syntax

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

delete identity

Deletes identities.

Syntax

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

show groups

Displays identity and related group information.

Syntax

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

show identities

Displays identity information.

Syntax

show identities { ALL | <identity P2PID> }

show statistics

Displays a count of identities and associated groups.

Syntax

show statistics

Netsh P2P pnrp

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:

cloud

Changes to the netsh p2p pnrp cloud context.

diagnostics

Changes to the netsh p2p pnrp diagnostics context.

peer

Changes to the netsh p2p pnrp peer context.

Netsh P2P pnrp cloud

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:

flush

Deletes all cache entries.

Syntax

flush [cloud=]<cloud name>

Example

flush Global_

repair

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

Syntax

repair [cloud=]<cloud name>

Example

repair Global_

show initialization

Displays cloud bootstrap configuration and status.

Syntax

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

Remarks

Use * for all clouds. Default is Global_.

Examples

show initialization cloud=Global_

show initialization *

show list

Displays a list of clouds.

Syntax

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

Remarks

Default is all clouds.

Examples

show list Global_

show list

show names

Displays all names registered on the local machine.

Syntax

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

Remarks

Default is all clouds.

Examples

show names cloud=Global_

show names

show pnrpmode

Displays PNRP mode configuration parameters.

Syntax

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

Remarks

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

Example

show pnrpmode Global_

show seed

Displays PNRP seed server configuration parameters.

Syntax

show seed [cloud=]<cloud name>

Example

Show seed Global_

show statistics

Displays cloud statistics.

Syntax

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

Remarks

Default is all clouds.

Examples

Show statistics names cloud=Global_

show statistics names

start

Bootstraps a cloud.

Syntax

start [cloud=]<cloud name>

Example

start Global_

synchronize host

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

Syntax

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

Example

synchronize host host1 Global_

synchronize seed

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

Syntax

synchronize seed [cloud=]<cloud name>

Example

synchronize seed Global_

Netsh P2P pnrp diagnostics

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:

ping host

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

Syntax

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

Example

ping host myhost Global_

ping seed

Tests PNRP connectivity to the configured seed server.

Syntax

ping seed [cloud=]<cloud name>

Example

ping seed Global_

Netsh P2P pnrp peer

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:

add registration

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

Syntax

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

[[comment]=<comment>]

Parameters
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.
Examples

add registration peername=0.0

add registration 0.0 Global_

delete registration

Unregisters a peer name.

Syntax

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

Parameters
Peername

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

Cloud

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

delete registration *

delete registration peername=0.0 cloud=Global_

enumerate

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

Syntax

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

[[maxresults=]<number>]

Parameters
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.
Examples

enumerate 0.0 cloud=Global_ maxresults=2

enumerate peername=0.0 cloud=Global_

resolve

Resolves a peer name.

Syntax

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

Parameters
Peername

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

Examples

resolve peername=0.0 cloud=Global_

resolve 0.anyname

set file

Copies the console output to a file.

Syntax

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

Parameters
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)
Examples

set file open c:\logfiles\logfile.txt

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

set machinename

Configure the PNRP Machine Name Publication Service.

Syntax

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

Parameters
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.
Remarks

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.

Examples

set machinename publish=start autopublish=enable

set mode

Sets the current mode to online or offline.

Syntax

set mode [ mode= ] { online | offline }

Parameters
Mode

One of the following values:
  • online: Commit changes immediately

  • offline: Delay commit until explicitly requested

Example

Set mode online

show convertedname

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

Syntax

show convertedname [peername=]<peer name>

Example

show convertedname 0.anyname

show machinename

Display the PNRP Machine Name Publication Service configuration.

Syntax

show machinename

Example

show machinename

show registration

List peer names registered by this instance of netsh.

Syntax

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

Example

show registration cloud=Global_

traceroute

Resolves a peer name with path tracing.

Syntax

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

Examples

traceroute peername=0.0 Global_

traceroute 0.anyname Global_