NAME

    Show-SWldapFilter

SYNOPSIS

    Will format an ldap filter with linebreaks and indenting
    and output it as a more readable string.
    To revert to valid ldap filter, use $filter -replace '\n\s*',''

SYNTAX

    Show-SWldapFilter [-ldapFilter] <String[]> [<CommonParameters>]

DESCRIPTION

    Ldap filters can be hard to read when they get more advanced.
    This script will reformat them for better readability.

 

PowerShell
Edit|Remove
Show-SWldapFilter -ldapFilter "(&(objectCategory=person)(objectClass=user)(!(userAccountControl:1.2.840.113556.1.4.803:=2))(|(accountExpires=0)(accountExpires=9223372036854775807))(userAccountControl:1.2.840.113556.1.4.803:=65536))"