Test-PswaAuthorizationRule
Test-PswaAuthorizationRule
Verifies whether a rule exists for a specified user, computer, or endpoint.
Sintaxis
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>]
Descripción detallada
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.
Parámetros
-ComputerName<String>
Specifies the name of the computer to test.
Alias |
ninguno |
¿Requerido? |
true |
¿Posición? |
2 |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
false |
¿Aceptar caracteres comodín? |
false |
-ConfigurationName<String>
Specifies the name of the Windows PowerShell session configuration, also known as endpoint or runspace, to test.
Alias |
ninguno |
¿Requerido? |
false |
¿Posición? |
3 |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
false |
¿Aceptar caracteres comodín? |
false |
-ConnectionUri<Uri>
Specifies the connection URI to test.
Alias |
ninguno |
¿Requerido? |
true |
¿Posición? |
2 |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
false |
¿Aceptar caracteres comodín? |
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.
Alias |
ninguno |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
false |
¿Aceptar caracteres comodín? |
false |
-Rule<PswaAuthorizationRule[]>
Specifies a subset of rules to test. If this parameter is not specified, then this cmdlet tests against all authorization rules.
Alias |
ninguno |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
True (ByValue) |
¿Aceptar caracteres comodín? |
false |
-UserName<String>
Specifies the name of the user to test.
Alias |
ninguno |
¿Requerido? |
true |
¿Posición? |
1 |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
false |
¿Aceptar caracteres comodín? |
false |
<CommonParameters>
Este cmdlet admite los siguientes parámetros comunes: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer y -OutVariable. Para obtener más información, consulte about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).
Entradas
El tipo de entrada es el tipo de los objetos que se pueden canalizar al cmdlet.
Microsoft.Management.PowerShellWebAccess.PswaAuthorizationRule[]
This cmdlet accepts a PswaAuthorizationRule object as input.
Salidas
El tipo de resultado es el tipo de objetos que emite el cmdlet.
Microsoft.Management.PowerShellWebAccess.PswaAuthorizationRule[]
This cmdlet produces a PswaAuthorizationRule object as output.
Ejemplos
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 *