Test-PswaAuthorizationRule

Test-PswaAuthorizationRule

Verifies whether a rule exists for a specified user, computer, or endpoint.

構文

Parameter Set: ComputerName
Test-PswaAuthorizationRule [-UserName] <String> [-ComputerName] <String> [[-ConfigurationName] <String> ] [-Credential <PSCredential> ] [-Rule <PswaAuthorizationRule[]> ] [ <CommonParameters>]

Parameter Set: ConnectionUri
Test-PswaAuthorizationRule [-UserName] <String> [-ConnectionUri] <Uri> [[-ConfigurationName] <String> ] [-Credential <PSCredential> ] [-Rule <PswaAuthorizationRule[]> ] [ <CommonParameters>]

詳細説明

The Test-PswaAuthorizationRule cmdlet verifies whether a rule exists for a specified user, computer, or endpoint. This cmdlet can also be used to test authorization rules to validate that a particular user, computer or endpoint access request is authorized.
By default, this cmdlet evaluates all rules in the authorization file. However, you can specify a subset of rules to test.

You can use this cmdlet to help troubleshoot authentication failures.

The parameters for this cmdlet correspond to fields on the Windows PowerShell® Web Access sign-on page.

パラメーター

-ComputerName<String>

Specifies the name of the computer to test.

エイリアス

なし

必須?

true

位置は?

2

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-ConfigurationName<String>

Specifies the name of the Windows PowerShell session configuration, also known as endpoint or runspace, to test.

エイリアス

なし

必須?

false

位置は?

3

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-ConnectionUri<Uri>

Specifies the connection URI to test.

エイリアス

なし

必須?

true

位置は?

2

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-Credential<PSCredential>

Specifies a PSCredential object for a user account that you want to use to test Windows PowerShell Web Access authorization rules. If you do not add this parameter, the cmdlet uses the currently logged-on user account. To get a PSCredential object, which is required to test authorization rules remotely, run the Get-Credential cmdlet.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-Rule<PswaAuthorizationRule[]>

Specifies a subset of rules to test. If this parameter is not specified, then this cmdlet tests against all authorization rules.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByValue)

ワイルドカード文字を許可する

false

-UserName<String>

Specifies the name of the user to test.

エイリアス

なし

必須?

true

位置は?

1

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

<CommonParameters>

このコマンドレットは次の共通パラメーターをサポートします。-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer、-OutVariable.詳細については、以下を参照してください。 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216)。

入力

入力型は、コマンドレットにパイプできるオブジェクトの型です。

  • Microsoft.Management.PowerShellWebAccess.PswaAuthorizationRule[]

    This cmdlet accepts a PswaAuthorizationRule object as input.

出力

出力型は、コマンドレットによって生成されるオブジェクトの型です。

  • Microsoft.Management.PowerShellWebAccess.PswaAuthorizationRule[]

    This cmdlet produces a PswaAuthorizationRule object as output.

EXAMPLE 1

This example tests all authorization rules in order to display all the rules that allow the user contoso\mhanson to connect to the computer srv2 and use a Windows PowerShell session configuration named test.

PS C:\> Test-PswaAuthorizationRule -ComputerName srv2.contoso.com -UserName contoso\mhanson -ConfigurationName test

EXAMPLE 2

This example tests all authorization rules to check which authorization rules apply to the user contoso\mhanson.

PS C:\> Test-PswaAuthorizationRule -UserName contoso\mhanson -ComputerName *

関連トピック

Add-PswaAuthorizationRule

Get-PswaAuthorizationRule

Remove-PswaAuthorizationRule

Install-PswaWebApplication

Get-Credential