Test-PswaAuthorizationRule
[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]
Test-PswaAuthorizationRule
Tests authorization rules to validate that a particular user, computer, or endpoint access request is authorized.
Syntax
Parameter Set: ComputerName
Test-PswaAuthorizationRule [-UserName] <String> [-ComputerName] <String> [[-ConfigurationName] <String> ] [-Rule <PswaAuthorizationRule> ] [ <CommonParameters>]
Parameter Set: ConnectionUri
Test-PswaAuthorizationRule [-UserName] <String> [-ConnectionUri] <Uri> [[-ConfigurationName] <String> ] [-Rule <PswaAuthorizationRule> ] [ <CommonParameters>]
Detailed Description
The Test-PswaAuthorizationRule cmdlet tests 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 files. However, the user can specify a subset of rules to test.
The parameters for this cmdlet correspond to fields on the Windows PowerShell® Web Access sign-on page. This cmdlet is intended to help the administrator debug authentication failures and to verify that the authentication rules have the expected result.
Parameters
-ComputerName<String>
Specifies the name of the computer to test.
Aliases |
none |
Required? |
true |
Position? |
2 |
Default Value |
false |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-ConfigurationName<String>
Specifies the name of the Windows PowerShell session configuration, also known as endpoint or runspace, to test.
Aliases |
none |
Required? |
false |
Position? |
3 |
Default Value |
false |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-ConnectionUri<Uri>
Specifies the connection URI to test.
Aliases |
none |
Required? |
true |
Position? |
2 |
Default Value |
false |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-Rule<PswaAuthorizationRule>
Specifies a subset of rules to test. If this parameter is not specified, then this cmdlet tests against all authorization rules.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
false |
Accept Pipeline Input? |
true (ByValue) |
Accept Wildcard Characters? |
false |
-UserName<String>
Specifies the name of the user to test.
Aliases |
none |
Required? |
true |
Position? |
1 |
Default Value |
false |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
<CommonParameters>
This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
- None
Outputs
The output type is the type of the objects that the cmdlet emits.
- Microsoft.Management.PowerShellWebAccess.PswaAuthorizationRule[]
Examples
EXAMPLE 1
This example tests all authorization rules for rules that allow the user contoso\johnj99 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\johnj99 -ConfigurationName test