Replacing a string with a variable in Get-ADGroup

This is one of the reasons why using a script block based filter (-Filter {…}) on the cmdlets of the ActiveDirectory Module is not recommended. The -Filter on the Parameter section of the Get-* cmdlets from ActiveDirectory Module states the following: -Filter Specifies a query string that retrieves Active Directory objects. This string uses the … Read more