Skip to content

Search-GPO

SYNOPSIS

Search for a specific string in all Group Policy Objects (GPOs).

SYNTAX

Search-GPO [-StringToFind] <String> [<CommonParameters>]

DESCRIPTION

This function searches through all Group Policy Objects (GPOs) in the domain for a specified string. It generates XML reports for each GPO and checks if the string is present. The function provides progress updates and returns a list of GPOs that contain the specified string.

EXAMPLES

EXAMPLE 1

Search-GPO -StringToFind "LogonScript"

Searches all GPOs for the string "LogonScript" and returns a list of GPOs that contain it.

EXAMPLE 2

"AuditPolicy" | Search-GPO

Pipes the string "AuditPolicy" to the function to search all GPOs for it.

PARAMETERS

-StringToFind

The string to search for in the GPOs.

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

NOTES