Format-ADSearchFilterValue

Escapes Active Directory special characters from a string.

Syntax

Format-ADSearchFilterValue [-String] <String> [<CommonParameters>]

Description

There are special characters in Active Directory queries/searches. This function escapes them so they aren't treated as AD commands/characters.

Related Commands

Parameters

Name Type Description Required? Pipeline Input Default Value
String String

The string to escape.

true false

Return Values

System.String. The input string with any Active Directory-sensitive characters escaped.

EXAMPLE 1

Format-ADSearchFilterValue -String "I have AD special characters (I think)."

Returns

I have AD special characters \28I think\29.