次の方法で共有


Create method of the MSFT_NetRoute class

Creates a TCP/IP route.

Syntax

uint32 Create(
  [in]  uint32        InterfaceIndex,
  [in]  string        InterfaceAlias,
  [in]  string        DestinationPrefix,
  [in]  uint8         Publish,
  [in]  uint16        RouteMetric,
  [in]  datetime      ValidLifetime,
  [in]  datetime      PreferredLifetime,
  [in]  uint16        AddressFamily,
  [in]  string        PolicyStore,
  [in]  boolean       PassThru,
  [out] MSFT_NetRoute CmdletOutput
);

Parameters

InterfaceIndex [in]

The user-friendly interface index.

InterfaceAlias [in]

The user-friendly interface name.

DestinationPrefix [in]

The destination prefix.

Publish [in]

One of the following values:

No (0)

Not advertised in Route Advertisements. This is the default.

Age (1)

Advertised in Route Advertisements with a finite lifetime.

Yes (2)

Advertised in Route Advertisements with an infinite lifetime.

RouteMetric [in]

Metric of the route being added.

ValidLifetime [in]

Lifetime over which the route is valid. The default value is infinite.

PreferredLifetime [in]

Lifetime over which the route is preferred. The default value is infinite.

AddressFamily [in]

Indicates whether the address family for this route is v4 or v6.

2

v4

23

v6

PolicyStore [in]

Path to the group policy object that should be modified by this method.

PassThru [in]

true to return the current instance in the CmdletOutput parameter. The default is false.

CmdletOutput [out]

On return, contains an instance of the current object. This parameter returns a value only if PassThru is set to true.

Requirements

Minimum supported client
Windows 8
Minimum supported server
Windows Server 2012
Namespace
Root\Microsoft\Windows\RemoteAccess\Client
MOF
VPNClientPSProvider.mof
DLL
VPNClientPSProvider.dll

See also

MSFT_NetRoute