# Get-PasswordFilterResult

The `Get-PasswordFilterResult` cmdlet allows you to programatically test passwords against your password policy.

This cmdlet does not attempt to change the user's password, nor does it contact the domain controller. Use of this cmdlet requires that the [group policy ](/password-protection/1.0/installation/configure-group-policy.md)for the password filter is configured and applied to the computer you are running the cmdlet on. The password filter does not need to be configured to filter passwords on the local computer, but the policy needs to be in place.

## Syntax

```
Get-PasswordFilterResult -Password <string> -Username <string> -Fullname <string> -IsSetOperation <bool>

Get-PasswordFilterResult -SecurePassword <SecureString> -Username <string> -Fullname <string> -IsSetOperation <bool>
```

### Parameters

**`Password`**

Required. The password to test

**`SecurePassword`**

Required. The password to test as a SecureString

**`Username`**

Required. The username of the user who would be changing their password

**`Fullname`**

Required. The full name of the user who would be changing their password

**`IsSetOperation`**

Optional. A boolean value indicating whether this should simulate a password set operation. The default value is false if not specified, which indicates that a password change operation should be simulated.

### Return value

The cmdlet will return one of the following values

| String value                  | Numeric value | Description                                                                                                                                                             |
| ----------------------------- | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Approved                      | 0             | The password was approved by the filter                                                                                                                                 |
| LengthRequirementsNotMet      | 1             | The password did not meet the minimum length requirements                                                                                                               |
| ComplexityThresholdNotMet     | 2             | The password did not meet the complexity requirements for a password of the given length                                                                                |
| ComplexityPointsNotMet        | 3             | The password did not meet the minimum number of complexity points                                                                                                       |
| DidNotMatchApprovalRegex      | 4             | The password did not match the regular expression required for approval                                                                                                 |
| MatchedRejectRegex            | 5             | The password did matched the rejection regular expression                                                                                                               |
| ContainsAccountName           | 6             | The password contained the user's account name                                                                                                                          |
| ContainsFullName              | 7             | The password contained all or part of the user's full name                                                                                                              |
| Compromised                   | 8             | The password was found in the compromised password store                                                                                                                |
| CompromisedNormalizedPassword | 9             | The password was found in the compromised password store after the [normalization rules](/password-protection/1.0/help-and-support/normalization-rules.md) were applied |
| BannedNormalizedWord          | 10            | The password was found in the banned word store after the [normalization rules](/password-protection/1.0/help-and-support/normalization-rules.md) were applied          |
| PasswordWasBlank              | 11            | The password was an empty string                                                                                                                                        |
| FilterError                   | 100           | An exception occurred in the filter engine and the password could not be processed                                                                                      |

### Examples

```powershell
PS> Get-PasswordFilterResult -Password "password" -Username "test-user" -Fullname "John Test"
Banned

PS> Get-PasswordFilterResult -Password "John" -Username "test-user" -Fullname "John Test"
ContainsFullName
```

The following example prompts for a password to test

```powershell
Get-PasswordFilterResult -SecurePassword (Read-Host -Prompt "Enter the password" -AsSecureString) -Username (Read-Host -Prompt "Enter the user's username") -Fullname (Read-Host -Prompt "Enter the user's full name")
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.lithnet.io/password-protection/1.0/advanced-help/powershell-reference/get-passwordfilterresult.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
