If you need to find a GPO that has a particular setting or text, then this is the script for you. It was written by BritV8, but I wanted to host it on my own site to ensure it’s always available.

This PowerShell script takes an input / parameter of a bit of text, then downloads all your group policies as XML files, then searches through them all to find which policies contain the text.

To use it, simply run up PowerShell as administrator, then run the script. It will prompt you for some text that you want to search you group policies for. Enter the search text and hit enter.

❗ Note: If you want to search for anything with a backslash (“\”) character, you must double up each backslash, because \ is an escape character in PowerShell. For example, to search for \\myServer\Share, you need to enter this search string: \\\\myServer\\Share.

Here’s the script:

< #
.Synopsis
Short description
.DESCRIPTION
Long description
.EXAMPLE
Example of how to use this cmdlet
.EXAMPLE
Another example of how to use this cmdlet
#>