mirror of
https://github.com/EvotecIT/GPOZaurr.git
synced 2026-08-25 17:57:59 +00:00
Added or improved help on all functions.
This commit is contained in:
@@ -1,4 +1,43 @@
|
||||
function Add-GPOPermission {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Adds a permission to a Group Policy Object (GPO).
|
||||
|
||||
.DESCRIPTION
|
||||
This function adds a permission to a specified Group Policy Object (GPO) based on the provided parameters.
|
||||
|
||||
.PARAMETER Type
|
||||
Specifies the type of permission to add. Valid values are 'WellKnownAdministrative', 'Administrative', 'AuthenticatedUsers', and 'Default'.
|
||||
|
||||
.PARAMETER IncludePermissionType
|
||||
Specifies the permission type to include.
|
||||
|
||||
.PARAMETER Principal
|
||||
Specifies the principal to which the permission is granted.
|
||||
|
||||
.PARAMETER PrincipalType
|
||||
Specifies the type of the principal. Valid values are 'DistinguishedName', 'Name', and 'Sid'.
|
||||
|
||||
.PARAMETER PermitType
|
||||
Specifies whether to allow or deny the permission. Valid values are 'Allow' and 'Deny'.
|
||||
|
||||
.EXAMPLE
|
||||
Add-GPOPermission -Type Default -IncludePermissionType Read -Principal "Domain Admins" -PrincipalType DistinguishedName -PermitType Allow
|
||||
Adds a permission to the GPO with default settings allowing 'Domain Admins' to read.
|
||||
|
||||
.EXAMPLE
|
||||
Add-GPOPermission -Type Administrative -IncludePermissionType Write -Principal "Finance Group" -PrincipalType Name -PermitType Allow
|
||||
Adds a permission to the GPO for the 'Finance Group' allowing write access.
|
||||
|
||||
.EXAMPLE
|
||||
Add-GPOPermission -Type AuthenticatedUsers -IncludePermissionType Modify -PermitType Deny
|
||||
Adds a permission to the GPO for all authenticated users denying modification.
|
||||
|
||||
.EXAMPLE
|
||||
Add-GPOPermission -Type WellKnownAdministrative -IncludePermissionType FullControl -Principal "Enterprise Admins" -PrincipalType Sid -PermitType Allow
|
||||
Adds a permission to the GPO for 'Enterprise Admins' with full control.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[validateset('WellKnownAdministrative', 'Administrative', 'AuthenticatedUsers', 'Default')][string] $Type = 'Default',
|
||||
|
||||
@@ -1,4 +1,68 @@
|
||||
function Add-GPOZaurrPermission {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Adds permissions to a Group Policy Object (GPO) in Active Directory.
|
||||
|
||||
.DESCRIPTION
|
||||
This function allows you to add permissions to a specified GPO in Active Directory. You can specify the GPO by name, GUID, or apply permissions to all GPOs. Various parameters allow you to customize the permission settings.
|
||||
|
||||
.PARAMETER GPOName
|
||||
Specifies the name of the GPO to which permissions will be added.
|
||||
|
||||
.PARAMETER GPOGuid
|
||||
Specifies the GUID of the GPO to which permissions will be added.
|
||||
|
||||
.PARAMETER All
|
||||
Indicates that permissions should be added to all GPOs.
|
||||
|
||||
.PARAMETER ADObject
|
||||
Specifies the Active Directory object to which permissions will be applied.
|
||||
|
||||
.PARAMETER Type
|
||||
Specifies the type of permissions to be added. Valid values are 'WellKnownAdministrative', 'Administrative', 'AuthenticatedUsers', and 'Default'.
|
||||
|
||||
.PARAMETER Principal
|
||||
Specifies the trustee to which permissions will be granted.
|
||||
|
||||
.PARAMETER PrincipalType
|
||||
Specifies the type of the trustee. Valid values are 'DistinguishedName', 'Name', and 'Sid'.
|
||||
|
||||
.PARAMETER PermissionType
|
||||
Specifies the type of permission to be added.
|
||||
|
||||
.PARAMETER Inheritable
|
||||
Indicates whether permissions should be inheritable.
|
||||
|
||||
.PARAMETER PermitType
|
||||
Specifies the type of permission to be granted. Valid values are 'Allow', 'Deny', and 'All'.
|
||||
|
||||
.PARAMETER Forest
|
||||
Specifies the forest in which the GPO resides.
|
||||
|
||||
.PARAMETER ExcludeDomains
|
||||
Specifies the domains to exclude when applying permissions.
|
||||
|
||||
.PARAMETER IncludeDomains
|
||||
Specifies the domains to include when applying permissions.
|
||||
|
||||
.PARAMETER ExtendedForestInformation
|
||||
Specifies additional information about the forest.
|
||||
|
||||
.PARAMETER ADAdministrativeGroups
|
||||
Specifies the administrative groups in Active Directory.
|
||||
|
||||
.PARAMETER LimitProcessing
|
||||
Specifies the maximum number of processing steps.
|
||||
|
||||
.EXAMPLE
|
||||
Add-GPOZaurrPermission -GPOName "TestGPO" -Principal "User1" -PermissionType Read -PermitType Allow
|
||||
Adds read permission to "User1" for the GPO named "TestGPO".
|
||||
|
||||
.EXAMPLE
|
||||
Add-GPOZaurrPermission -GPOGuid "12345678-1234-1234-1234-1234567890AB" -Principal "Group1" -PermissionType Write -PermitType Deny
|
||||
Denies write permission to "Group1" for the GPO with the specified GUID.
|
||||
|
||||
#>
|
||||
[cmdletBinding(SupportsShouldProcess, DefaultParameterSetName = 'GPOName')]
|
||||
param(
|
||||
[Parameter(ParameterSetName = 'GPOName', Mandatory)][string] $GPOName,
|
||||
|
||||
@@ -1,4 +1,44 @@
|
||||
function Clear-GPOZaurrSysvolDFSR {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Clears the ConflictAndDeleted folder in DFSR for specified GPOs.
|
||||
|
||||
.DESCRIPTION
|
||||
This function clears the ConflictAndDeleted folder in DFSR for specified Group Policy Objects (GPOs) within a given forest. It allows excluding specific domains and domain controllers if needed.
|
||||
|
||||
.PARAMETER Forest
|
||||
Specifies the forest name where the GPOs are located.
|
||||
|
||||
.PARAMETER ExcludeDomains
|
||||
Specifies an array of domains to exclude from the cleanup process.
|
||||
|
||||
.PARAMETER ExcludeDomainControllers
|
||||
Specifies an array of domain controllers to exclude from the cleanup process.
|
||||
|
||||
.PARAMETER IncludeDomains
|
||||
Specifies an array of domains to include in the cleanup process.
|
||||
|
||||
.PARAMETER IncludeDomainControllers
|
||||
Specifies an array of domain controllers to include in the cleanup process.
|
||||
|
||||
.PARAMETER SkipRODC
|
||||
Indicates whether Read-Only Domain Controllers (RODCs) should be skipped during cleanup.
|
||||
|
||||
.PARAMETER ExtendedForestInformation
|
||||
Specifies additional forest information if needed.
|
||||
|
||||
.PARAMETER LimitProcessing
|
||||
Specifies the maximum number of GPOs to process.
|
||||
|
||||
.EXAMPLE
|
||||
Clear-GPOZaurrSysvolDFSR -Forest "contoso.com" -IncludeDomains "child.contoso.com" -ExcludeDomainControllers "dc1.contoso.com" -SkipRODC
|
||||
Clears the ConflictAndDeleted folder in DFSR for GPOs in the "contoso.com" forest, including only the "child.contoso.com" domain and excluding the "dc1.contoso.com" domain controller.
|
||||
|
||||
.EXAMPLE
|
||||
Clear-GPOZaurrSysvolDFSR -Forest "contoso.com" -IncludeDomains "child.contoso.com" -LimitProcessing 5
|
||||
Clears the ConflictAndDeleted folder in DFSR for GPOs in the "contoso.com" forest, including only the "child.contoso.com" domain, and processes a maximum of 5 GPOs.
|
||||
|
||||
#>
|
||||
[cmdletBinding(SupportsShouldProcess)]
|
||||
param(
|
||||
[alias('ForestName')][string] $Forest,
|
||||
|
||||
@@ -1,4 +1,26 @@
|
||||
function ConvertFrom-CSExtension {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts Client-side Extension (CSE) GUIDs to their corresponding names.
|
||||
|
||||
.DESCRIPTION
|
||||
This function takes an array of CSE GUIDs and returns their corresponding names. It can be used to easily identify the purpose of each CSE GUID.
|
||||
|
||||
.PARAMETER CSE
|
||||
Specifies an array of Client-side Extension (CSE) GUIDs to be converted to names.
|
||||
|
||||
.PARAMETER Limited
|
||||
Indicates whether the conversion should be limited to a predefined set of CSE GUIDs.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertFrom-CSExtension -CSE '{35378EAC-683F-11D2-A89A-00C04FBBCFA2}', '{0F6B957E-509E-11D1-A7CC-0000F87571E3}' -Limited
|
||||
Converts the specified CSE GUIDs to their corresponding names, limited to a predefined set.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertFrom-CSExtension -CSE '{D02B1F73-3407-48AE-BA88-E8213C6761F1}', '{0ACDD40C-75AC-47ab-BAA0-BF6DE7E7FE63}'
|
||||
Converts the specified CSE GUIDs to their corresponding names without any limitations.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[string[]] $CSE,
|
||||
|
||||
@@ -1,22 +1,23 @@
|
||||
function Export-GPOZaurrContent {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Saves GPOs to XML or HTML files.
|
||||
Exports Group Policy Objects (GPOs) to XML or HTML files.
|
||||
|
||||
.DESCRIPTION
|
||||
Saves GPOs to XML or HTML files.
|
||||
This function exports GPOs to either XML or HTML files based on the specified parameters.
|
||||
|
||||
.PARAMETER FolderOutput
|
||||
The folder where the GPOs will be saved.
|
||||
Specifies the folder path where the exported GPO files will be saved.
|
||||
|
||||
.PARAMETER ReportType
|
||||
The type of report to generate. Valid values are XML or HTML. Default is XML.
|
||||
Specifies the type of report to generate. Valid values are XML or HTML. The default value is XML.
|
||||
|
||||
.EXAMPLE
|
||||
An example
|
||||
Export-GPOZaurrContent -FolderOutput "C:\ExportedGPOs" -ReportType HTML
|
||||
Exports all GPOs to HTML format and saves them in the "C:\ExportedGPOs" folder.
|
||||
|
||||
.NOTES
|
||||
General notes
|
||||
This function exports GPOs to XML or HTML files for further analysis or backup purposes.
|
||||
#>
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
|
||||
@@ -1,4 +1,25 @@
|
||||
function Find-CSExtension {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
This function retrieves Group Policy Client Side Extensions (CSEs) from a specified Windows 10 computer.
|
||||
|
||||
.DESCRIPTION
|
||||
The Find-CSExtension function lists Group Policy Client Side Extensions (CSEs) configured on a Windows 10 computer. It queries the Windows Registry to retrieve information about the CSEs.
|
||||
|
||||
.PARAMETER CSE
|
||||
Specifies an array of CSE names to filter the results. If not provided, all CSEs will be listed.
|
||||
|
||||
.PARAMETER ComputerName
|
||||
Specifies the name of the computer from which to retrieve the CSE information.
|
||||
|
||||
.EXAMPLE
|
||||
Find-CSExtension -ComputerName "Computer01"
|
||||
Retrieves all CSEs configured on the computer named "Computer01".
|
||||
|
||||
.EXAMPLE
|
||||
Find-CSExtension -CSE "CSE1", "CSE2" -ComputerName "Computer02"
|
||||
Retrieves information about CSEs named "CSE1" and "CSE2" on the computer named "Computer02".
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[string[]] $CSE,
|
||||
|
||||
@@ -1,4 +1,60 @@
|
||||
function Get-GPOZaurrAD {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Retrieves Group Policy Objects (GPOs) information from Active Directory.
|
||||
|
||||
.DESCRIPTION
|
||||
This function retrieves information about Group Policy Objects (GPOs) from Active Directory based on specified criteria such as GPO name, GPO GUID, date range, and forest details.
|
||||
|
||||
.PARAMETER GPOName
|
||||
Specifies the name of the GPO to retrieve.
|
||||
|
||||
.PARAMETER GPOGuid
|
||||
Specifies the GUID of the GPO to retrieve.
|
||||
|
||||
.PARAMETER Forest
|
||||
Specifies the forest name to search for GPOs.
|
||||
|
||||
.PARAMETER ExcludeDomains
|
||||
Specifies an array of domains to exclude from the search.
|
||||
|
||||
.PARAMETER IncludeDomains
|
||||
Specifies an array of domains to include in the search.
|
||||
|
||||
.PARAMETER DateFrom
|
||||
Specifies the start date for filtering GPOs based on creation or modification date.
|
||||
|
||||
.PARAMETER DateTo
|
||||
Specifies the end date for filtering GPOs based on creation or modification date.
|
||||
|
||||
.PARAMETER DateRange
|
||||
Specifies a predefined date range for filtering GPOs based on creation or modification date.
|
||||
|
||||
.PARAMETER DateProperty
|
||||
Specifies the property (WhenCreated or WhenChanged) to use for filtering GPOs based on date.
|
||||
|
||||
.PARAMETER ExtendedForestInformation
|
||||
Specifies additional forest information to include in the output.
|
||||
|
||||
.EXAMPLE
|
||||
Get-GPOZaurrAD -GPOName "ExampleGPO"
|
||||
|
||||
Description:
|
||||
Retrieves information about a GPO with the name "ExampleGPO".
|
||||
|
||||
.EXAMPLE
|
||||
Get-GPOZaurrAD -GPOGuid "{12345678-1234-1234-1234-123456789012}"
|
||||
|
||||
Description:
|
||||
Retrieves information about a GPO with the specified GUID.
|
||||
|
||||
.EXAMPLE
|
||||
Get-GPOZaurrAD -Forest "example.com" -IncludeDomains "domain1", "domain2" -DateRange "Last30Days"
|
||||
|
||||
Description:
|
||||
Retrieves GPO information from the forest "example.com" for domains "domain1" and "domain2" created or modified in the last 30 days.
|
||||
|
||||
#>
|
||||
[cmdletbinding(DefaultParameterSetName = 'Default')]
|
||||
param(
|
||||
[Parameter(ParameterSetName = 'GPOName')]
|
||||
|
||||
@@ -1,4 +1,26 @@
|
||||
function Get-GPOZaurrBackupInformation {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Retrieves backup information from GPOZaurr manifest files.
|
||||
|
||||
.DESCRIPTION
|
||||
This function retrieves backup information from GPOZaurr manifest files located in the specified BackupFolder(s).
|
||||
|
||||
.PARAMETER BackupFolder
|
||||
Specifies the path(s) to the folder containing GPOZaurr manifest files.
|
||||
|
||||
.EXAMPLE
|
||||
Get-GPOZaurrBackupInformation -BackupFolder "C:\Backups"
|
||||
|
||||
Description:
|
||||
Retrieves backup information from GPOZaurr manifest files located in the "C:\Backups" folder.
|
||||
|
||||
.EXAMPLE
|
||||
Get-GPOZaurrBackupInformation -BackupFolder "C:\Backups", "D:\Archives"
|
||||
|
||||
Description:
|
||||
Retrieves backup information from GPOZaurr manifest files located in both "C:\Backups" and "D:\Archives" folders.
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[string[]] $BackupFolder
|
||||
|
||||
@@ -1,4 +1,31 @@
|
||||
function Get-GPOZaurrDuplicateObject {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Retrieves duplicate Group Policy Objects (GPOs) within a specified forest.
|
||||
|
||||
.DESCRIPTION
|
||||
This function retrieves duplicate Group Policy Objects (GPOs) within a specified forest by comparing GPOs based on partial distinguished name matching.
|
||||
|
||||
.PARAMETER Forest
|
||||
Specifies the name of the forest to search for duplicate GPOs.
|
||||
|
||||
.PARAMETER IncludeDomains
|
||||
Specifies an array of domain names to include in the search for duplicate GPOs.
|
||||
|
||||
.PARAMETER ExcludeDomains
|
||||
Specifies an array of domain names to exclude from the search for duplicate GPOs.
|
||||
|
||||
.PARAMETER ExtendedForestInformation
|
||||
Specifies additional information about the forest to aid in the search for duplicate GPOs.
|
||||
|
||||
.EXAMPLE
|
||||
Get-GPOZaurrDuplicateObject -Forest "contoso.com" -IncludeDomains "child1.contoso.com", "child2.contoso.com" -ExcludeDomains "child3.contoso.com" -ExtendedForestInformation $additionalInfo
|
||||
|
||||
Description
|
||||
-----------
|
||||
Retrieves duplicate GPOs within the "contoso.com" forest, including domains "child1.contoso.com" and "child2.contoso.com" while excluding "child3.contoso.com". Additional forest information is provided for the search.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[alias('ForestName')][string] $Forest,
|
||||
|
||||
@@ -1,4 +1,49 @@
|
||||
function Get-GPOZaurrFiles {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Retrieves information about Group Policy Objects (GPOs) stored in SYSVOL and NETLOGON folders.
|
||||
|
||||
.DESCRIPTION
|
||||
This function retrieves information about GPOs stored in SYSVOL and NETLOGON folders of specified domains. It can filter by type of files and hash algorithms used for verification.
|
||||
|
||||
.PARAMETER Type
|
||||
Specifies the type of files to retrieve. Valid values are 'All', 'Netlogon', and 'Sysvol'.
|
||||
|
||||
.PARAMETER HashAlgorithm
|
||||
Specifies the hash algorithm to use for file verification. Valid values are 'None', 'MACTripleDES', 'MD5', 'RIPEMD160', 'SHA1', 'SHA256', 'SHA384', 'SHA512'.
|
||||
|
||||
.PARAMETER Signature
|
||||
Indicates whether to include file signatures for verification.
|
||||
|
||||
.PARAMETER AsHashTable
|
||||
Indicates whether to return the results as a hashtable.
|
||||
|
||||
.PARAMETER Extended
|
||||
Indicates whether to include extended information about the forest.
|
||||
|
||||
.PARAMETER ExtendedMetaData
|
||||
Indicates whether to include extended metadata information.
|
||||
|
||||
.PARAMETER Forest
|
||||
Specifies the forest name to retrieve GPO information from.
|
||||
|
||||
.PARAMETER ExcludeDomains
|
||||
Specifies an array of domains to exclude from the search.
|
||||
|
||||
.PARAMETER IncludeDomains
|
||||
Specifies an array of domains to include in the search.
|
||||
|
||||
.PARAMETER ExtendedForestInformation
|
||||
Specifies additional forest information to include.
|
||||
|
||||
.EXAMPLE
|
||||
Get-GPOZaurrFiles -Type 'All' -HashAlgorithm 'SHA256' -Signature
|
||||
Retrieves all files from SYSVOL and NETLOGON folders with SHA256 hash algorithm and includes file signatures.
|
||||
|
||||
.EXAMPLE
|
||||
Get-GPOZaurrFiles -Type 'Sysvol' -HashAlgorithm 'MD5' -AsHashTable
|
||||
Retrieves only SYSVOL files with MD5 hash algorithm and returns the results as a hashtable.
|
||||
#>
|
||||
[cmdletbinding()]
|
||||
param(
|
||||
[ValidateSet('All', 'Netlogon', 'Sysvol')][string[]] $Type = 'All',
|
||||
|
||||
@@ -1,4 +1,31 @@
|
||||
function Get-GPOZaurrFilesPolicyDefinition {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Retrieves policy definitions for Group Policy Objects (GPOs) within specified domains.
|
||||
|
||||
.DESCRIPTION
|
||||
This function retrieves policy definitions for GPOs within specified domains. It collects information about policy files, including their attributes and digital signatures.
|
||||
|
||||
.PARAMETER Forest
|
||||
Specifies the forest name to retrieve GPO policy definitions from.
|
||||
|
||||
.PARAMETER ExcludeDomains
|
||||
Specifies an array of domains to exclude from the search.
|
||||
|
||||
.PARAMETER IncludeDomains
|
||||
Specifies an array of domains to include in the search.
|
||||
|
||||
.PARAMETER ExtendedForestInformation
|
||||
Specifies additional forest information to include in the output.
|
||||
|
||||
.PARAMETER Signature
|
||||
Indicates whether to retrieve digital signature information for policy files.
|
||||
|
||||
.EXAMPLE
|
||||
Get-GPOZaurrFilesPolicyDefinition -Forest "contoso.com" -IncludeDomains "domain1", "domain2" -ExcludeDomains "domain3" -Signature
|
||||
Retrieves policy definitions for GPOs within the "contoso.com" forest, including domains "domain1" and "domain2" while excluding "domain3". Digital signature information is also retrieved.
|
||||
|
||||
#>
|
||||
[alias('Get-GPOZaurrFilesPolicyDefinitions')]
|
||||
[cmdletbinding()]
|
||||
param(
|
||||
|
||||
@@ -1,4 +1,40 @@
|
||||
function Get-GPOZaurrFolders {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Retrieves information about GPO folders within specified domains.
|
||||
|
||||
.DESCRIPTION
|
||||
This function retrieves information about various GPO folders within specified domains, such as PolicyDefinitions, Policies, Scripts, GPO Starters, NETLOGON Scripts, DfsrPrivate, and SYSVOL Root.
|
||||
|
||||
.PARAMETER Type
|
||||
Specifies the type of folders to retrieve. Valid values are 'All', 'Netlogon', 'Sysvol'.
|
||||
|
||||
.PARAMETER FolderType
|
||||
Specifies the type of folders to retrieve. Valid values are 'All', 'NTFRS', 'Empty'.
|
||||
|
||||
.PARAMETER Forest
|
||||
Specifies the forest name to retrieve information for.
|
||||
|
||||
.PARAMETER ExcludeDomains
|
||||
Specifies domains to exclude from the retrieval.
|
||||
|
||||
.PARAMETER IncludeDomains
|
||||
Specifies domains to include in the retrieval.
|
||||
|
||||
.PARAMETER ExtendedForestInformation
|
||||
Specifies additional information about the forest.
|
||||
|
||||
.PARAMETER AsHashTable
|
||||
Indicates whether to return the output as a hashtable.
|
||||
|
||||
.EXAMPLE
|
||||
Get-GPOZaurrFolders -Type All -FolderType All -Forest 'example.com' -IncludeDomains 'domain1', 'domain2' -ExcludeDomains 'domain3' -ExtendedForestInformation $info -AsHashTable
|
||||
Retrieves information about all types of GPO folders within the specified domains in the forest 'example.com', excluding 'domain3', and including 'domain1' and 'domain2', with extended forest information.
|
||||
|
||||
.EXAMPLE
|
||||
Get-GPOZaurrFolders -Type Sysvol -FolderType NTFRS -Forest 'example.com' -IncludeDomains 'domain1' -AsHashTable
|
||||
Retrieves information about Sysvol folders using NTFRS type within the specified domain 'domain1' in the forest 'example.com' and returns the output as a hashtable.
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[ValidateSet('All', 'Netlogon', 'Sysvol')][string[]] $Type = 'All',
|
||||
|
||||
@@ -1,44 +1,44 @@
|
||||
function Get-GPOZaurrInheritance {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Short description
|
||||
Retrieves inheritance information for Group Policy Objects (GPOs) within specified Organizational Units (OUs).
|
||||
|
||||
.DESCRIPTION
|
||||
Long description
|
||||
This function retrieves and displays inheritance information for GPOs within specified OUs. It provides details on blocked inheritance, excluded objects, and group policies associated with blocked objects.
|
||||
|
||||
.PARAMETER IncludeBlockedObjects
|
||||
Include OU's with blocked inheritance. Default disabled
|
||||
Specifies whether to include OUs with blocked inheritance. By default, this is disabled.
|
||||
|
||||
.PARAMETER OnlyBlockedInheritance
|
||||
Show only OU's with blocked inheritance
|
||||
Specifies whether to show only OUs with blocked inheritance.
|
||||
|
||||
.PARAMETER IncludeExcludedObjects
|
||||
Show excluded objets. Default disabled
|
||||
Specifies whether to show excluded objects. By default, this is disabled.
|
||||
|
||||
.PARAMETER IncludeGroupPoliciesForBlockedObjects
|
||||
Include Group Policies for Blocked Objects. Default disabled
|
||||
Specifies whether to include Group Policies for blocked objects. By default, this is disabled.
|
||||
|
||||
.PARAMETER Exclusions
|
||||
Provide exclusions for OU's approved by IT. You can provide OU by canonical name or distinguishedName
|
||||
Specifies the OUs approved by IT to be excluded. You can provide OUs by canonical name or distinguishedName.
|
||||
|
||||
.PARAMETER Forest
|
||||
Target different Forest, by default current forest is used
|
||||
Specifies the target forest. By default, the current forest is used.
|
||||
|
||||
.PARAMETER ExcludeDomains
|
||||
Exclude domain from search, by default whole forest is scanned
|
||||
Specifies the domain to exclude from the search. By default, the entire forest is scanned.
|
||||
|
||||
.PARAMETER IncludeDomains
|
||||
Include only specific domains, by default whole forest is scanned
|
||||
Specifies specific domains to include. By default, the entire forest is scanned.
|
||||
|
||||
.PARAMETER ExtendedForestInformation
|
||||
Ability to provide Forest Information from another command to speed up processing
|
||||
Allows providing Forest Information from another command to speed up processing.
|
||||
|
||||
.EXAMPLE
|
||||
$Objects = Get-GPOZaurrInheritance -IncludeBlockedObjects -IncludeExcludedObjects -OnlyBlockedInheritance -Exclusions $ExcludedOU
|
||||
$Objects | Format-Table
|
||||
|
||||
.NOTES
|
||||
General notes
|
||||
These are general notes about the function.
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
|
||||
@@ -1,4 +1,29 @@
|
||||
function Get-GPOZaurrLegacyFiles {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Retrieves legacy Group Policy Object (GPO) files from the SYSVOL directory of specified domains within a forest.
|
||||
|
||||
.DESCRIPTION
|
||||
The Get-GPOZaurrLegacyFiles function retrieves legacy GPO files, such as '*.adm' and 'admfiles.ini', from the SYSVOL directory of specified domains within a forest. It provides detailed information about these files including their name, full path, creation time, last write time, attributes, associated domain name, and directory name.
|
||||
|
||||
.PARAMETER Forest
|
||||
Specifies the name of the forest from which to retrieve legacy GPO files.
|
||||
|
||||
.PARAMETER ExcludeDomains
|
||||
Specifies an array of domain names to exclude from the search for legacy GPO files.
|
||||
|
||||
.PARAMETER IncludeDomains
|
||||
Specifies an array of domain names to include in the search for legacy GPO files.
|
||||
|
||||
.PARAMETER ExtendedForestInformation
|
||||
Specifies additional information about the forest to enhance the retrieval process.
|
||||
|
||||
.EXAMPLE
|
||||
Get-GPOZaurrLegacyFiles -Forest "contoso.com" -IncludeDomains "domain1", "domain2" -ExcludeDomains "domain3" -ExtendedForestInformation $additionalInfo
|
||||
|
||||
Retrieves legacy GPO files from the "contoso.com" forest for "domain1" and "domain2" domains while excluding "domain3", using additional forest information.
|
||||
|
||||
#>
|
||||
[cmdletbinding()]
|
||||
param(
|
||||
[alias('ForestName')][string] $Forest,
|
||||
|
||||
@@ -1,4 +1,62 @@
|
||||
function Get-GPOZaurrLink {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Retrieves Group Policy Object (GPO) Zaurr links based on specified criteria.
|
||||
|
||||
.DESCRIPTION
|
||||
This function retrieves GPO Zaurr links based on various parameters such as ADObject, Filter, Linked, Site, etc. It provides flexibility in searching for GPO Zaurr links within Active Directory.
|
||||
|
||||
.PARAMETER ADObject
|
||||
Specifies the Active Directory object(s) to search for GPO Zaurr links.
|
||||
|
||||
.PARAMETER Filter
|
||||
Specifies the filter criteria to search for GPO Zaurr links.
|
||||
|
||||
.PARAMETER SearchBase
|
||||
Specifies the search base for filtering GPO Zaurr links.
|
||||
|
||||
.PARAMETER SearchScope
|
||||
Specifies the search scope for filtering GPO Zaurr links.
|
||||
|
||||
.PARAMETER Linked
|
||||
Specifies the type of linked GPOs to retrieve. Valid values are 'All', 'Root', 'DomainControllers', 'Site', and 'OrganizationalUnit'.
|
||||
|
||||
.PARAMETER Site
|
||||
Specifies the site(s) to search for GPO Zaurr links.
|
||||
|
||||
.PARAMETER Limited
|
||||
Indicates whether to limit the search results.
|
||||
|
||||
.PARAMETER SkipDuplicates
|
||||
Indicates whether to skip duplicate search results.
|
||||
|
||||
.PARAMETER GPOCache
|
||||
Specifies a cache for storing GPO information.
|
||||
|
||||
.PARAMETER Forest
|
||||
Specifies the forest name for filtering GPO Zaurr links.
|
||||
|
||||
.PARAMETER ExcludeDomains
|
||||
Specifies the domains to exclude from the search.
|
||||
|
||||
.PARAMETER IncludeDomains
|
||||
Specifies the domains to include in the search.
|
||||
|
||||
.EXAMPLE
|
||||
Get-GPOZaurrLink -ADObject $ADObject -Linked 'All'
|
||||
|
||||
Description
|
||||
-----------
|
||||
Retrieves all linked GPOZaurr links for the specified Active Directory object(s).
|
||||
|
||||
.EXAMPLE
|
||||
Get-GPOZaurrLink -Filter "(objectClass -eq 'organizationalUnit')" -SearchBase 'CN=Configuration,DC=ad,DC=evotec,DC=xyz'
|
||||
|
||||
Description
|
||||
-----------
|
||||
Retrieves GPOZaurr links based on the specified filter and search base.
|
||||
|
||||
#>
|
||||
[cmdletbinding(DefaultParameterSetName = 'Linked')]
|
||||
param(
|
||||
[parameter(ParameterSetName = 'ADObject', ValueFromPipeline, ValueFromPipelineByPropertyName, Mandatory)][Microsoft.ActiveDirectory.Management.ADObject[]] $ADObject,
|
||||
|
||||
@@ -1,4 +1,38 @@
|
||||
function Get-GPOZaurrLinkSummary {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Retrieves a summary of GPO links based on specified criteria.
|
||||
|
||||
.DESCRIPTION
|
||||
This function retrieves a summary of GPO links based on the provided parameters. It categorizes the links into different types and provides detailed information about each link.
|
||||
|
||||
.PARAMETER Report
|
||||
Specifies the type of report to generate. Valid values are 'All', 'MultipleLinks', 'OneLink', and 'LinksSummary'. Default is 'All'.
|
||||
|
||||
.PARAMETER UnlimitedProperties
|
||||
Indicates whether to include unlimited properties in the report.
|
||||
|
||||
.PARAMETER Forest
|
||||
Specifies the forest name to retrieve GPO links from.
|
||||
|
||||
.PARAMETER ExcludeDomains
|
||||
Specifies an array of domains to exclude from the report.
|
||||
|
||||
.PARAMETER IncludeDomains
|
||||
Specifies an array of domains to include in the report.
|
||||
|
||||
.PARAMETER ExtendedForestInformation
|
||||
Specifies additional information about the forest.
|
||||
|
||||
.EXAMPLE
|
||||
Get-GPOZaurrLinkSummary -Forest "Contoso" -IncludeDomains "Domain1", "Domain2" -Report "MultipleLinks"
|
||||
Retrieves a summary of GPO links for the specified forest and included domains, focusing on multiple links.
|
||||
|
||||
.EXAMPLE
|
||||
Get-GPOZaurrLinkSummary -Forest "Fabrikam" -ExcludeDomains "Domain3" -Report "OneLink"
|
||||
Retrieves a summary of GPO links for the specified forest excluding Domain3, focusing on a single link.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[ValidateSet('All', 'MultipleLinks', 'OneLink', 'LinksSummary')][string[]] $Report = 'All',
|
||||
|
||||
@@ -1,4 +1,43 @@
|
||||
function Get-GPOZaurrMissingFiles {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Retrieves information about missing files in Group Policy Objects (GPOs) within a specified forest.
|
||||
|
||||
.DESCRIPTION
|
||||
This function queries Active Directory for GPOs and checks for missing files within them. It provides detailed information about any errors found.
|
||||
|
||||
.PARAMETER Forest
|
||||
Specifies the name of the forest to query for GPO information.
|
||||
|
||||
.PARAMETER ExcludeDomains
|
||||
Specifies an array of domains to exclude from the query.
|
||||
|
||||
.PARAMETER IncludeDomains
|
||||
Specifies an array of domains to include in the query.
|
||||
|
||||
.PARAMETER ExtendedForestInformation
|
||||
Specifies additional information about the forest.
|
||||
|
||||
.PARAMETER GPOName
|
||||
Specifies the name of the GPO to retrieve information for.
|
||||
|
||||
.PARAMETER GPOGUID
|
||||
Specifies the GUID of the GPO to retrieve information for.
|
||||
|
||||
.PARAMETER BrokenOnly
|
||||
Indicates whether to only display GPOs with missing files.
|
||||
|
||||
.EXAMPLE
|
||||
Get-GPOZaurrMissingFiles -Forest "example.com" -IncludeDomains "domain1", "domain2" -ExcludeDomains "domain3" -GPOName "GPO1"
|
||||
|
||||
Retrieves information about missing files in the GPO named "GPO1" within the "example.com" forest, including only domains "domain1" and "domain2" while excluding "domain3".
|
||||
|
||||
.EXAMPLE
|
||||
Get-GPOZaurrMissingFiles -Forest "example.com" -IncludeDomains "domain1", "domain2" -GPOGUID "12345678-1234-1234-1234-1234567890AB" -BrokenOnly
|
||||
|
||||
Retrieves information about GPOs with missing files in the "example.com" forest, including only domains "domain1" and "domain2" for the GPO with the specified GUID, displaying only GPOs with missing files.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[Parameter()][alias('ForestName')][string] $Forest,
|
||||
|
||||
@@ -1,4 +1,42 @@
|
||||
function Get-GPOZaurrNetLogon {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Retrieves information about Group Policy Objects (GPO) stored in the Netlogon and SYSVOL directories.
|
||||
|
||||
.DESCRIPTION
|
||||
The Get-GPOZaurrNetLogon function retrieves details about GPOs stored in the Netlogon and SYSVOL directories of specified domains within a forest. It provides information about file ownership, status, domain, extension, creation time, and more.
|
||||
|
||||
.PARAMETER OwnerOnly
|
||||
Specifies whether to include only GPOs with identified owners.
|
||||
|
||||
.PARAMETER SkipOwner
|
||||
Specifies whether to skip checking the owner of GPOs.
|
||||
|
||||
.PARAMETER Forest
|
||||
Specifies the forest name to retrieve GPO information from.
|
||||
|
||||
.PARAMETER ExcludeDomains
|
||||
Specifies an array of domains to exclude from GPO retrieval.
|
||||
|
||||
.PARAMETER IncludeDomains
|
||||
Specifies an array of domains to include in GPO retrieval.
|
||||
|
||||
.PARAMETER ExtendedForestInformation
|
||||
Specifies additional forest information to include in the output.
|
||||
|
||||
.EXAMPLE
|
||||
Get-GPOZaurrNetLogon -Forest "contoso.com" -IncludeDomains "domain1", "domain2"
|
||||
Retrieves GPO information for the specified forest and domains.
|
||||
|
||||
.EXAMPLE
|
||||
Get-GPOZaurrNetLogon -OwnerOnly
|
||||
Retrieves GPO information only for GPOs with identified owners.
|
||||
|
||||
.EXAMPLE
|
||||
Get-GPOZaurrNetLogon -SkipOwner
|
||||
Retrieves GPO information while skipping the owner check.
|
||||
|
||||
#>
|
||||
[cmdletBinding(DefaultParameterSetName = 'Default')]
|
||||
param(
|
||||
[parameter(ParameterSetName = 'OwnerOnly')][switch] $OwnerOnly,
|
||||
|
||||
@@ -1,4 +1,34 @@
|
||||
function Get-GPOZaurrOrganizationalUnit {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Retrieves information about Group Policy Objects (GPOs) linked to Organizational Units (OUs) within a specified forest.
|
||||
|
||||
.DESCRIPTION
|
||||
This function retrieves detailed information about the GPOs linked to OUs within a specified forest. It provides information on linked GPOs, objects within OUs, and counts of objects at different levels.
|
||||
|
||||
.PARAMETER Forest
|
||||
Specifies the name of the forest to retrieve information from.
|
||||
|
||||
.PARAMETER ExcludeDomains
|
||||
Specifies an array of domains to exclude from processing.
|
||||
|
||||
.PARAMETER IncludeDomains
|
||||
Specifies an array of domains to include for processing.
|
||||
|
||||
.PARAMETER ExtendedForestInformation
|
||||
Specifies additional information about the forest.
|
||||
|
||||
.PARAMETER Option
|
||||
Specifies the action to perform on the retrieved data. Valid values are 'OK', 'Unlink', or 'Delete'.
|
||||
|
||||
.PARAMETER ExcludeOrganizationalUnit
|
||||
Specifies an array of OUs to exclude from processing.
|
||||
|
||||
.EXAMPLE
|
||||
Get-GPOZaurrOrganizationalUnit -Forest "contoso.com" -IncludeDomains "child.contoso.com" -ExcludeDomains "test.contoso.com" -ExtendedForestInformation $ExtendedInfo -Option "OK" -ExcludeOrganizationalUnit "OU=Test,DC=contoso,DC=com"
|
||||
Retrieves information about GPOs linked to OUs in the "contoso.com" forest, including the "child.contoso.com" domain, excluding the "test.contoso.com" domain, with additional forest information, performing the 'OK' action, and excluding the "OU=Test,DC=contoso,DC=com" OU.
|
||||
|
||||
#>
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[alias('ForestName')][string] $Forest,
|
||||
|
||||
@@ -1,4 +1,82 @@
|
||||
function Get-GPOZaurrPermission {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Retrieves permissions for a Group Policy Object (GPO) based on specified criteria.
|
||||
|
||||
.DESCRIPTION
|
||||
This function retrieves permissions for a specified GPO based on various criteria such as GPO name, GUID, principal, permission type, etc.
|
||||
|
||||
.PARAMETER GPOName
|
||||
Specifies the name of the GPO to retrieve permissions for.
|
||||
|
||||
.PARAMETER GPOGuid
|
||||
Specifies the GUID of the GPO to retrieve permissions for.
|
||||
|
||||
.PARAMETER Principal
|
||||
Specifies the principal for which permissions are to be retrieved.
|
||||
|
||||
.PARAMETER PrincipalType
|
||||
Specifies the type of principal to be used for permission retrieval. Valid values are 'DistinguishedName', 'Name', 'NetbiosName', 'Sid'.
|
||||
|
||||
.PARAMETER Type
|
||||
Specifies the type of permissions to include. Valid values are 'AuthenticatedUsers', 'DomainComputers', 'Unknown', 'WellKnownAdministrative', 'NotWellKnown', 'NotWellKnownAdministrative', 'NotAdministrative', 'Administrative', 'All'.
|
||||
|
||||
.PARAMETER SkipWellKnown
|
||||
Skips well-known permissions when retrieving permissions.
|
||||
|
||||
.PARAMETER SkipAdministrative
|
||||
Skips administrative permissions when retrieving permissions.
|
||||
|
||||
.PARAMETER IncludeOwner
|
||||
Includes the owner of the GPO in the permission retrieval.
|
||||
|
||||
.PARAMETER IncludePermissionType
|
||||
Specifies the permission types to include in the retrieval.
|
||||
|
||||
.PARAMETER ExcludePermissionType
|
||||
Specifies the permission types to exclude from the retrieval.
|
||||
|
||||
.PARAMETER PermitType
|
||||
Specifies the type of permissions to permit. Valid values are 'Allow', 'Deny', 'All'.
|
||||
|
||||
.PARAMETER ExcludePrincipal
|
||||
Specifies principals to exclude from the permission retrieval.
|
||||
|
||||
.PARAMETER ExcludePrincipalType
|
||||
Specifies the type of principal to exclude. Valid values are 'DistinguishedName', 'Name', 'Sid'.
|
||||
|
||||
.PARAMETER IncludeGPOObject
|
||||
Includes the GPO object in the permission retrieval.
|
||||
|
||||
.PARAMETER Forest
|
||||
Specifies the forest to retrieve permissions from.
|
||||
|
||||
.PARAMETER ExcludeDomains
|
||||
Specifies domains to exclude from permission retrieval.
|
||||
|
||||
.PARAMETER IncludeDomains
|
||||
Specifies domains to include in permission retrieval.
|
||||
|
||||
.PARAMETER ExtendedForestInformation
|
||||
Specifies additional forest information to include in the retrieval.
|
||||
|
||||
.PARAMETER ADAdministrativeGroups
|
||||
Specifies the administrative groups to include in the retrieval.
|
||||
|
||||
.PARAMETER ReturnSecurityWhenNoData
|
||||
If no data is found, returns all data.
|
||||
|
||||
.PARAMETER ReturnSingleObject
|
||||
Forces the return of a single object per GPO for processing.
|
||||
|
||||
.EXAMPLE
|
||||
Get-GPOZaurrPermission -GPOName "TestGPO" -Principal "Domain Admins" -PermitType "Allow"
|
||||
Retrieves permissions for the GPO named "TestGPO" for the principal "Domain Admins" with permission type "Allow".
|
||||
|
||||
.EXAMPLE
|
||||
Get-GPOZaurrPermission -GPOGuid "12345678-1234-1234-1234-1234567890AB" -Type "Administrative" -PermitType "Deny"
|
||||
Retrieves administrative permissions for the GPO with GUID "12345678-1234-1234-1234-1234567890AB" with permission type "Deny".
|
||||
#>
|
||||
[cmdletBinding(DefaultParameterSetName = 'GPO' )]
|
||||
param(
|
||||
[Parameter(ParameterSetName = 'GPOName')]
|
||||
|
||||
@@ -1,4 +1,28 @@
|
||||
function Get-GPOZaurrPermissionAnalysis {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Analyzes permissions for Group Policy Objects (GPOs) and administrative groups.
|
||||
|
||||
.DESCRIPTION
|
||||
This function analyzes permissions for Group Policy Objects (GPOs) and identifies administrative groups with specific permissions.
|
||||
|
||||
.PARAMETER Forest
|
||||
Specifies the name of the forest to analyze.
|
||||
|
||||
.PARAMETER ExcludeDomains
|
||||
Specifies an array of domains to exclude from the analysis.
|
||||
|
||||
.PARAMETER IncludeDomains
|
||||
Specifies an array of domains to include in the analysis.
|
||||
|
||||
.PARAMETER Permissions
|
||||
Specifies an array of permissions to analyze.
|
||||
|
||||
.EXAMPLE
|
||||
Get-GPOZaurrPermissionAnalysis -Forest "ContosoForest" -IncludeDomains @("Domain1", "Domain2") -ExcludeDomains @("Domain3") -Permissions $PermissionsArray
|
||||
Analyzes permissions for GPOs in the "ContosoForest" forest, including "Domain1" and "Domain2" while excluding "Domain3", using the specified permissions array.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[alias('ForestName')][string] $Forest,
|
||||
|
||||
@@ -1,4 +1,47 @@
|
||||
function Get-GPOZaurrPermissionConsistency {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Retrieves information about Group Policy Objects (GPOs) and checks permission consistency across domains.
|
||||
|
||||
.DESCRIPTION
|
||||
The Get-GPOZaurrPermissionConsistency function retrieves information about GPOs and checks permission consistency across domains. It can filter by GPO name, GPO GUID, or type of consistency. It also provides options to include/exclude specific domains and verify inheritance.
|
||||
|
||||
.PARAMETER GPOName
|
||||
Specifies the name of the GPO to retrieve.
|
||||
|
||||
.PARAMETER GPOGuid
|
||||
Specifies the GUID of the GPO to retrieve.
|
||||
|
||||
.PARAMETER Type
|
||||
Specifies the type of consistency to check. Valid values are 'Consistent', 'Inconsistent', or 'All'.
|
||||
|
||||
.PARAMETER Forest
|
||||
Specifies the forest name to retrieve GPO information from.
|
||||
|
||||
.PARAMETER ExcludeDomains
|
||||
Specifies an array of domains to exclude from the search.
|
||||
|
||||
.PARAMETER IncludeDomains
|
||||
Specifies an array of domains to include in the search.
|
||||
|
||||
.PARAMETER ExtendedForestInformation
|
||||
Specifies additional information about the forest.
|
||||
|
||||
.PARAMETER IncludeGPOObject
|
||||
Indicates whether to include the GPO object in the output.
|
||||
|
||||
.PARAMETER VerifyInheritance
|
||||
Indicates whether to verify inheritance of permissions.
|
||||
|
||||
.EXAMPLE
|
||||
Get-GPOZaurrPermissionConsistency -GPOName "TestGPO" -Forest "Contoso" -IncludeDomains @("DomainA", "DomainB") -Type "Consistent"
|
||||
Retrieves permission consistency information for the GPO named "TestGPO" in the forest "Contoso" for domains "DomainA" and "DomainB" with consistent permissions.
|
||||
|
||||
.EXAMPLE
|
||||
Get-GPOZaurrPermissionConsistency -GPOGuid "12345678-1234-1234-1234-1234567890AB" -Forest "Fabrikam" -Type "Inconsistent" -VerifyInheritance
|
||||
Retrieves permission consistency information for the GPO with GUID "12345678-1234-1234-1234-1234567890AB" in the forest "Fabrikam" for all domains with inconsistent permissions and verifies inheritance.
|
||||
|
||||
#>
|
||||
[cmdletBinding(DefaultParameterSetName = 'Type')]
|
||||
param(
|
||||
[Parameter(ParameterSetName = 'GPOName')][string] $GPOName,
|
||||
|
||||
@@ -1,4 +1,41 @@
|
||||
function Get-GPOZaurrPermissionRoot {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Retrieves the root permissions of Group Policy Objects (GPOs) based on specified criteria.
|
||||
|
||||
.DESCRIPTION
|
||||
Retrieves the root permissions of GPOs based on the specified criteria, including filtering by permission types, forest, domains, and more.
|
||||
|
||||
.PARAMETER IncludePermissionType
|
||||
Specifies the root permission types to include in the search.
|
||||
|
||||
.PARAMETER ExcludePermissionType
|
||||
Specifies the root permission types to exclude from the search.
|
||||
|
||||
.PARAMETER Forest
|
||||
Specifies the target forest. By default, the current forest is used.
|
||||
|
||||
.PARAMETER ExcludeDomains
|
||||
Specifies domains to exclude from the search.
|
||||
|
||||
.PARAMETER IncludeDomains
|
||||
Specifies domains to include in the search.
|
||||
|
||||
.PARAMETER ExtendedForestInformation
|
||||
Provides additional forest information to speed up processing.
|
||||
|
||||
.PARAMETER SkipNames
|
||||
Skips processing names during the operation.
|
||||
|
||||
.EXAMPLE
|
||||
Get-GPOZaurrPermissionRoot -IncludePermissionType 'GpoRootCreate' -ExcludePermissionType 'GpoRootOwner' -Forest 'ExampleForest' -IncludeDomains 'Domain1', 'Domain2' -ExtendedForestInformation $ForestInfo -SkipNames
|
||||
|
||||
.EXAMPLE
|
||||
Get-GPOZaurrPermissionRoot -IncludePermissionType 'GpoRootOwner' -ExcludePermissionType 'GpoRootCreate' -Forest 'AnotherForest' -ExcludeDomains 'Domain3' -SkipNames
|
||||
|
||||
.NOTES
|
||||
General notes
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[ValidateSet('GpoRootCreate', 'GpoRootOwner')][string[]] $IncludePermissionType,
|
||||
|
||||
@@ -1,4 +1,47 @@
|
||||
function Get-GPOZaurrPermissionSummary {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Retrieves a summary of Group Policy Object (GPO) permissions based on specified criteria.
|
||||
|
||||
.DESCRIPTION
|
||||
Retrieves a summary of GPO permissions based on the specified criteria, including filtering by permission types, permit types, and more.
|
||||
|
||||
.PARAMETER Type
|
||||
Specifies the type of permissions to include. Options include 'AuthenticatedUsers', 'DomainComputers', 'Unknown', 'WellKnownAdministrative', 'NotWellKnown', 'NotWellKnownAdministrative', 'NotAdministrative', 'Administrative', and 'All'.
|
||||
|
||||
.PARAMETER PermitType
|
||||
Specifies the type of permission to permit. Options include 'Allow', 'Deny', and 'All'.
|
||||
|
||||
.PARAMETER IncludePermissionType
|
||||
Specifies the permission types to include in the summary.
|
||||
|
||||
.PARAMETER ExcludePermissionType
|
||||
Specifies the permission types to exclude from the summary.
|
||||
|
||||
.PARAMETER Forest
|
||||
Specifies the target forest. By default, the current forest is used.
|
||||
|
||||
.PARAMETER ExcludeDomains
|
||||
Specifies domains to exclude from the search.
|
||||
|
||||
.PARAMETER IncludeDomains
|
||||
Specifies domains to include in the search.
|
||||
|
||||
.PARAMETER ExtendedForestInformation
|
||||
Provides additional forest information to speed up processing.
|
||||
|
||||
.PARAMETER Separator
|
||||
Specifies the separator to use in the output.
|
||||
|
||||
.EXAMPLE
|
||||
Get-GPOZaurrPermissionSummary -Type 'All' -PermitType 'Allow' -IncludePermissionType 'GpoApply', 'GpoEdit' -ExcludePermissionType 'GpoOwner' -Forest 'ExampleForest' -IncludeDomains 'Domain1', 'Domain2' -ExtendedForestInformation $ForestInfo -Separator '|'
|
||||
|
||||
.EXAMPLE
|
||||
Get-GPOZaurrPermissionSummary -Type 'Administrative' -PermitType 'All' -IncludePermissionType 'GpoRead' -ExcludePermissionType 'GpoRootOwner' -Forest 'AnotherForest' -ExcludeDomains 'Domain3' -Separator ','
|
||||
|
||||
.NOTES
|
||||
General notes
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[validateSet('AuthenticatedUsers', 'DomainComputers', 'Unknown', 'WellKnownAdministrative', 'NotWellKnown', 'NotWellKnownAdministrative', 'NotAdministrative', 'Administrative', 'All')][string[]] $Type = 'All',
|
||||
|
||||
@@ -1,4 +1,23 @@
|
||||
function Get-GPOZaurrDictionary {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Retrieves a dictionary of Group Policy Objects (GPOs) with their associated types and paths.
|
||||
|
||||
.DESCRIPTION
|
||||
This function retrieves a dictionary of Group Policy Objects (GPOs) along with their associated types and paths. It iterates through the GPOs stored in the $Script:GPODitionary variable and constructs a custom object for each GPO containing its name, types, and path.
|
||||
|
||||
.PARAMETER Splitter
|
||||
Specifies the delimiter used to separate multiple types or paths. Default value is [System.Environment]::NewLine.
|
||||
|
||||
.EXAMPLE
|
||||
Get-GPOZaurrDictionary
|
||||
Retrieves the dictionary of GPOs with their types and paths using the default newline delimiter.
|
||||
|
||||
.EXAMPLE
|
||||
Get-GPOZaurrDictionary -Splitter ","
|
||||
Retrieves the dictionary of GPOs with their types and paths using a comma as the delimiter.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[string] $Splitter = [System.Environment]::NewLine
|
||||
|
||||
@@ -1,4 +1,65 @@
|
||||
function Invoke-GPOZaurrContent {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Invokes GPOZaurrContent function to retrieve Group Policy Objects information.
|
||||
|
||||
.DESCRIPTION
|
||||
This function retrieves Group Policy Objects information based on the specified parameters. It can search for GPOs in a forest, exclude specific domains, include specific domains, and provide extended forest information.
|
||||
|
||||
.PARAMETER Forest
|
||||
Specifies the forest name to search for Group Policy Objects.
|
||||
|
||||
.PARAMETER ExcludeDomains
|
||||
Specifies an array of domains to exclude from the search.
|
||||
|
||||
.PARAMETER IncludeDomains
|
||||
Specifies an array of domains to include in the search.
|
||||
|
||||
.PARAMETER ExtendedForestInformation
|
||||
Specifies additional information about the forest.
|
||||
|
||||
.PARAMETER GPOPath
|
||||
Specifies the path to a specific Group Policy Object.
|
||||
|
||||
.PARAMETER Type
|
||||
Specifies the type of information to retrieve.
|
||||
|
||||
.PARAMETER Splitter
|
||||
Specifies the delimiter to use for splitting information.
|
||||
|
||||
.PARAMETER FullObjects
|
||||
Indicates whether to retrieve full objects.
|
||||
|
||||
.PARAMETER OutputType
|
||||
Specifies the type of output (HTML or Object).
|
||||
|
||||
.PARAMETER OutputPath
|
||||
Specifies the path to save the output.
|
||||
|
||||
.PARAMETER Open
|
||||
Indicates whether to open the output after retrieval.
|
||||
|
||||
.PARAMETER Online
|
||||
Indicates whether to retrieve information online.
|
||||
|
||||
.PARAMETER CategoriesOnly
|
||||
Indicates whether to retrieve only categories.
|
||||
|
||||
.PARAMETER SingleObject
|
||||
Indicates whether to retrieve a single object.
|
||||
|
||||
.PARAMETER SkipNormalize
|
||||
Indicates whether to skip normalization.
|
||||
|
||||
.EXAMPLE
|
||||
Invoke-GPOZaurrContent -Forest "Contoso" -IncludeDomains "Domain1", "Domain2" -Type "Security" -OutputType "HTML" -OutputPath "C:\Reports\GPOReport.html"
|
||||
Retrieves security-related Group Policy Objects information for the specified domains and saves the output as an HTML file.
|
||||
|
||||
.EXAMPLE
|
||||
Invoke-GPOZaurrContent -GPOPath "CN={31B2F340-016D-11D2-945F-00C04FB984F9},CN=Policies,CN=System,DC=Contoso,DC=com" -Type "All" -OutputType "Object"
|
||||
Retrieves all information for a specific Group Policy Object and outputs the result as an object.
|
||||
|
||||
#>
|
||||
[alias('Find-GPO')]
|
||||
[cmdletBinding(DefaultParameterSetName = 'Default')]
|
||||
param(
|
||||
|
||||
@@ -1,4 +1,60 @@
|
||||
function Invoke-GPOZaurrPermission {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Sets permissions on Group Policy Objects (GPOs) based on specified criteria.
|
||||
|
||||
.DESCRIPTION
|
||||
The Invoke-GPOZaurrPermission function sets permissions on GPOs based on various criteria such as GPO name, GPO GUID, AD objects, linked objects, permission levels, and more.
|
||||
|
||||
.PARAMETER PermissionRules
|
||||
Specifies the permission rules to apply to the GPOs. This can be a script block containing the permission rules.
|
||||
|
||||
.PARAMETER GPOName
|
||||
Specifies the name of the GPO to set permissions for.
|
||||
|
||||
.PARAMETER GPOGuid
|
||||
Specifies the GUID of the GPO to set permissions for.
|
||||
|
||||
.PARAMETER Level
|
||||
Specifies the permission level to set. This is a mandatory parameter.
|
||||
|
||||
.PARAMETER Limit
|
||||
Specifies the limit for the permission level. This is a mandatory parameter.
|
||||
|
||||
.PARAMETER Linked
|
||||
Specifies the type of linked object to set permissions for. Valid values are 'Root', 'DomainControllers', 'Site', 'OrganizationalUnit'.
|
||||
|
||||
.PARAMETER ADObject
|
||||
Specifies the Active Directory objects to set permissions for. This parameter accepts input from the pipeline and by property name.
|
||||
|
||||
.PARAMETER Filter
|
||||
Specifies the filter to apply when selecting objects. Default filter is "(objectClass -eq 'organizationalUnit' -or objectClass -eq 'domainDNS' -or objectClass -eq 'site')".
|
||||
|
||||
.PARAMETER SearchBase
|
||||
Specifies the search base for filtering objects.
|
||||
|
||||
.PARAMETER SearchScope
|
||||
Specifies the search scope for filtering objects.
|
||||
|
||||
.PARAMETER Type
|
||||
Specifies the type of permissions to set. Valid values are 'Unknown', 'NotWellKnown', 'NotWellKnownAdministrative', 'NotAdministrative', 'All'.
|
||||
|
||||
.PARAMETER ApprovedGroups
|
||||
Specifies the approved groups for setting permissions.
|
||||
|
||||
.EXAMPLE
|
||||
Invoke-GPOZaurrPermission -GPOName "TestGPO" -PermissionRules { New-GPOPermission -Group "Domain Admins" -AccessLevel FullControl }
|
||||
|
||||
Description:
|
||||
Sets FullControl permission for the "Domain Admins" group on the GPO named "TestGPO".
|
||||
|
||||
.EXAMPLE
|
||||
Get-GPO -All | Invoke-GPOZaurrPermission -PermissionRules { New-GPOPermission -Group "Help Desk" -AccessLevel Read } -Type "NotAdministrative"
|
||||
|
||||
Description:
|
||||
Sets Read permission for the "Help Desk" group on all GPOs except administrative ones.
|
||||
|
||||
#>
|
||||
[cmdletBinding(SupportsShouldProcess)]
|
||||
param(
|
||||
[Parameter(ParameterSetName = 'GPOGUID')]
|
||||
|
||||
@@ -1,4 +1,41 @@
|
||||
function Invoke-GPOZaurrSupport {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Invokes GPOZaurrSupport function to retrieve Group Policy information.
|
||||
|
||||
.DESCRIPTION
|
||||
This function retrieves Group Policy information using either HTML, XML, or Object format. It can be run locally or on a remote computer.
|
||||
|
||||
.PARAMETER Type
|
||||
Specifies the type of output format. Valid values are 'NativeHTML', 'HTML', 'XML', or 'Object'. Default is 'HTML'.
|
||||
|
||||
.PARAMETER ComputerName
|
||||
Specifies the name of the remote computer to retrieve Group Policy information from.
|
||||
|
||||
.PARAMETER UserName
|
||||
Specifies the username to run the function as on the remote computer.
|
||||
|
||||
.PARAMETER Path
|
||||
Specifies the path to save the output file. If not provided, a temporary file will be created.
|
||||
|
||||
.PARAMETER Splitter
|
||||
Specifies the delimiter for splitting output data. Default is a new line.
|
||||
|
||||
.PARAMETER PreventShow
|
||||
Prevents displaying the output in the console.
|
||||
|
||||
.PARAMETER Online
|
||||
Runs the function online to retrieve the latest Group Policy information.
|
||||
|
||||
.EXAMPLE
|
||||
Invoke-GPOZaurrSupport -Type HTML -ComputerName "RemoteComputer" -UserName "Admin" -Path "C:\Temp\GPOReport.html"
|
||||
Retrieves Group Policy information in HTML format from a remote computer and saves it to a specified path.
|
||||
|
||||
.EXAMPLE
|
||||
Invoke-GPOZaurrSupport -Type XML -Path "C:\Temp\GPOReport.xml" -Online
|
||||
Retrieves the latest Group Policy information in XML format and saves it to a specified path.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[ValidateSet('NativeHTML', 'HTML', 'XML', 'Object')][string] $Type = 'HTML',
|
||||
|
||||
@@ -1,4 +1,50 @@
|
||||
function New-GPOZaurrWMI {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Creates a new Group Policy Object (GPO) based on a WMI filter query.
|
||||
|
||||
.DESCRIPTION
|
||||
This function creates a new GPO in Active Directory based on a specified WMI filter query. It allows for customization of the GPO creation process by providing options to target specific forests, domains, and extended forest information.
|
||||
|
||||
.PARAMETER Name
|
||||
The name of the new GPO to be created.
|
||||
|
||||
.PARAMETER Description
|
||||
The description for the new GPO. Default is an empty string.
|
||||
|
||||
.PARAMETER Namespace
|
||||
The WMI namespace to target. Default is 'root\CIMv2'.
|
||||
|
||||
.PARAMETER Query
|
||||
The WMI filter query to be applied to the GPO.
|
||||
|
||||
.PARAMETER SkipQueryCheck
|
||||
Switch to skip the query check before creating the GPO.
|
||||
|
||||
.PARAMETER Force
|
||||
Switch to force the creation of the GPO without confirmation.
|
||||
|
||||
.PARAMETER Forest
|
||||
The forest to target for GPO creation.
|
||||
|
||||
.PARAMETER ExcludeDomains
|
||||
An array of domains to exclude from GPO application.
|
||||
|
||||
.PARAMETER IncludeDomains
|
||||
An array of domains to include for GPO application.
|
||||
|
||||
.PARAMETER ExtendedForestInformation
|
||||
Additional information about the forest for GPO customization.
|
||||
|
||||
.EXAMPLE
|
||||
New-GPOZaurrWMI -Name "TestGPO" -Query "SELECT * FROM Win32_OperatingSystem" -Force
|
||||
Creates a new GPO named "TestGPO" with a WMI filter query targeting all Windows operating systems.
|
||||
|
||||
.EXAMPLE
|
||||
New-GPOZaurrWMI -Name "FinanceGPO" -Query "SELECT * FROM Win32_Processor" -Forest "Contoso" -IncludeDomains "FinanceDomain"
|
||||
Creates a new GPO named "FinanceGPO" with a WMI filter query targeting all processors in the "FinanceDomain" within the "Contoso" forest.
|
||||
|
||||
#>
|
||||
[cmdletBinding(SupportsShouldProcess)]
|
||||
param(
|
||||
[parameter(Mandatory)][string] $Name,
|
||||
|
||||
@@ -1,4 +1,44 @@
|
||||
function Remove-GPOPermission {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Removes permissions from a Group Policy Object (GPO).
|
||||
|
||||
.DESCRIPTION
|
||||
This function removes specified permissions from a GPO based on the provided criteria.
|
||||
|
||||
.PARAMETER Type
|
||||
Specifies the type of permissions to remove. Valid values are 'Unknown', 'NotWellKnown', 'NotWellKnownAdministrative', 'Administrative', 'NotAdministrative', and 'All'.
|
||||
|
||||
.PARAMETER IncludePermissionType
|
||||
Specifies the permission types to include in the removal process.
|
||||
|
||||
.PARAMETER ExcludePermissionType
|
||||
Specifies the permission types to exclude from the removal process.
|
||||
|
||||
.PARAMETER PermitType
|
||||
Specifies whether to allow or deny the specified permissions. Valid values are 'Allow', 'Deny', and 'All'.
|
||||
|
||||
.PARAMETER Principal
|
||||
Specifies the principal(s) for which permissions should be removed.
|
||||
|
||||
.PARAMETER PrincipalType
|
||||
Specifies the type of principal(s) provided. Valid values are 'DistinguishedName', 'Name', and 'Sid'.
|
||||
|
||||
.PARAMETER ExcludePrincipal
|
||||
Specifies the principal(s) for which permissions should be excluded from removal.
|
||||
|
||||
.PARAMETER ExcludePrincipalType
|
||||
Specifies the type of principal(s) to exclude. Valid values are 'DistinguishedName', 'Name', and 'Sid'.
|
||||
|
||||
.EXAMPLE
|
||||
Remove-GPOPermission -Type 'Administrative' -PermitType 'Deny' -Principal 'S-1-5-21-3623811015-3361044348-30300820-1013' -PrincipalType 'Sid'
|
||||
Removes administrative permissions denied for a specific SID from the GPO.
|
||||
|
||||
.EXAMPLE
|
||||
Remove-GPOPermission -Type 'All' -PermitType 'Allow' -Principal 'CN=John Doe,OU=Users,DC=contoso,DC=com' -PrincipalType 'DistinguishedName' -ExcludePrincipal 'S-1-5-21-3623811015-3361044348-30300820-1013' -ExcludePrincipalType 'Sid'
|
||||
Removes all permissions allowed for a specific distinguished name while excluding permissions for a specific SID from the GPO.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[validateSet('Unknown', 'NotWellKnown', 'NotWellKnownAdministrative', 'Administrative', 'NotAdministrative', 'All')][string[]] $Type,
|
||||
|
||||
@@ -1,4 +1,53 @@
|
||||
function Remove-GPOZaurr {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Removes Group Policy Objects based on specified criteria.
|
||||
|
||||
.DESCRIPTION
|
||||
The Remove-GPOZaurr function removes Group Policy Objects (GPOs) based on the specified criteria. It allows for filtering by various parameters such as GPO type, forest, domains, and more.
|
||||
|
||||
.PARAMETER ExcludeGroupPolicies
|
||||
Specifies the Group Policies to exclude from removal.
|
||||
|
||||
.PARAMETER Type
|
||||
Specifies the type of GPOs to target for removal. Valid values are 'Empty', 'Unlinked', 'Disabled', 'NoApplyPermission'.
|
||||
|
||||
.PARAMETER LimitProcessing
|
||||
Specifies the maximum number of GPOs to process before stopping.
|
||||
|
||||
.PARAMETER Forest
|
||||
Specifies the forest to target for GPO removal.
|
||||
|
||||
.PARAMETER ExcludeDomains
|
||||
Specifies the domains to exclude from GPO removal.
|
||||
|
||||
.PARAMETER IncludeDomains
|
||||
Specifies the domains to include for GPO removal.
|
||||
|
||||
.PARAMETER ExtendedForestInformation
|
||||
Specifies additional information about the forest.
|
||||
|
||||
.PARAMETER GPOPath
|
||||
Specifies the path to the GPOs to be removed.
|
||||
|
||||
.PARAMETER BackupPath
|
||||
Specifies the path for backing up GPOs before removal.
|
||||
|
||||
.PARAMETER BackupDated
|
||||
Indicates whether the backup should be dated.
|
||||
|
||||
.PARAMETER RequireDays
|
||||
Specifies the number of days before GPO removal is required.
|
||||
|
||||
.EXAMPLE
|
||||
Remove-GPOZaurr -Type 'Empty' -Forest 'Contoso' -IncludeDomains 'Domain1', 'Domain2' -BackupPath 'C:\GPOBackups' -BackupDated -RequireDays 7
|
||||
Removes all empty GPOs from the 'Contoso' forest for 'Domain1' and 'Domain2', backs them up to 'C:\GPOBackups' with dated folders, and requires removal after 7 days.
|
||||
|
||||
.EXAMPLE
|
||||
Remove-GPOZaurr -Type 'Disabled' -Forest 'Fabrikam' -ExcludeDomains 'Domain3' -LimitProcessing 10
|
||||
Removes all disabled GPOs from the 'Fabrikam' forest excluding 'Domain3' and processes only the first 10 GPOs.
|
||||
|
||||
#>
|
||||
[cmdletBinding(SupportsShouldProcess)]
|
||||
param(
|
||||
[Parameter(Position = 1)][scriptblock] $ExcludeGroupPolicies,
|
||||
|
||||
@@ -1,4 +1,33 @@
|
||||
function Remove-GPOZaurrDuplicateObject {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Removes duplicate Group Policy Objects (GPOs) identified by the Get-GPOZaurrDuplicateObject function.
|
||||
|
||||
.DESCRIPTION
|
||||
This function removes duplicate GPOs based on the criteria provided. It retrieves duplicate GPO objects using Get-GPOZaurrDuplicateObject and then attempts to remove them from the Active Directory.
|
||||
|
||||
.PARAMETER LimitProcessing
|
||||
Specifies the maximum number of duplicate GPOs to process. Default is set to [int32]::MaxValue.
|
||||
|
||||
.PARAMETER Forest
|
||||
Specifies the forest where the duplicate GPOs are located.
|
||||
|
||||
.PARAMETER ExcludeDomains
|
||||
Specifies an array of domains to exclude from the duplicate GPO removal process.
|
||||
|
||||
.PARAMETER IncludeDomains
|
||||
Specifies an array of domains to include in the duplicate GPO removal process.
|
||||
|
||||
.PARAMETER ExtendedForestInformation
|
||||
Specifies additional information about the forest.
|
||||
|
||||
.EXAMPLE
|
||||
Remove-GPOZaurrDuplicateObject -Forest "contoso.com" -IncludeDomains "domain1.com", "domain2.com" -ExcludeDomains "domain3.com" -LimitProcessing 5
|
||||
|
||||
Description:
|
||||
Removes duplicate GPOs from the forest "contoso.com" for domains "domain1.com" and "domain2.com", excluding "domain3.com", processing only the first 5 duplicates.
|
||||
|
||||
#>
|
||||
[cmdletBinding(SupportsShouldProcess)]
|
||||
param(
|
||||
[int] $LimitProcessing = [int32]::MaxValue,
|
||||
|
||||
@@ -1,4 +1,46 @@
|
||||
function Remove-GPOZaurrFolders {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Removes specified GPOZaurr folders and backs them up to a specified path.
|
||||
|
||||
.DESCRIPTION
|
||||
This function removes specified GPOZaurr folders based on the provided criteria and backs them up to a specified path. It allows for filtering by folder type, domain, and other parameters.
|
||||
|
||||
.PARAMETER BackupPath
|
||||
The path where the GPOZaurr folders will be backed up.
|
||||
|
||||
.PARAMETER BackupDated
|
||||
Indicates whether the backup path should include a timestamp.
|
||||
|
||||
.PARAMETER Type
|
||||
Specifies the type of folders to remove. Options are 'All', 'Netlogon', or 'Sysvol'.
|
||||
|
||||
.PARAMETER FolderType
|
||||
Specifies the type of folders to remove. Options are 'NTFRS' or 'Empty'.
|
||||
|
||||
.PARAMETER FolderName
|
||||
Specifies the name of the folder to remove.
|
||||
|
||||
.PARAMETER LimitProcessing
|
||||
Limits the number of folders to process.
|
||||
|
||||
.PARAMETER Forest
|
||||
Specifies the forest to target.
|
||||
|
||||
.PARAMETER ExcludeDomains
|
||||
Specifies domains to exclude from processing.
|
||||
|
||||
.PARAMETER IncludeDomains
|
||||
Specifies domains to include in processing.
|
||||
|
||||
.PARAMETER ExtendedForestInformation
|
||||
Specifies additional forest information.
|
||||
|
||||
.EXAMPLE
|
||||
Remove-GPOZaurrFolders -BackupPath "C:\Backups" -BackupDated -Type 'All' -FolderType 'NTFRS' -FolderName "Folder1" -LimitProcessing 10 -Forest "ExampleForest" -ExcludeDomains "Domain1" -IncludeDomains "Domain2" -ExtendedForestInformation $info
|
||||
Removes GPOZaurr folders of type 'NTFRS' named "Folder1" from all domains in the forest "ExampleForest", backs them up to "C:\Backups" with a timestamp, and limits processing to 10 folders.
|
||||
|
||||
#>
|
||||
[cmdletBinding(SupportsShouldProcess)]
|
||||
param(
|
||||
[string] $BackupPath,
|
||||
|
||||
@@ -1,4 +1,37 @@
|
||||
function Remove-GPOZaurrLegacyFiles {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Removes legacy Group Policy Objects (GPO) files from specified domains.
|
||||
|
||||
.DESCRIPTION
|
||||
The Remove-GPOZaurrLegacyFiles function removes legacy GPO files from specified domains. It can back up the files before removal and optionally remove empty folders.
|
||||
|
||||
.PARAMETER BackupPath
|
||||
Specifies the path where backup files will be stored.
|
||||
|
||||
.PARAMETER BackupDated
|
||||
Indicates whether backup files should be timestamped with the current date and time.
|
||||
|
||||
.PARAMETER RemoveEmptyFolders
|
||||
Indicates whether empty folders should be removed after GPO files are deleted.
|
||||
|
||||
.PARAMETER Forest
|
||||
Specifies the forest where the GPO files are located.
|
||||
|
||||
.PARAMETER ExcludeDomains
|
||||
Specifies an array of domains to exclude from processing.
|
||||
|
||||
.PARAMETER IncludeDomains
|
||||
Specifies an array of domains to include for processing.
|
||||
|
||||
.PARAMETER LimitProcessing
|
||||
Specifies the maximum number of GPO files to process.
|
||||
|
||||
.EXAMPLE
|
||||
Remove-GPOZaurrLegacyFiles -BackupPath "C:\GPOBackups" -BackupDated -RemoveEmptyFolders -Forest "Contoso" -IncludeDomains "Domain1", "Domain2" -ExcludeDomains "Domain3" -LimitProcessing 100
|
||||
Removes legacy GPO files from the "Contoso" forest for "Domain1" and "Domain2", excluding "Domain3". Backs up files to "C:\GPOBackups" with timestamps and removes empty folders after deletion.
|
||||
|
||||
#>
|
||||
[cmdletBinding(SupportsShouldProcess)]
|
||||
param(
|
||||
[string] $BackupPath,
|
||||
|
||||
@@ -1,4 +1,34 @@
|
||||
function Remove-GPOZaurrLinkEmptyOU {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Removes Group Policy Object (GPO) links from empty Organizational Units (OUs) in a specified forest.
|
||||
|
||||
.DESCRIPTION
|
||||
This function removes GPO links from OUs that are empty and meet specified criteria. It processes OUs within the specified forest based on inclusion and exclusion rules.
|
||||
|
||||
.PARAMETER Forest
|
||||
Specifies the name of the forest to target for processing.
|
||||
|
||||
.PARAMETER ExcludeDomains
|
||||
Specifies an array of domains to exclude from processing.
|
||||
|
||||
.PARAMETER IncludeDomains
|
||||
Specifies an array of domains to include for processing.
|
||||
|
||||
.PARAMETER ExtendedForestInformation
|
||||
Specifies additional information about the forest.
|
||||
|
||||
.PARAMETER ExcludeOrganizationalUnit
|
||||
Specifies an array of OUs to exclude from processing.
|
||||
|
||||
.PARAMETER LimitProcessing
|
||||
Specifies the maximum number of OUs to process.
|
||||
|
||||
.EXAMPLE
|
||||
Remove-GPOZaurrLinkEmptyOU -Forest "ContosoForest" -IncludeDomains @("domain1", "domain2") -ExcludeDomains @("domain3") -ExtendedForestInformation $info -ExcludeOrganizationalUnit @("OU=TestOU,DC=contoso,DC=com") -LimitProcessing 100
|
||||
Removes GPO links from empty OUs in the "ContosoForest" forest, including domains "domain1" and "domain2" but excluding "domain3". Additional forest information is provided, and processing is limited to 100 OUs.
|
||||
|
||||
#>
|
||||
[cmdletbinding(SupportsShouldProcess)]
|
||||
param(
|
||||
[alias('ForestName')][string] $Forest,
|
||||
|
||||
@@ -1,4 +1,62 @@
|
||||
function Remove-GPOZaurrPermission {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Removes permissions from a Group Policy Object (GPO) for specified principals.
|
||||
|
||||
.DESCRIPTION
|
||||
The Remove-GPOZaurrPermission function removes permissions from a specified GPO for the specified principals. It allows for fine-grained control over the removal of permissions based on various parameters.
|
||||
|
||||
.PARAMETER GPOName
|
||||
Specifies the name of the GPO from which permissions will be removed.
|
||||
|
||||
.PARAMETER GPOGuid
|
||||
Specifies the GUID of the GPO from which permissions will be removed.
|
||||
|
||||
.PARAMETER Principal
|
||||
Specifies the principal(s) for which permissions will be removed.
|
||||
|
||||
.PARAMETER PrincipalType
|
||||
Specifies the type of principal(s) provided. Valid values are 'DistinguishedName', 'Name', 'NetbiosName', or 'Sid'.
|
||||
|
||||
.PARAMETER Type
|
||||
Specifies the type of permissions to remove. Valid values are 'Unknown', 'NotAdministrative', or 'Default'.
|
||||
|
||||
.PARAMETER IncludePermissionType
|
||||
Specifies the permission types to include in the removal process.
|
||||
|
||||
.PARAMETER ExcludePermissionType
|
||||
Specifies the permission types to exclude from the removal process.
|
||||
|
||||
.PARAMETER SkipWellKnown
|
||||
Skips well-known permissions during the removal process.
|
||||
|
||||
.PARAMETER SkipAdministrative
|
||||
Skips administrative permissions during the removal process.
|
||||
|
||||
.PARAMETER Forest
|
||||
Specifies the forest in which the GPO resides.
|
||||
|
||||
.PARAMETER ExcludeDomains
|
||||
Specifies the domains to exclude from the removal process.
|
||||
|
||||
.PARAMETER IncludeDomains
|
||||
Specifies the domains to include in the removal process.
|
||||
|
||||
.PARAMETER ExtendedForestInformation
|
||||
Specifies additional information about the forest.
|
||||
|
||||
.PARAMETER LimitProcessing
|
||||
Specifies the maximum number of permissions to process.
|
||||
|
||||
.EXAMPLE
|
||||
Remove-GPOZaurrPermission -GPOName "TestGPO" -Principal "User1" -PrincipalType "Name" -Type "Default" -Forest "Contoso" -IncludeDomains "Domain1", "Domain2"
|
||||
Removes default permissions for "User1" from the GPO named "TestGPO" in the "Contoso" forest for domains "Domain1" and "Domain2".
|
||||
|
||||
.EXAMPLE
|
||||
Remove-GPOZaurrPermission -GPOGuid "12345678-1234-1234-1234-1234567890AB" -Principal "Group1" -PrincipalType "Sid" -Type "Unknown" -Forest "Fabrikam" -ExcludeDomains "Domain3"
|
||||
Removes unknown permissions for "Group1" from the GPO with GUID "12345678-1234-1234-1234-1234567890AB" in the "Fabrikam" forest excluding "Domain3".
|
||||
|
||||
#>
|
||||
[cmdletBinding(SupportsShouldProcess, DefaultParameterSetName = 'Global')]
|
||||
param(
|
||||
[Parameter(ParameterSetName = 'GPOName', Mandatory)]
|
||||
|
||||
@@ -1,4 +1,44 @@
|
||||
function Remove-GPOZaurrWMI {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Removes Group Policy Objects (GPO) based on specified criteria.
|
||||
|
||||
.DESCRIPTION
|
||||
This function removes GPOs based on the provided GUIDs or names within the specified forest or domains. It retrieves WMI filters associated with the GPOs and removes them.
|
||||
|
||||
.PARAMETER Guid
|
||||
Specifies an array of GUIDs of the GPOs to be removed.
|
||||
|
||||
.PARAMETER Name
|
||||
Specifies an array of names of the GPOs to be removed.
|
||||
|
||||
.PARAMETER Forest
|
||||
Specifies the forest name where the GPOs are located.
|
||||
|
||||
.PARAMETER ExcludeDomains
|
||||
Specifies an array of domains to exclude from the removal process.
|
||||
|
||||
.PARAMETER IncludeDomains
|
||||
Specifies an array of domains to include in the removal process.
|
||||
|
||||
.PARAMETER ExtendedForestInformation
|
||||
Specifies additional information about the forest.
|
||||
|
||||
.EXAMPLE
|
||||
Remove-GPOZaurrWMI -Guid "12345678-1234-1234-1234-123456789012"
|
||||
|
||||
Description
|
||||
-----------
|
||||
Removes the GPO with the specified GUID.
|
||||
|
||||
.EXAMPLE
|
||||
Remove-GPOZaurrWMI -Name "TestGPO"
|
||||
|
||||
Description
|
||||
-----------
|
||||
Removes the GPO with the specified name.
|
||||
|
||||
#>
|
||||
[CmdletBinding(SupportsShouldProcess)]
|
||||
Param (
|
||||
[Guid[]] $Guid,
|
||||
|
||||
@@ -1,4 +1,34 @@
|
||||
function Repair-GPOZaurrPermission {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Repairs permissions for Group Policy Objects (GPOs) based on specified criteria.
|
||||
|
||||
.DESCRIPTION
|
||||
The Repair-GPOZaurrPermission function repairs permissions for GPOs based on the specified criteria. It analyzes the permissions of GPOs and adds necessary permissions if they are missing.
|
||||
|
||||
.PARAMETER Type
|
||||
Specifies the type of permissions to repair. Valid values are 'AuthenticatedUsers', 'Unknown', 'System', 'Administrative', and 'All'.
|
||||
|
||||
.PARAMETER Forest
|
||||
Specifies the forest name to analyze GPO permissions.
|
||||
|
||||
.PARAMETER ExcludeDomains
|
||||
Specifies an array of domains to exclude from the analysis.
|
||||
|
||||
.PARAMETER IncludeDomains
|
||||
Specifies an array of domains to include in the analysis.
|
||||
|
||||
.PARAMETER ExtendedForestInformation
|
||||
Specifies additional information about the forest.
|
||||
|
||||
.PARAMETER LimitProcessing
|
||||
Specifies the maximum number of GPOs to process.
|
||||
|
||||
.EXAMPLE
|
||||
Repair-GPOZaurrPermission -Type 'All' -Forest 'ContosoForest' -IncludeDomains @('Domain1', 'Domain2') -ExcludeDomains @('Domain3') -ExtendedForestInformation $info -LimitProcessing 100
|
||||
Repairs permissions for all types of users in the 'ContosoForest' forest, including only 'Domain1' and 'Domain2' while excluding 'Domain3', with extended forest information and processing a maximum of 100 GPOs.
|
||||
|
||||
#>
|
||||
[cmdletBinding(SupportsShouldProcess)]
|
||||
param(
|
||||
[Parameter(Mandatory)][ValidateSet('AuthenticatedUsers', 'Unknown', 'System', 'Administrative', 'All')][string[]] $Type,
|
||||
|
||||
@@ -1,4 +1,41 @@
|
||||
function Repair-GPOZaurrPermissionConsistency {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Repairs permission consistency for Group Policy Objects (GPOs) in a specified domain or forest.
|
||||
|
||||
.DESCRIPTION
|
||||
The Repair-GPOZaurrPermissionConsistency function repairs permission consistency for GPOs in a specified domain or forest. It checks for inconsistencies in GPO permissions and attempts to make them consistent.
|
||||
|
||||
.PARAMETER GPOName
|
||||
Specifies the name of the GPO to repair.
|
||||
|
||||
.PARAMETER GPOGuid
|
||||
Specifies the GUID of the GPO to repair.
|
||||
|
||||
.PARAMETER Forest
|
||||
Specifies the forest where the GPOs are located.
|
||||
|
||||
.PARAMETER ExcludeDomains
|
||||
Specifies an array of domains to exclude from the repair process.
|
||||
|
||||
.PARAMETER IncludeDomains
|
||||
Specifies an array of domains to include in the repair process.
|
||||
|
||||
.PARAMETER ExtendedForestInformation
|
||||
Specifies additional information about the forest.
|
||||
|
||||
.PARAMETER LimitProcessing
|
||||
Specifies the maximum number of GPOs to process.
|
||||
|
||||
.EXAMPLE
|
||||
Repair-GPOZaurrPermissionConsistency -GPOName "ExampleGPO" -Forest "example.com"
|
||||
Repairs permission consistency for the GPO named "ExampleGPO" in the "example.com" forest.
|
||||
|
||||
.EXAMPLE
|
||||
Repair-GPOZaurrPermissionConsistency -GPOGuid "12345678-1234-1234-1234-1234567890AB" -ExcludeDomains @("domain1", "domain2") -LimitProcessing 5
|
||||
Repairs permission consistency for the GPO with the specified GUID, excluding domains "domain1" and "domain2", and processing a maximum of 5 GPOs.
|
||||
|
||||
#>
|
||||
[cmdletBinding(SupportsShouldProcess, DefaultParameterSetName = 'Default')]
|
||||
param(
|
||||
[Parameter(ParameterSetName = 'GPOName')][string] $GPOName,
|
||||
|
||||
@@ -1,4 +1,35 @@
|
||||
function Restore-GPOZaurr {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Restores Group Policy Objects (GPOs) from a specified backup folder.
|
||||
|
||||
.DESCRIPTION
|
||||
Restores Group Policy Objects (GPOs) from a specified backup folder. This function allows restoring GPOs with the option to provide a new display name for the GPO.
|
||||
|
||||
.PARAMETER BackupFolder
|
||||
The path to the folder containing the GPO backups.
|
||||
|
||||
.PARAMETER DisplayName
|
||||
The display name of the GPO to be restored.
|
||||
|
||||
.PARAMETER NewDisplayName
|
||||
(Optional) The new display name for the restored GPO.
|
||||
|
||||
.PARAMETER Domain
|
||||
(Optional) The domain name where the GPO should be restored.
|
||||
|
||||
.PARAMETER SkipBackupSummary
|
||||
(Switch) Skip displaying the backup summary information.
|
||||
|
||||
.EXAMPLE
|
||||
Restore-GPOZaurr -BackupFolder 'C:\GPOBackups' -DisplayName 'TestGPO'
|
||||
|
||||
.EXAMPLE
|
||||
Restore-GPOZaurr -BackupFolder 'C:\GPOBackups' -DisplayName 'TestGPO' -NewDisplayName 'NewTestGPO' -Domain 'example.com'
|
||||
|
||||
.NOTES
|
||||
General notes
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[parameter(Mandatory)][string] $BackupFolder,
|
||||
|
||||
Reference in New Issue
Block a user