mirror of
https://github.com/EvotecIT/GPOZaurr.git
synced 2026-07-26 11:49:17 +00:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cb473ae5fa | |||
| e156ef9a24 | |||
| 40cd4dc8ad | |||
| 92f3fcb692 | |||
| bd103a513b | |||
| 8268002ac0 | |||
| 038e4036b9 | |||
| 632f2b0c26 | |||
| 84805cf134 | |||
| d7ebc89d54 | |||
| 4288829415 | |||
| f3d426ba93 |
@@ -1,5 +1,11 @@
|
||||
# GPOZaurr Release History
|
||||
|
||||
## 1.1.4 - 2024.06.11
|
||||
- Small improvements & fixes
|
||||
|
||||
## 1.1.3 - 2024.04.16
|
||||
- Fixes report showing unessecary `WhatIf` [#53](https://github.com/EvotecIT/GPOZaurr/issues/53)
|
||||
|
||||
## 1.1.2 - 2024.04.16
|
||||
- Fixes `Forest` parameter for GPOAnalysis [#54](https://github.com/EvotecIT/GPOZaurr/issues/54)
|
||||
|
||||
|
||||
+4
-4
@@ -8,7 +8,7 @@
|
||||
Description = 'Group Policy Eater is a PowerShell module that aims to gather information about Group Policies but also allows fixing issues that you may find in them.'
|
||||
FunctionsToExport = @('Add-GPOPermission', 'Add-GPOZaurrPermission', 'Backup-GPOZaurr', 'Clear-GPOZaurrSysvolDFSR', 'ConvertFrom-CSExtension', 'Export-GPOZaurrContent', 'Find-CSExtension', 'Get-GPOZaurr', 'Get-GPOZaurrAD', 'Get-GPOZaurrBackupInformation', 'Get-GPOZaurrBroken', 'Get-GPOZaurrBrokenLink', 'Get-GPOZaurrDictionary', 'Get-GPOZaurrDuplicateObject', 'Get-GPOZaurrFiles', 'Get-GPOZaurrFilesPolicyDefinition', 'Get-GPOZaurrFolders', 'Get-GPOZaurrInheritance', 'Get-GPOZaurrLegacyFiles', 'Get-GPOZaurrLink', 'Get-GPOZaurrLinkSummary', 'Get-GPOZaurrMissingFiles', 'Get-GPOZaurrNetLogon', 'Get-GPOZaurrOrganizationalUnit', 'Get-GPOZaurrOwner', 'Get-GPOZaurrPassword', 'Get-GPOZaurrPermission', 'Get-GPOZaurrPermissionAnalysis', 'Get-GPOZaurrPermissionConsistency', 'Get-GPOZaurrPermissionIssue', 'Get-GPOZaurrPermissionRoot', 'Get-GPOZaurrPermissionSummary', 'Get-GPOZaurrRedirect', 'Get-GPOZaurrSysvolDFSR', 'Get-GPOZaurrUpdates', 'Get-GPOZaurrWMI', 'Invoke-GPOZaurr', 'Invoke-GPOZaurrContent', 'Invoke-GPOZaurrPermission', 'Invoke-GPOZaurrSupport', 'New-GPOZaurrWMI', 'Optimize-GPOZaurr', 'Remove-GPOPermission', 'Remove-GPOZaurr', 'Remove-GPOZaurrBroken', 'Remove-GPOZaurrDuplicateObject', 'Remove-GPOZaurrFolders', 'Remove-GPOZaurrLegacyFiles', 'Remove-GPOZaurrLinkEmptyOU', 'Remove-GPOZaurrPermission', 'Remove-GPOZaurrWMI', 'Repair-GPOZaurrBrokenLink', 'Repair-GPOZaurrNetLogonOwner', 'Repair-GPOZaurrPermission', 'Repair-GPOZaurrPermissionConsistency', 'Restore-GPOZaurr', 'Save-GPOZaurrFiles', 'Set-GPOOwner', 'Set-GPOZaurrOwner', 'Set-GPOZaurrStatus', 'Skip-GroupPolicy')
|
||||
GUID = 'f7d4c9e4-0298-4f51-ad77-e8e3febebbde'
|
||||
ModuleVersion = '1.1.2'
|
||||
ModuleVersion = '1.1.4'
|
||||
PowerShellVersion = '5.1'
|
||||
PrivateData = @{
|
||||
PSData = @{
|
||||
@@ -24,15 +24,15 @@
|
||||
}, @{
|
||||
Guid = 'ee272aa8-baaa-4edf-9f45-b6d6f7d844fe'
|
||||
ModuleName = 'PSSharedGoods'
|
||||
ModuleVersion = '0.0.286'
|
||||
ModuleVersion = '0.0.291'
|
||||
}, @{
|
||||
Guid = '9fc9fd61-7f11-4f4b-a527-084086f1905f'
|
||||
ModuleName = 'ADEssentials'
|
||||
ModuleVersion = '0.0.191'
|
||||
ModuleVersion = '0.0.213'
|
||||
}, @{
|
||||
Guid = 'a7bdf640-f5cb-4acf-9de0-365b322d245c'
|
||||
ModuleName = 'PSWriteHTML'
|
||||
ModuleVersion = '1.17.0'
|
||||
ModuleVersion = '1.19.0'
|
||||
}, 'CimCmdlets', 'Microsoft.PowerShell.Management', 'Microsoft.PowerShell.Utility', 'Microsoft.PowerShell.Security')
|
||||
RootModule = 'GPOZaurr.psm1'
|
||||
}
|
||||
@@ -1,4 +1,32 @@
|
||||
function ConvertFrom-XMLRSOP {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts XML data representing Resultant Set of Policy (RSOP) into a structured PowerShell object.
|
||||
|
||||
.DESCRIPTION
|
||||
This function takes XML data representing RSOP and converts it into a structured PowerShell object for easier manipulation and analysis.
|
||||
|
||||
.PARAMETER Content
|
||||
The XML content representing the RSOP data.
|
||||
|
||||
.PARAMETER ResultsType
|
||||
The type of results being processed.
|
||||
|
||||
.PARAMETER Splitter
|
||||
The delimiter used to split certain data elements.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertFrom-XMLRSOP -Content $xmlData -ResultsType "Computer" -Splitter "`n"
|
||||
|
||||
Description:
|
||||
Converts the XML data in $xmlData representing computer RSOP results using a newline as the splitter.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertFrom-XMLRSOP -Content $xmlData -ResultsType "User" -Splitter ","
|
||||
|
||||
Description:
|
||||
Converts the XML data in $xmlData representing user RSOP results using a comma as the splitter.
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[System.Xml.XmlElement]$Content,
|
||||
|
||||
@@ -1,4 +1,29 @@
|
||||
function ConvertTo-XMLAccountPolicy {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts a PowerShell custom object representing an account policy into XML format.
|
||||
|
||||
.DESCRIPTION
|
||||
This function takes a PowerShell custom object representing an account policy and converts it into XML format for storage or transmission.
|
||||
|
||||
.PARAMETER GPO
|
||||
The PowerShell custom object representing the account policy.
|
||||
|
||||
.PARAMETER SingleObject
|
||||
Indicates whether to convert a single object or multiple objects.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLAccountPolicy -GPO $accountPolicyObject -SingleObject
|
||||
|
||||
Description:
|
||||
Converts the $accountPolicyObject into XML format for a single object.
|
||||
|
||||
.EXAMPLE
|
||||
$accountPolicies | ConvertTo-XMLAccountPolicy -SingleObject
|
||||
|
||||
Description:
|
||||
Converts multiple account policies in $accountPolicies into XML format for each object.
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
|
||||
@@ -1,4 +1,29 @@
|
||||
function ConvertTo-XMLAudit {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts a PowerShell custom object representing an audit policy into XML format.
|
||||
|
||||
.DESCRIPTION
|
||||
This function takes a PowerShell custom object representing an audit policy and converts it into XML format for storage or transmission.
|
||||
|
||||
.PARAMETER GPO
|
||||
The PowerShell custom object representing the audit policy.
|
||||
|
||||
.PARAMETER SingleObject
|
||||
Indicates whether to convert a single object or multiple objects.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLAudit -GPO $auditPolicyObject -SingleObject
|
||||
|
||||
Description:
|
||||
Converts the $auditPolicyObject into XML format for a single object.
|
||||
|
||||
.EXAMPLE
|
||||
$auditPolicies | ConvertTo-XMLAudit -SingleObject
|
||||
|
||||
Description:
|
||||
Converts multiple audit policies in $auditPolicies into XML format for each object.
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
|
||||
@@ -1,4 +1,32 @@
|
||||
function ConvertTo-XMLCertificates {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts a PowerShell custom object representing certificate data into XML format.
|
||||
|
||||
.DESCRIPTION
|
||||
This function takes a PowerShell custom object representing certificate data and converts it into XML format for storage or transmission.
|
||||
|
||||
.PARAMETER GPO
|
||||
The PowerShell custom object representing the certificate data.
|
||||
|
||||
.PARAMETER Category
|
||||
An array of categories for the certificate data.
|
||||
|
||||
.PARAMETER SingleObject
|
||||
Indicates whether to convert a single object or multiple objects.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLCertificates -GPO $certificateDataObject -Category @('Category1', 'Category2') -SingleObject
|
||||
|
||||
Description:
|
||||
Converts the $certificateDataObject into XML format for multiple categories as a single object.
|
||||
|
||||
.EXAMPLE
|
||||
$certificateDataObjects | ConvertTo-XMLCertificates -Category @('Category1') -SingleObject
|
||||
|
||||
Description:
|
||||
Converts multiple certificate data objects in $certificateDataObjects into XML format for a single category.
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
|
||||
@@ -1,4 +1,29 @@
|
||||
function ConvertTo-XMLDriveMapSettings {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts a PowerShell custom object representing drive mapping settings into XML format.
|
||||
|
||||
.DESCRIPTION
|
||||
This function takes a PowerShell custom object representing drive mapping settings and converts it into XML format for storage or transmission.
|
||||
|
||||
.PARAMETER GPO
|
||||
The PowerShell custom object representing the drive mapping settings.
|
||||
|
||||
.PARAMETER SingleObject
|
||||
Indicates whether to convert a single object or multiple objects.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLDriveMapSettings -GPO $driveMapSettingsObject -SingleObject
|
||||
|
||||
Description:
|
||||
Converts the $driveMapSettingsObject into XML format for a single object.
|
||||
|
||||
.EXAMPLE
|
||||
$driveMapSettings | ConvertTo-XMLDriveMapSettings -SingleObject
|
||||
|
||||
Description:
|
||||
Converts multiple drive mapping settings in $driveMapSettings into XML format for each object.
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
|
||||
@@ -1,4 +1,38 @@
|
||||
function ConvertTo-XMLEventLog {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts Group Policy Object (GPO) data to an XML event log format.
|
||||
|
||||
.DESCRIPTION
|
||||
This function takes a PSCustomObject representing GPO data and converts it to an XML event log format. It creates a structured XML output with specific GPO properties.
|
||||
|
||||
.PARAMETER GPO
|
||||
Specifies the PSCustomObject containing GPO data to be converted.
|
||||
|
||||
.EXAMPLE
|
||||
$GPOData = [PSCustomObject]@{
|
||||
DisplayName = 'Example GPO'
|
||||
DomainName = 'example.com'
|
||||
GUID = '12345678-1234-1234-1234-1234567890AB'
|
||||
GpoType = 'Security'
|
||||
DataSet = @(
|
||||
[PSCustomObject]@{
|
||||
Log = 'Application'
|
||||
Name = 'AuditLogRetentionPeriod'
|
||||
SettingNumber = '1'
|
||||
},
|
||||
[PSCustomObject]@{
|
||||
Log = 'System'
|
||||
Name = 'MaximumLogSize'
|
||||
SettingNumber = '1024'
|
||||
}
|
||||
)
|
||||
Linked = $true
|
||||
LinksCount = 2
|
||||
Links = @('OU=Finance,DC=example,DC=com', 'OU=IT,DC=example,DC=com')
|
||||
}
|
||||
ConvertTo-XMLEventLog -GPO $GPOData
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO
|
||||
|
||||
@@ -1,4 +1,29 @@
|
||||
function ConvertTo-XMLFolderRedirection {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts a PowerShell custom object representing folder redirection settings into XML format.
|
||||
|
||||
.DESCRIPTION
|
||||
This function takes a PowerShell custom object representing folder redirection settings and converts it into XML format for storage or transmission.
|
||||
|
||||
.PARAMETER GPO
|
||||
The PowerShell custom object representing the folder redirection settings.
|
||||
|
||||
.PARAMETER SingleObject
|
||||
Indicates whether to convert a single object or multiple objects.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLFolderRedirection -GPO $folderRedirectionSettingsObject -SingleObject
|
||||
|
||||
Description:
|
||||
Converts the $folderRedirectionSettingsObject into XML format for a single object.
|
||||
|
||||
.EXAMPLE
|
||||
$folderRedirectionSettings | ConvertTo-XMLFolderRedirection -SingleObject
|
||||
|
||||
Description:
|
||||
Converts multiple folder redirection settings in $folderRedirectionSettings into XML format for each object.
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
|
||||
@@ -1,4 +1,32 @@
|
||||
function ConvertTo-XMLGenericPolicy {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts a PowerShell custom object representing generic policy settings into XML format.
|
||||
|
||||
.DESCRIPTION
|
||||
This function takes a PowerShell custom object representing generic policy settings and converts it into XML format for storage or transmission.
|
||||
|
||||
.PARAMETER GPO
|
||||
The PowerShell custom object representing the generic policy settings.
|
||||
|
||||
.PARAMETER Category
|
||||
An array of categories for the generic policy settings.
|
||||
|
||||
.PARAMETER SingleObject
|
||||
Indicates whether to convert a single object or multiple objects.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLGenericPolicy -GPO $genericPolicyObject -Category @('Category1', 'Category2') -SingleObject
|
||||
|
||||
Description:
|
||||
Converts the $genericPolicyObject into XML format for multiple categories as a single object.
|
||||
|
||||
.EXAMPLE
|
||||
$genericPolicyObjects | ConvertTo-XMLGenericPolicy -Category @('Category1') -SingleObject
|
||||
|
||||
Description:
|
||||
Converts multiple generic policy settings in $genericPolicyObjects into XML format for a single category.
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
|
||||
@@ -1,4 +1,29 @@
|
||||
function ConvertTo-XMLGenericPublicKey {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts a PSCustomObject representing a Group Policy Object (GPO) to an XML format.
|
||||
|
||||
.DESCRIPTION
|
||||
This function takes a PSCustomObject representing a GPO and converts it to an XML format. It extracts specific properties from the GPO object and organizes them into a structured XML output.
|
||||
|
||||
.PARAMETER GPO
|
||||
Specifies the PSCustomObject representing the GPO to be converted.
|
||||
|
||||
.PARAMETER Category
|
||||
Specifies an array of strings representing categories to include in the XML output.
|
||||
|
||||
.PARAMETER SingleObject
|
||||
Indicates whether to convert a single GPO object or multiple GPO objects.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLGenericPublicKey -GPO $MyGPO -Category @("Category1", "Category2") -SingleObject
|
||||
Converts the PSCustomObject $MyGPO to an XML format including categories "Category1" and "Category2" as a single object.
|
||||
|
||||
.EXAMPLE
|
||||
$GPOs | ConvertTo-XMLGenericPublicKey -Category @("Category1")
|
||||
Converts multiple GPOs in the $GPOs array to an XML format including category "Category1".
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
|
||||
@@ -1,4 +1,29 @@
|
||||
function ConvertTo-XMLGenericSecuritySettings {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts Generic Security Settings to XML format.
|
||||
|
||||
.DESCRIPTION
|
||||
This function converts Generic Security Settings to XML format for further processing.
|
||||
|
||||
.PARAMETER GPO
|
||||
Specifies the Group Policy Object (GPO) to convert.
|
||||
|
||||
.PARAMETER Category
|
||||
Specifies the category of settings to convert.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLGenericSecuritySettings -GPO $GPOObject -Category 'Security'
|
||||
|
||||
Description:
|
||||
Converts the security settings of the specified GPO object to XML format.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLGenericSecuritySettings -GPO $GPOObject -Category 'Network'
|
||||
|
||||
Description:
|
||||
Converts the network settings of the specified GPO object to XML format.
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
|
||||
@@ -1,4 +1,26 @@
|
||||
function ConvertTo-XMLLocalGroups {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts Group Policy Objects (GPO) to XML format for local groups.
|
||||
|
||||
.DESCRIPTION
|
||||
This function converts Group Policy Objects (GPO) to XML format for local groups. It takes a GPO object and an optional switch to process a single object.
|
||||
|
||||
.PARAMETER GPO
|
||||
Specifies the Group Policy Object (GPO) to be converted to XML format.
|
||||
|
||||
.PARAMETER SingleObject
|
||||
Indicates whether to process a single GPO object.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLLocalGroups -GPO $myGPO
|
||||
Converts the specified GPO object to XML format for local groups.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLLocalGroups -GPO $myGPO -SingleObject
|
||||
Converts a single GPO object to XML format for local groups.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
|
||||
@@ -1,4 +1,27 @@
|
||||
function ConvertTo-XMLLocalUser {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts Group Policy Objects (GPO) data to XML format for local users.
|
||||
|
||||
.DESCRIPTION
|
||||
This function converts GPO data to XML format specifically for local users. It extracts relevant user settings from the GPO data and organizes them into a structured XML format.
|
||||
|
||||
.PARAMETER GPO
|
||||
Specifies the GPO object containing user data to be converted.
|
||||
|
||||
.PARAMETER SingleObject
|
||||
Indicates whether to convert a single user object or multiple user objects.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLLocalUser -GPO $myGPO -SingleObject
|
||||
Converts a single GPO object to XML format for local users.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLLocalUser -GPO $myGPO
|
||||
Converts multiple GPO objects to XML format for local users.
|
||||
|
||||
#>
|
||||
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
|
||||
@@ -1,4 +1,35 @@
|
||||
function ConvertTo-XMLNested {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts nested XML elements to a structured format for further processing.
|
||||
|
||||
.DESCRIPTION
|
||||
This function recursively converts nested XML elements to a structured format for easier manipulation and analysis. It extracts properties from the XML elements and organizes them into a hierarchical structure.
|
||||
|
||||
.PARAMETER CreateGPO
|
||||
Specifies the dictionary representing the XML structure being created.
|
||||
|
||||
.PARAMETER Setting
|
||||
Specifies the XML element to be processed.
|
||||
|
||||
.PARAMETER SkipNames
|
||||
Specifies an array of property names to skip during processing.
|
||||
|
||||
.PARAMETER Name
|
||||
Specifies the name of the current XML element being processed.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLNested -CreateGPO $MyGPO -Setting $XmlSetting -SkipNames @('Name', 'Value') -Name 'Root'
|
||||
|
||||
Description:
|
||||
Converts the nested XML element $XmlSetting into a structured format stored in $MyGPO, skipping properties 'Name' and 'Value', with the root element named 'Root'.
|
||||
|
||||
.EXAMPLE
|
||||
$XmlElements | ForEach-Object { ConvertTo-XMLNested -CreateGPO $Output -Setting $_ -SkipNames @('ID') -Name 'Element' }
|
||||
|
||||
Description:
|
||||
Processes multiple XML elements in $XmlElements, converting each into a structured format stored in $Output, skipping property 'ID', and naming each element 'Element'.
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[System.Collections.IDictionary] $CreateGPO,
|
||||
|
||||
@@ -1,4 +1,26 @@
|
||||
function ConvertTo-XMLPolicies {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts Group Policy Object (GPO) data to XML format.
|
||||
|
||||
.DESCRIPTION
|
||||
This function converts the provided GPO data into XML format for easier processing and analysis.
|
||||
|
||||
.PARAMETER GPO
|
||||
Specifies the GPO object containing the data to be converted.
|
||||
|
||||
.PARAMETER SingleObject
|
||||
Indicates whether to convert a single GPO object or multiple GPO objects.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLPolicies -GPO $myGPO -SingleObject
|
||||
Converts a single GPO object $myGPO to XML format.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLPolicies -GPO $GPOList
|
||||
Converts multiple GPO objects in $GPOList to XML format.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
|
||||
@@ -1,4 +1,26 @@
|
||||
function ConvertTo-XMLPrinter {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts Group Policy Objects (GPO) to an XML printer format.
|
||||
|
||||
.DESCRIPTION
|
||||
This function converts GPO objects to an XML printer format, providing detailed information about printers and printer connections.
|
||||
|
||||
.PARAMETER GPO
|
||||
Specifies the GPO object to be converted.
|
||||
|
||||
.PARAMETER SingleObject
|
||||
Indicates whether to convert a single GPO object or multiple GPO objects.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLPrinter -GPO $myGPO -SingleObject
|
||||
Converts a single GPO object $myGPO to an XML printer format.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLPrinter -GPO $myGPO
|
||||
Converts multiple GPO objects to an XML printer format.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
|
||||
@@ -1,4 +1,32 @@
|
||||
function ConvertTo-XMLPrinterInternal {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts printer settings to XML format for internal use.
|
||||
|
||||
.DESCRIPTION
|
||||
This function converts printer settings to XML format for internal use. It takes a GPO object, entry details, type, and a switch for limited output. The output includes various printer settings in XML format.
|
||||
|
||||
.PARAMETER GPO
|
||||
The GPO object containing printer settings.
|
||||
|
||||
.PARAMETER Entry
|
||||
Details of the printer entry.
|
||||
|
||||
.PARAMETER Type
|
||||
The type of printer setting.
|
||||
|
||||
.PARAMETER Limited
|
||||
Switch to output limited printer settings.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLPrinterInternal -GPO $GPO -Entry $Entry -Type "Network" -Limited
|
||||
Converts the specified printer settings to XML format with limited output.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLPrinterInternal -GPO $GPO -Entry $Entry -Type "Local"
|
||||
Converts the specified printer settings to XML format without limited output.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
|
||||
@@ -1,4 +1,59 @@
|
||||
function ConvertTo-XMLRegistryAutologon {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts a Group Policy Object (GPO) to an XML format for Registry Autologon settings.
|
||||
|
||||
.DESCRIPTION
|
||||
This function takes a GPO object as input and extracts relevant Registry Autologon settings to create an XML representation.
|
||||
|
||||
.PARAMETER GPO
|
||||
Specifies the Group Policy Object (GPO) to be converted to XML format for Registry Autologon settings.
|
||||
|
||||
.EXAMPLE
|
||||
$GPO = [PSCustomObject]@{
|
||||
DisplayName = "Autologon GPO"
|
||||
DomainName = "example.com"
|
||||
GUID = "12345678-1234-5678-1234-567812345678"
|
||||
GpoType = "Registry"
|
||||
DataSet = [PSCustomObject]@{
|
||||
Registry = @(
|
||||
[PSCustomObject]@{
|
||||
Properties = [PSCustomObject]@{
|
||||
Key = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"
|
||||
Name = "AutoAdminLogon"
|
||||
Value = $true
|
||||
Changed = Get-Date
|
||||
}
|
||||
},
|
||||
[PSCustomObject]@{
|
||||
Properties = [PSCustomObject]@{
|
||||
Key = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"
|
||||
Name = "DefaultDomainName"
|
||||
Value = "example.com"
|
||||
Changed = Get-Date
|
||||
}
|
||||
},
|
||||
[PSCustomObject]@{
|
||||
Properties = [PSCustomObject]@{
|
||||
Key = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"
|
||||
Name = "DefaultUserName"
|
||||
Value = "user"
|
||||
Changed = Get-Date
|
||||
}
|
||||
},
|
||||
[PSCustomObject]@{
|
||||
Properties = [PSCustomObject]@{
|
||||
Key = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"
|
||||
Name = "DefaultPassword"
|
||||
Value = "password"
|
||||
Changed = Get-Date
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
ConvertTo-XMLRegistryAutologon -GPO $GPO
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO
|
||||
|
||||
@@ -1,4 +1,34 @@
|
||||
function ConvertTo-XMLRegistryAutologonOnReport {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts Group Policy Object (GPO) settings related to Autologon into an XML report.
|
||||
|
||||
.DESCRIPTION
|
||||
This function takes a GPO object as input and extracts Autologon related settings to generate an XML report.
|
||||
|
||||
.PARAMETER GPO
|
||||
Specifies the GPO object containing Autologon settings.
|
||||
|
||||
.EXAMPLE
|
||||
$GPO = [PSCustomObject]@{
|
||||
DisplayName = "Autologon GPO"
|
||||
DomainName = "example.com"
|
||||
GUID = "12345678-1234-1234-1234-1234567890AB"
|
||||
GpoType = "Security"
|
||||
Settings = @(
|
||||
[PSCustomObject]@{
|
||||
Key = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"
|
||||
Name = "AutoAdminLogon"
|
||||
Value = $true
|
||||
Changed = (Get-Date)
|
||||
}
|
||||
)
|
||||
Linked = $true
|
||||
LinksCount = 1
|
||||
Links = "area1.local"
|
||||
}
|
||||
ConvertTo-XMLRegistryAutologonOnReport -GPO $GPO
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO
|
||||
|
||||
@@ -1,4 +1,19 @@
|
||||
function ConvertTo-XMLRegistryInternetExplorerZones {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts registry settings related to Internet Explorer security zones into XML format.
|
||||
|
||||
.DESCRIPTION
|
||||
This function converts registry settings from a Group Policy Object (GPO) related to Internet Explorer security zones into XML format. It extracts relevant information such as display name, domain name, GUID, GPO type, configuration, policy type, and security zone based on the registry settings provided.
|
||||
|
||||
.PARAMETER GPO
|
||||
Specifies the Group Policy Object (GPO) containing the registry settings to be converted.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLRegistryInternetExplorerZones -GPO $GPO
|
||||
Converts the registry settings from the specified Group Policy Object ($GPO) related to Internet Explorer security zones into XML format.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO
|
||||
|
||||
@@ -1,4 +1,26 @@
|
||||
function ConvertTo-XMLRegistrySettings {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts Group Policy Object (GPO) settings to XML format.
|
||||
|
||||
.DESCRIPTION
|
||||
This function converts the settings of a Group Policy Object (GPO) to XML format. It can be used to export GPO settings for analysis or backup purposes.
|
||||
|
||||
.PARAMETER GPO
|
||||
Specifies the Group Policy Object (GPO) to convert to XML format.
|
||||
|
||||
.PARAMETER SingleObject
|
||||
Indicates whether to convert a single GPO object or multiple GPO objects.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLRegistrySettings -GPO $myGPO -SingleObject
|
||||
Converts a single GPO object to XML format.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLRegistrySettings -GPO $myGPO
|
||||
Converts multiple GPO objects to XML format.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
|
||||
@@ -1,4 +1,26 @@
|
||||
function ConvertTo-XMLScripts {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts Group Policy Objects (GPO) to XML scripts.
|
||||
|
||||
.DESCRIPTION
|
||||
This function converts GPO objects to XML scripts for further processing.
|
||||
|
||||
.PARAMETER GPO
|
||||
Specifies the GPO object to be converted.
|
||||
|
||||
.PARAMETER SingleObject
|
||||
Indicates whether to convert a single GPO object or multiple GPO objects.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLScripts -GPO $myGPO -SingleObject
|
||||
Converts a single GPO object to an XML script.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLScripts -GPO $myGPO
|
||||
Converts multiple GPO objects to XML scripts.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
|
||||
@@ -1,4 +1,26 @@
|
||||
function ConvertTo-XMLSecurityOptions {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts Group Policy Object (GPO) data to XML security options.
|
||||
|
||||
.DESCRIPTION
|
||||
This function converts GPO data to XML security options for further processing.
|
||||
|
||||
.PARAMETER GPO
|
||||
Specifies the GPO object to convert.
|
||||
|
||||
.PARAMETER SingleObject
|
||||
Indicates whether to convert a single GPO object.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLSecurityOptions -GPO $myGPO -SingleObject
|
||||
Converts a single GPO object to XML security options.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLSecurityOptions -GPO $myGPO
|
||||
Converts multiple GPO objects to XML security options.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
|
||||
@@ -1,4 +1,26 @@
|
||||
function ConvertTo-XMLSoftwareInstallation {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts Group Policy Object (GPO) data into XML format for software installation.
|
||||
|
||||
.DESCRIPTION
|
||||
This function takes GPO data and converts it into XML format suitable for software installation. It creates an XML structure with detailed information about each software installation entry.
|
||||
|
||||
.PARAMETER GPO
|
||||
Specifies the GPO object containing software installation data.
|
||||
|
||||
.PARAMETER SingleObject
|
||||
Indicates whether to convert a single GPO object or multiple objects.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLSoftwareInstallation -GPO $GPOObject -SingleObject
|
||||
Converts a single GPO object into XML format for software installation.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLSoftwareInstallation -GPO $GPOObject
|
||||
Converts multiple GPO objects into XML format for software installation.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
|
||||
@@ -1,4 +1,26 @@
|
||||
function ConvertTo-XMLSystemServices {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts Group Policy Objects (GPO) data to an XML format for System Services.
|
||||
|
||||
.DESCRIPTION
|
||||
This function takes a GPO object and converts its data into an XML format suitable for System Services. It organizes the GPO data including service names, startup modes, security auditing status, permissions, and security descriptors.
|
||||
|
||||
.PARAMETER GPO
|
||||
Specifies the GPO object to be converted to XML format.
|
||||
|
||||
.PARAMETER SingleObject
|
||||
Indicates whether to convert a single GPO object or multiple GPO objects.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLSystemServices -GPO $myGPO -SingleObject
|
||||
Converts a single GPO object $myGPO to XML format for System Services.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLSystemServices -GPO $myGPO
|
||||
Converts multiple GPO objects to XML format for System Services.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
|
||||
@@ -1,4 +1,25 @@
|
||||
function ConvertTo-XMLSystemServicesNT {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts a Group Policy Object (GPO) to an XML representation for System Services on Windows NT.
|
||||
|
||||
.DESCRIPTION
|
||||
This function takes a GPO object and converts it into an XML format specifically tailored for System Services on Windows NT. It extracts relevant information about each service defined in the GPO and structures it in an XML format.
|
||||
|
||||
.PARAMETER GPO
|
||||
Specifies the Group Policy Object (GPO) to be converted to XML.
|
||||
|
||||
.PARAMETER SingleObject
|
||||
Indicates whether to convert a single GPO object or multiple GPO objects.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLSystemServicesNT -GPO $myGPO -SingleObject
|
||||
Converts a single GPO object $myGPO to an XML representation for System Services on Windows NT.
|
||||
|
||||
.EXAMPLE
|
||||
$GPOs | ConvertTo-XMLSystemServicesNT
|
||||
Converts multiple GPO objects in the $GPOs array to XML representations for System Services on Windows NT.
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
|
||||
@@ -1,4 +1,25 @@
|
||||
function ConvertTo-XMLTaskScheduler {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts Task Scheduler settings to XML format.
|
||||
|
||||
.DESCRIPTION
|
||||
This function converts Task Scheduler settings from a PSCustomObject to XML format. It provides detailed information about the task settings for each task.
|
||||
|
||||
.PARAMETER GPO
|
||||
Specifies the Group Policy Object (GPO) containing the Task Scheduler settings.
|
||||
|
||||
.PARAMETER SingleObject
|
||||
Indicates whether to convert a single object or multiple objects.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLTaskScheduler -GPO $GPOObject -SingleObject
|
||||
Converts the Task Scheduler settings from the specified GPO object to XML format for a single object.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLTaskScheduler -GPO $GPOObject
|
||||
Converts the Task Scheduler settings from the specified GPO object to XML format for multiple objects.
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
|
||||
@@ -1,4 +1,26 @@
|
||||
function ConvertTo-XMLUserRightsAssignment {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts user rights assignments to XML format.
|
||||
|
||||
.DESCRIPTION
|
||||
This function converts user rights assignments to XML format based on the provided GPO object.
|
||||
|
||||
.PARAMETER GPO
|
||||
Specifies the Group Policy Object (GPO) to extract user rights assignments from.
|
||||
|
||||
.PARAMETER SingleObject
|
||||
Indicates whether to process a single object.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLUserRightsAssignment -GPO $GPOObject -SingleObject
|
||||
Converts user rights assignments from a single GPO object to XML format.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLUserRightsAssignment -GPO $GPOObject
|
||||
Converts user rights assignments from multiple GPO objects to XML format.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
|
||||
@@ -1,4 +1,26 @@
|
||||
function ConvertTo-XMLWindowsFirewall {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts a Group Policy Object (GPO) to an XML representation for Windows Firewall settings.
|
||||
|
||||
.DESCRIPTION
|
||||
This function takes a GPO object and converts it into an XML format suitable for Windows Firewall settings. It can handle single GPO objects or multiple GPO objects.
|
||||
|
||||
.PARAMETER GPO
|
||||
Specifies the Group Policy Object to be converted to XML.
|
||||
|
||||
.PARAMETER SingleObject
|
||||
Indicates whether to convert a single GPO object or multiple GPO objects.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLWindowsFirewall -GPO $myGPO -SingleObject
|
||||
Converts a single GPO object $myGPO to an XML representation for Windows Firewall settings.
|
||||
|
||||
.EXAMPLE
|
||||
$GPOs | ConvertTo-XMLWindowsFirewall
|
||||
Converts multiple GPO objects in the $GPOs array to XML representations for Windows Firewall settings.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
|
||||
@@ -1,4 +1,25 @@
|
||||
function ConvertTo-XMLWindowsFirewallConnectionSecurityAuthentiation {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts Windows Firewall Connection Security Authentication settings to XML format.
|
||||
|
||||
.DESCRIPTION
|
||||
This function converts Windows Firewall Connection Security Authentication settings from a PSCustomObject to XML format. It provides detailed information about the authentication settings for each connection.
|
||||
|
||||
.PARAMETER GPO
|
||||
Specifies the Group Policy Object (GPO) containing the Windows Firewall Connection Security Authentication settings.
|
||||
|
||||
.PARAMETER SingleObject
|
||||
Indicates whether to convert a single object or multiple objects.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLWindowsFirewallConnectionSecurityAuthentiation -GPO $GPOObject -SingleObject
|
||||
Converts the Windows Firewall Connection Security Authentication settings from the specified GPO object to XML format for a single object.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLWindowsFirewallConnectionSecurityAuthentiation -GPO $GPOObject
|
||||
Converts the Windows Firewall Connection Security Authentication settings from the specified GPO object to XML format for multiple objects.
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
|
||||
@@ -1,4 +1,26 @@
|
||||
function ConvertTo-XMLWindowsFirewallProfile {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts a Windows Firewall profile to XML format.
|
||||
|
||||
.DESCRIPTION
|
||||
This function takes a Windows Firewall profile object and converts it to XML format for further processing.
|
||||
|
||||
.PARAMETER GPO
|
||||
Specifies the Windows Firewall profile object to convert.
|
||||
|
||||
.PARAMETER SingleObject
|
||||
Indicates whether to convert a single object or multiple objects.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLWindowsFirewallProfile -GPO $FirewallProfile -SingleObject
|
||||
Converts a single Windows Firewall profile object to XML format.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLWindowsFirewallProfile -GPO $FirewallProfiles -SingleObject:$false
|
||||
Converts multiple Windows Firewall profile objects to XML format.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
|
||||
@@ -1,4 +1,26 @@
|
||||
function ConvertTo-XMLWindowsFirewallRules {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts Windows Firewall rules to XML format.
|
||||
|
||||
.DESCRIPTION
|
||||
This function converts Windows Firewall rules to XML format for easier management and analysis.
|
||||
|
||||
.PARAMETER GPO
|
||||
Specifies the Group Policy Object (GPO) containing the firewall rules to be converted.
|
||||
|
||||
.PARAMETER SingleObject
|
||||
Indicates whether to convert a single firewall rule object.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLWindowsFirewallRules -GPO $GPOObject -SingleObject
|
||||
Converts all firewall rules in the specified GPO to XML format.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLWindowsFirewallRules -GPO $GPOObject
|
||||
Converts all firewall rules in the specified GPO to XML format without creating a single object.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
|
||||
@@ -1,4 +1,28 @@
|
||||
function ConvertTo-XMLWindowsFirewallSecurityRules {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts Windows Firewall security rules data to XML format.
|
||||
|
||||
.DESCRIPTION
|
||||
This function converts Windows Firewall security rules data to XML format. It takes a GPO object as input and generates XML data representing the security rules.
|
||||
|
||||
.PARAMETER GPO
|
||||
Specifies the Group Policy Object (GPO) containing the security rules data.
|
||||
|
||||
.PARAMETER SingleObject
|
||||
Indicates whether to convert a single GPO object or multiple security rules.
|
||||
|
||||
.EXAMPLE
|
||||
$GPO = Get-GPO -Name "FirewallRules"
|
||||
ConvertTo-XMLWindowsFirewallSecurityRules -GPO $GPO -SingleObject
|
||||
Converts the security rules data from the GPO "FirewallRules" to XML format for a single GPO object.
|
||||
|
||||
.EXAMPLE
|
||||
$GPOs = Get-GPO -All
|
||||
ConvertTo-XMLWindowsFirewallSecurityRules -GPO $GPOs -SingleObject:$false
|
||||
Converts the security rules data from all GPOs to XML format for multiple security rules.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
|
||||
@@ -1,4 +1,19 @@
|
||||
function Find-GPOPassword {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Finds and decrypts the password stored in the cpassword attribute of a Group Policy Object (GPO) XML file.
|
||||
|
||||
.DESCRIPTION
|
||||
This function takes the path to a GPO XML file as input, searches for the cpassword attribute, decrypts it, and returns the password.
|
||||
|
||||
.PARAMETER Path
|
||||
Specifies the path to the GPO XML file.
|
||||
|
||||
.EXAMPLE
|
||||
Find-GPOPassword -Path "C:\GPOs\GPO1.xml"
|
||||
Searches for the cpassword attribute in the GPO XML file "GPO1.xml" and returns the decrypted password.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[string] $Path
|
||||
|
||||
@@ -1,4 +1,25 @@
|
||||
function Format-CamelCaseToDisplayName {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts a camelCase string to a display name with spaces.
|
||||
|
||||
.DESCRIPTION
|
||||
This function takes a camelCase string and converts it to a display name by adding spaces between words.
|
||||
|
||||
.PARAMETER Text
|
||||
The camelCase string(s) to be converted to display name.
|
||||
|
||||
.PARAMETER AddChar
|
||||
The character to add between words in the display name.
|
||||
|
||||
.EXAMPLE
|
||||
Format-CamelCaseToDisplayName -Text 'testString' -AddChar ' '
|
||||
Converts 'testString' to 'Test String'
|
||||
|
||||
.EXAMPLE
|
||||
Format-CamelCaseToDisplayName -Text 'anotherExample' -AddChar '-'
|
||||
Converts 'anotherExample' to 'Another-Example'
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[string[]] $Text,
|
||||
|
||||
@@ -1,4 +1,37 @@
|
||||
function Get-ChoosenDates {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Retrieves dates based on the specified date range.
|
||||
|
||||
.DESCRIPTION
|
||||
This function retrieves dates based on the specified date range. The available date ranges are:
|
||||
- Everything
|
||||
- PastHour
|
||||
- CurrentHour
|
||||
- PastDay
|
||||
- CurrentDay
|
||||
- PastMonth
|
||||
- CurrentMonth
|
||||
- PastQuarter
|
||||
- CurrentQuarter
|
||||
- Last14Days
|
||||
- Last21Days
|
||||
- Last30Days
|
||||
- Last7Days
|
||||
- Last3Days
|
||||
- Last1Days
|
||||
|
||||
.PARAMETER DateRange
|
||||
Specifies the date range to retrieve dates for.
|
||||
|
||||
.EXAMPLE
|
||||
Get-ChoosenDates -DateRange PastHour
|
||||
Retrieves dates for the past hour.
|
||||
|
||||
.EXAMPLE
|
||||
Get-ChoosenDates -DateRange CurrentMonth
|
||||
Retrieves dates for the current month.
|
||||
#>
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[ValidateSet('Everything', 'PastHour', 'CurrentHour', 'PastDay', 'CurrentDay', 'PastMonth', 'CurrentMonth', 'PastQuarter', 'CurrentQuarter', 'Last14Days', 'Last21Days', 'Last30Days' , 'Last7Days', 'Last3Days', 'Last1Days')][string] $DateRange
|
||||
|
||||
@@ -1,4 +1,38 @@
|
||||
function Get-GPOBlockedInheritance {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Retrieves information about Organizational Units (OUs) with blocked inheritance of Group Policy Objects (GPOs).
|
||||
|
||||
.DESCRIPTION
|
||||
The Get-GPOBlockedInheritance function retrieves information about OUs within a specified forest that have blocked inheritance of GPOs. It returns a list of OUs with their distinguished names and whether they have blocked inheritance enabled.
|
||||
|
||||
.PARAMETER Filter
|
||||
Specifies a filter to select specific OUs. Default is '*'.
|
||||
|
||||
.PARAMETER Forest
|
||||
Specifies the name of the forest to query.
|
||||
|
||||
.PARAMETER ExcludeDomains
|
||||
Specifies an array of domain names to exclude from the query.
|
||||
|
||||
.PARAMETER IncludeDomains
|
||||
Specifies an array of domain names to include in the query.
|
||||
|
||||
.PARAMETER AsHashTable
|
||||
Indicates whether to return the results as a hashtable. If specified, the function returns a hashtable with OU distinguished names as keys and blocked inheritance status as values.
|
||||
|
||||
.PARAMETER ExtendedForestInformation
|
||||
Specifies additional forest information to include in the query.
|
||||
|
||||
.EXAMPLE
|
||||
Get-GPOBlockedInheritance -Forest 'contoso.com'
|
||||
Retrieves a list of all OUs within the 'contoso.com' forest with blocked inheritance status.
|
||||
|
||||
.EXAMPLE
|
||||
Get-GPOBlockedInheritance -Forest 'contoso.com' -IncludeDomains 'child1.contoso.com', 'child2.contoso.com' -AsHashTable
|
||||
Retrieves a hashtable of OUs within the 'contoso.com' forest from specified domains with blocked inheritance status.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[string] $Filter = '*',
|
||||
|
||||
@@ -1,4 +1,33 @@
|
||||
function Get-GPOCategories {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Retrieves GPO categories based on the provided GPO object and XML output.
|
||||
|
||||
.DESCRIPTION
|
||||
This function retrieves GPO categories by analyzing the provided GPO object and XML output. It categorizes GPO settings based on different criteria.
|
||||
|
||||
.PARAMETER GPO
|
||||
The GPO object containing information about the Group Policy Object.
|
||||
|
||||
.PARAMETER GPOOutput
|
||||
An array of XML elements representing the GPO output.
|
||||
|
||||
.PARAMETER Splitter
|
||||
The delimiter used to split GPO settings.
|
||||
|
||||
.PARAMETER FullObjects
|
||||
A switch parameter to indicate whether to retrieve full GPO objects.
|
||||
|
||||
.PARAMETER CachedCategories
|
||||
A dictionary containing cached GPO categories.
|
||||
|
||||
.EXAMPLE
|
||||
Get-GPOCategories -GPO $gpoObject -GPOOutput $xmlOutput -Splitter ":" -FullObjects
|
||||
|
||||
Description:
|
||||
Retrieves GPO categories for the specified GPO object and XML output, splitting settings using ":" as the delimiter and retrieving full GPO objects.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
|
||||
@@ -1,4 +1,37 @@
|
||||
function Get-GPOPrivInheritance {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Retrieves the Group Policy Object (GPO) inheritance information for a given Active Directory object.
|
||||
|
||||
.DESCRIPTION
|
||||
This function retrieves the inheritance information of Group Policy Objects (GPOs) for a specified Active Directory object. It provides details on how GPOs are linked and inherited by the object.
|
||||
|
||||
.PARAMETER ADObject
|
||||
Specifies the Active Directory object for which to retrieve GPO inheritance information.
|
||||
|
||||
.PARAMETER CacheReturnedGPOs
|
||||
Specifies a dictionary containing cached GPO information to optimize retrieval.
|
||||
|
||||
.PARAMETER ForestInformation
|
||||
Specifies a dictionary containing information about the Active Directory forest.
|
||||
|
||||
.PARAMETER Domain
|
||||
Specifies the domain for which to retrieve GPO privilege link information.
|
||||
|
||||
.PARAMETER SkipDomainRoot
|
||||
Indicates whether to skip the Domain Root container.
|
||||
|
||||
.PARAMETER SkipDomainControllers
|
||||
Indicates whether to skip the Domain Controllers container.
|
||||
|
||||
.EXAMPLE
|
||||
Get-GPOPrivInheritance -ADObject $ADObject -CacheReturnedGPOs $Cache -ForestInformation $ForestInfo -Domain "example.com" -SkipDomainRoot -SkipDomainControllers
|
||||
Retrieves GPO inheritance information for the specified ADObject in the "example.com" domain, skipping the Domain Root container and Domain Controllers container.
|
||||
|
||||
.NOTES
|
||||
File Name : Get-GPOPrivInheritance.ps1
|
||||
Prerequisite : This function requires the Get-GPInheritance function.
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[parameter(ParameterSetName = 'ADObject', ValueFromPipeline, ValueFromPipelineByPropertyName, Mandatory)][Microsoft.ActiveDirectory.Management.ADObject[]] $ADObject,
|
||||
|
||||
@@ -1,4 +1,45 @@
|
||||
function Get-GPOPrivInheritanceLoop {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Retrieves the Group Policy Object (GPO) inheritance loop for a given Active Directory object.
|
||||
|
||||
.DESCRIPTION
|
||||
This function retrieves the GPO inheritance loop for a specified Active Directory object. It analyzes the inheritance of GPOs based on the object's location in the Active Directory structure.
|
||||
|
||||
.PARAMETER ADObject
|
||||
Specifies the Active Directory object for which the GPO inheritance loop needs to be determined.
|
||||
|
||||
.PARAMETER CacheReturnedGPOs
|
||||
Specifies a dictionary containing cached GPO information to optimize retrieval.
|
||||
|
||||
.PARAMETER ForestInformation
|
||||
Specifies a dictionary containing information about the Active Directory forest.
|
||||
|
||||
.PARAMETER Linked
|
||||
Specifies the types of linked objects to consider during the inheritance analysis. Valid values are 'Root', 'DomainControllers', 'OrganizationalUnit'.
|
||||
|
||||
.PARAMETER SearchBase
|
||||
Specifies the base location in Active Directory to start the search for GPO inheritance.
|
||||
|
||||
.PARAMETER SearchScope
|
||||
Specifies the scope of the search in Active Directory.
|
||||
|
||||
.PARAMETER Filter
|
||||
Specifies the filter to apply when searching for Active Directory objects.
|
||||
|
||||
.EXAMPLE
|
||||
Get-GPOPrivInheritanceLoop -ADObject $ADObject -CacheReturnedGPOs $Cache -ForestInformation $ForestInfo -Linked 'Root' -SearchBase 'DC=contoso,DC=com' -SearchScope Subtree -Filter '(objectClass -eq "organizationalUnit")'
|
||||
|
||||
Description:
|
||||
Retrieves the GPO inheritance loop for the specified Active Directory object located in the 'contoso.com' domain starting from the root.
|
||||
|
||||
.EXAMPLE
|
||||
Get-GPOPrivInheritanceLoop -ADObject $ADObject -CacheReturnedGPOs $Cache -ForestInformation $ForestInfo -Linked 'DomainControllers' -SearchBase 'DC=contoso,DC=com' -SearchScope Base -Filter '(objectClass -eq "organizationalUnit")'
|
||||
|
||||
Description:
|
||||
Retrieves the GPO inheritance loop for the specified Active Directory object located in the 'contoso.com' domain starting from the Domain Controllers container.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[Microsoft.ActiveDirectory.Management.ADObject[]] $ADObject,
|
||||
|
||||
@@ -1,4 +1,43 @@
|
||||
function Get-GPOPrivLink {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Retrieves the GPO (Group Policy Object) privilege link information for specified Active Directory objects.
|
||||
|
||||
.DESCRIPTION
|
||||
This function retrieves the GPO privilege link information for the specified Active Directory objects. It allows skipping certain default containers like Domain Root and Domain Controllers if needed. It also provides options to cache returned GPOs and skip duplicates.
|
||||
|
||||
.PARAMETER ADObject
|
||||
Specifies the Active Directory objects for which to retrieve GPO privilege link information.
|
||||
|
||||
.PARAMETER CacheReturnedGPOs
|
||||
Specifies a dictionary to cache returned GPOs for optimization.
|
||||
|
||||
.PARAMETER ForestInformation
|
||||
Specifies a dictionary containing forest information.
|
||||
|
||||
.PARAMETER Domain
|
||||
Specifies the domain for which to retrieve GPO privilege link information.
|
||||
|
||||
.PARAMETER SkipDomainRoot
|
||||
Indicates whether to skip the Domain Root container.
|
||||
|
||||
.PARAMETER SkipDomainControllers
|
||||
Indicates whether to skip the Domain Controllers container.
|
||||
|
||||
.PARAMETER AsHashTable
|
||||
Specifies whether to output the GPO information as a hash table.
|
||||
|
||||
.PARAMETER SkipDuplicates
|
||||
Indicates whether to skip duplicate GPOs.
|
||||
|
||||
.EXAMPLE
|
||||
Get-GPOPrivLink -ADObject $ADObject -CacheReturnedGPOs $Cache -ForestInformation $ForestInfo -Domain "example.com" -SkipDomainRoot -SkipDuplicates
|
||||
Retrieves GPO privilege link information for the specified ADObject in the "example.com" domain, skipping the Domain Root container and duplicates.
|
||||
|
||||
.NOTES
|
||||
File Name : Get-GPOPrivLink.ps1
|
||||
Prerequisite : This function requires the Get-PrivGPOZaurrLink function.
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[parameter(ParameterSetName = 'ADObject', ValueFromPipeline, ValueFromPipelineByPropertyName, Mandatory)][Microsoft.ActiveDirectory.Management.ADObject[]] $ADObject,
|
||||
|
||||
@@ -1,52 +1,52 @@
|
||||
function Get-GPOZaurrLinkInheritance {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Short description
|
||||
Retrieves the Group Policy Object (GPO) inheritance information for a given Active Directory object.
|
||||
|
||||
.DESCRIPTION
|
||||
Long description
|
||||
This function retrieves the inheritance information of Group Policy Objects (GPOs) for a specified Active Directory object. It provides details on how GPOs are linked and inherited by the object.
|
||||
|
||||
.PARAMETER ADObject
|
||||
Parameter description
|
||||
Specifies the Active Directory object for which to retrieve GPO inheritance information.
|
||||
|
||||
.PARAMETER Filter
|
||||
Parameter description
|
||||
Specifies the filter criteria for selecting the types of objects to include in the search. Default value includes 'organizationalUnit', 'domainDNS', and 'site' objects.
|
||||
|
||||
.PARAMETER SearchBase
|
||||
Parameter description
|
||||
Specifies the base distinguished name (DN) for the search operation.
|
||||
|
||||
.PARAMETER SearchScope
|
||||
Parameter description
|
||||
Specifies the scope of the search operation within Active Directory.
|
||||
|
||||
.PARAMETER Linked
|
||||
Parameter description
|
||||
Specifies the type of objects to include in the search. Valid values are 'Root', 'DomainControllers', and 'OrganizationalUnit'.
|
||||
|
||||
.PARAMETER Limited
|
||||
Parameter description
|
||||
Indicates whether to limit the search results. If specified, only a limited set of results will be returned.
|
||||
|
||||
.PARAMETER SkipDuplicates
|
||||
Parameter description
|
||||
Indicates whether to skip duplicate entries in the search results.
|
||||
|
||||
.PARAMETER GPOCache
|
||||
Parameter description
|
||||
Specifies a cache of Group Policy Objects to optimize performance.
|
||||
|
||||
.PARAMETER Forest
|
||||
Target different Forest, by default current forest is used
|
||||
Specifies the target forest to search for GPO inheritance information. By default, the current forest is used.
|
||||
|
||||
.PARAMETER ExcludeDomains
|
||||
Exclude domain from search, by default whole forest is scanned
|
||||
Specifies the domains to exclude from the search operation. By default, the entire forest is scanned.
|
||||
|
||||
.PARAMETER IncludeDomains
|
||||
Include only specific domains, by default whole forest is scanned
|
||||
Specifies the specific domains to include in the search operation. By default, the entire forest is scanned.
|
||||
|
||||
.PARAMETER ExtendedForestInformation
|
||||
Parameter description
|
||||
Specifies additional information about the forest to include in the search results.
|
||||
|
||||
.PARAMETER AsHashTable
|
||||
Parameter description
|
||||
Indicates whether to return the results as a hash table.
|
||||
|
||||
.PARAMETER Summary
|
||||
Parameter description
|
||||
Indicates whether to provide a summary of the GPO inheritance information.
|
||||
|
||||
.EXAMPLE
|
||||
$Output = Get-GPOZaurrLinkInheritance -Summary
|
||||
@@ -58,7 +58,7 @@ function Get-GPOZaurrLinkInheritance {
|
||||
$Output[5].LinksObjects | Format-Table
|
||||
|
||||
.NOTES
|
||||
This is based on Get-GPInheritance which isn't ideal and doesn't support sites. Get-GPOZaurrLink is better. Leaving in case I need it later on for private use only.
|
||||
This function is an improved version of Get-GPInheritance and provides better support for sites. It is recommended for retrieving GPO inheritance information.
|
||||
#>
|
||||
[cmdletbinding(DefaultParameterSetName = 'All')]
|
||||
param(
|
||||
|
||||
@@ -1,4 +1,51 @@
|
||||
function Get-GPOZaurrLinkLoop {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Retrieves Group Policy Object (GPO) links for Active Directory objects based on specified criteria.
|
||||
|
||||
.DESCRIPTION
|
||||
This function retrieves GPO links for Active Directory objects based on the provided parameters. It allows searching for GPO links within specific sites, domains, or organizational units. The function can handle duplicates and provides flexibility in defining search criteria.
|
||||
|
||||
.PARAMETER ADObject
|
||||
Specifies the Active Directory objects for which GPO links will be retrieved.
|
||||
|
||||
.PARAMETER CacheReturnedGPOs
|
||||
A dictionary cache of returned Group Policy Objects for efficient processing.
|
||||
|
||||
.PARAMETER ForestInformation
|
||||
Information about the forest structure and domains for targeted searches.
|
||||
|
||||
.PARAMETER Linked
|
||||
Specifies the type of objects to search for GPO links. Valid values are 'All', 'Root', 'DomainControllers', 'Site', or 'OrganizationalUnit'.
|
||||
|
||||
.PARAMETER SearchBase
|
||||
Specifies the base location for the search within Active Directory.
|
||||
|
||||
.PARAMETER SearchScope
|
||||
Specifies the scope of the search within Active Directory.
|
||||
|
||||
.PARAMETER Filter
|
||||
Specifies additional filters to apply during the search.
|
||||
|
||||
.PARAMETER SkipDuplicates
|
||||
Indicates whether to skip duplicate GPO links during processing.
|
||||
|
||||
.PARAMETER Site
|
||||
Specifies the site(s) to search for GPO links.
|
||||
|
||||
.EXAMPLE
|
||||
Get-GPOZaurrLinkLoop -Site 'SiteA', 'SiteB' -ForestInformation $ForestInfo
|
||||
|
||||
Description:
|
||||
Retrieves GPO links for sites 'SiteA' and 'SiteB' within the forest using the provided forest information.
|
||||
|
||||
.EXAMPLE
|
||||
Get-GPOZaurrLinkLoop -SearchBase 'OU=Users,DC=contoso,DC=com' -SearchScope Subtree -Filter '(objectClass -eq "user")'
|
||||
|
||||
Description:
|
||||
Retrieves GPO links for all user objects within the specified organizational unit 'Users' in the 'contoso.com' domain.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[Microsoft.ActiveDirectory.Management.ADObject[]] $ADObject,
|
||||
|
||||
@@ -1,4 +1,27 @@
|
||||
function Get-GitHubVersion {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Retrieves the latest version information from a GitHub repository and compares it with the currently installed version of a specified cmdlet.
|
||||
|
||||
.DESCRIPTION
|
||||
The Get-GitHubVersion function retrieves the latest version information from a specified GitHub repository and compares it with the version of a specified cmdlet. It then provides feedback on whether an update is available or if the installed version is up to date.
|
||||
|
||||
.PARAMETER Cmdlet
|
||||
The name of the cmdlet to check for updates.
|
||||
|
||||
.PARAMETER RepositoryOwner
|
||||
The owner of the GitHub repository where the releases are hosted.
|
||||
|
||||
.PARAMETER RepositoryName
|
||||
The name of the GitHub repository.
|
||||
|
||||
.EXAMPLE
|
||||
Get-GitHubVersion -Cmdlet "MyCmdlet" -RepositoryOwner "MyRepoOwner" -RepositoryName "MyRepo"
|
||||
|
||||
Description:
|
||||
Retrieves the latest version information for "MyCmdlet" from the GitHub repository owned by "MyRepoOwner" with the name "MyRepo".
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[Parameter(Mandatory)][string] $Cmdlet,
|
||||
|
||||
@@ -1,4 +1,29 @@
|
||||
function Get-LinksFromXML {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Retrieves links from XML data.
|
||||
|
||||
.DESCRIPTION
|
||||
This function retrieves links from XML data provided as input. It processes the XML data to extract relevant information about the links.
|
||||
|
||||
.PARAMETER GPOOutput
|
||||
Specifies the XML data containing information about the links.
|
||||
|
||||
.PARAMETER Splitter
|
||||
Specifies the delimiter to use when joining multiple links.
|
||||
|
||||
.PARAMETER FullObjects
|
||||
Indicates whether to return full objects with additional properties for each link.
|
||||
|
||||
.EXAMPLE
|
||||
Get-LinksFromXML -GPOOutput $xmlData -Splitter ";" -FullObjects
|
||||
Retrieves links from the XML data $xmlData, separates them with a semicolon, and returns full objects for each link.
|
||||
|
||||
.EXAMPLE
|
||||
Get-LinksFromXML -GPOOutput $xmlData -Splitter "/"
|
||||
Retrieves links from the XML data $xmlData and joins them with a forward slash.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[System.Xml.XmlElement[]] $GPOOutput,
|
||||
|
||||
@@ -1,4 +1,48 @@
|
||||
function Get-PermissionsAnalysis {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Analyzes permissions for a specified Group Policy Object (GPO) based on provided criteria.
|
||||
|
||||
.DESCRIPTION
|
||||
This function analyzes permissions for a specified Group Policy Object (GPO) based on the given criteria. It checks for specific administrative groups, standard users, and well-known administrative groups to determine the type of permissions assigned.
|
||||
|
||||
.PARAMETER GPOPermissions
|
||||
An array of GPO permissions to analyze.
|
||||
|
||||
.PARAMETER Type
|
||||
Specifies the type of permissions to analyze. Valid values are 'WellKnownAdministrative', 'Administrative', 'AuthenticatedUsers', or 'Default'.
|
||||
|
||||
.PARAMETER PermissionType
|
||||
The specific permission type to include in the analysis.
|
||||
|
||||
.PARAMETER Forest
|
||||
Target different Forest, by default current forest is used.
|
||||
|
||||
.PARAMETER ExcludeDomains
|
||||
Exclude domain from search, by default whole forest is scanned.
|
||||
|
||||
.PARAMETER IncludeDomains
|
||||
Include only specific domains, by default whole forest is scanned.
|
||||
|
||||
.PARAMETER ExtendedForestInformation
|
||||
Ability to provide Forest Information from another command to speed up processing.
|
||||
|
||||
.PARAMETER ADAdministrativeGroups
|
||||
Specifies the Active Directory administrative groups to consider.
|
||||
|
||||
.EXAMPLE
|
||||
Get-PermissionsAnalysis -GPOPermissions $GPOPermissions -Type 'Administrative' -PermissionType 'Read' -Forest 'Contoso' -IncludeDomains 'DomainA', 'DomainB'
|
||||
|
||||
Description:
|
||||
Analyzes permissions for the specified GPOPermissions array, focusing on administrative groups with 'Read' permission in the 'Contoso' forest for 'DomainA' and 'DomainB'.
|
||||
|
||||
.EXAMPLE
|
||||
Get-PermissionsAnalysis -GPOPermissions $GPOPermissions -Type 'WellKnownAdministrative' -PermissionType 'Write'
|
||||
|
||||
Description:
|
||||
Analyzes permissions for the specified GPOPermissions array, targeting well-known administrative groups with 'Write' permission.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPOPermissions,
|
||||
|
||||
@@ -1,4 +1,33 @@
|
||||
function Get-PrivGPOZaurrLink {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Retrieves and processes Group Policy Object (GPO) links associated with a given Active Directory object.
|
||||
|
||||
.DESCRIPTION
|
||||
This function retrieves and processes the GPO links associated with a specified Active Directory object. It parses the GPO links to extract relevant information such as distinguished name, canonical name, GUID, enforcement status, and enablement status.
|
||||
|
||||
.PARAMETER Object
|
||||
The Active Directory object for which GPO links will be retrieved and processed.
|
||||
|
||||
.PARAMETER Limited
|
||||
Indicates whether to provide limited information about the GPO links.
|
||||
|
||||
.PARAMETER GPOCache
|
||||
A dictionary cache of Group Policy Objects for efficient processing.
|
||||
|
||||
.EXAMPLE
|
||||
Get-PrivGPOZaurrLink -Object $ADObject
|
||||
|
||||
Description:
|
||||
Retrieves and processes the GPO links associated with the specified Active Directory object.
|
||||
|
||||
.EXAMPLE
|
||||
Get-PrivGPOZaurrLink -Object $ADObject -Limited
|
||||
|
||||
Description:
|
||||
Retrieves limited information about the GPO links associated with the specified Active Directory object.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[Microsoft.ActiveDirectory.Management.ADObject] $Object,
|
||||
|
||||
@@ -1,4 +1,69 @@
|
||||
function Get-PrivPermission {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Retrieves permissions for a specified Group Policy Object (GPO) based on various criteria.
|
||||
|
||||
.DESCRIPTION
|
||||
This function retrieves permissions for a specified Group Policy Object (GPO) based on the provided parameters. It allows filtering by principal, permission type, and other criteria.
|
||||
|
||||
.PARAMETER GPO
|
||||
Specifies the Group Policy Object (GPO) for which permissions will be retrieved.
|
||||
|
||||
.PARAMETER SecurityRights
|
||||
Specifies the security rights to be evaluated for the GPO.
|
||||
|
||||
.PARAMETER Principal
|
||||
Specifies the principal for which permissions will be retrieved.
|
||||
|
||||
.PARAMETER PrincipalType
|
||||
Specifies the type of principal to filter by. Valid values are 'DistinguishedName', 'Name', 'NetbiosName', or 'Sid'.
|
||||
|
||||
.PARAMETER SkipWellKnown
|
||||
Skips well-known principals when evaluating permissions.
|
||||
|
||||
.PARAMETER SkipAdministrative
|
||||
Skips administrative principals when evaluating permissions.
|
||||
|
||||
.PARAMETER IncludeOwner
|
||||
Includes the owner of the GPO in the permission results.
|
||||
|
||||
.PARAMETER IncludePermissionType
|
||||
Specifies the permission types to include in the results.
|
||||
|
||||
.PARAMETER ExcludePermissionType
|
||||
Specifies the permission types to exclude from the results.
|
||||
|
||||
.PARAMETER PermitType
|
||||
Specifies the type of permissions to include. Valid values are 'Allow', 'Deny', or 'All'.
|
||||
|
||||
.PARAMETER ExcludePrincipal
|
||||
Specifies principals to exclude from the results.
|
||||
|
||||
.PARAMETER ExcludePrincipalType
|
||||
Specifies the type of principal to exclude. Valid values are 'DistinguishedName', 'Name', or 'Sid'.
|
||||
|
||||
.PARAMETER IncludeGPOObject
|
||||
Includes the GPO object in the permission results.
|
||||
|
||||
.PARAMETER ADAdministrativeGroups
|
||||
Specifies the Active Directory administrative groups to consider.
|
||||
|
||||
.PARAMETER Type
|
||||
Specifies the type of principals to include. Valid values are 'AuthenticatedUsers', 'DomainComputers', 'Unknown', 'WellKnownAdministrative', 'NotWellKnown', 'NotWellKnownAdministrative', 'NotAdministrative', 'Administrative', or 'All'.
|
||||
|
||||
.PARAMETER ExtendedForestInformation
|
||||
Specifies extended forest information to be used in evaluation.
|
||||
|
||||
.EXAMPLE
|
||||
Get-PrivPermission -GPO $GPO -SecurityRights $SecurityRights -Principal 'Domain Admins' -PrincipalType 'Name' -PermitType 'Allow'
|
||||
|
||||
Retrieves permissions for the specified GPO where 'Domain Admins' have 'Allow' permissions.
|
||||
|
||||
.EXAMPLE
|
||||
Get-PrivPermission -GPO $GPO -SecurityRights $SecurityRights -Principal 'S-1-5-21-3623811015-3361044348-30300820-1013' -PrincipalType 'Sid' -PermitType 'Deny'
|
||||
|
||||
Retrieves permissions for the specified GPO where the principal with the SID 'S-1-5-21-3623811015-3361044348-30300820-1013' has 'Deny' permissions.
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[Microsoft.GroupPolicy.Gpo] $GPO,
|
||||
|
||||
@@ -1,4 +1,51 @@
|
||||
function Get-XMLGPO {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Retrieves information from an XML representation of a Group Policy Object (GPO).
|
||||
|
||||
.DESCRIPTION
|
||||
This function retrieves various details from an XML representation of a GPO, such as GPO name, domain name, links information, etc.
|
||||
|
||||
.PARAMETER XMLContent
|
||||
The XML content representing the GPO.
|
||||
|
||||
.PARAMETER GPO
|
||||
The Microsoft.GroupPolicy.Gpo object representing the GPO.
|
||||
|
||||
.PARAMETER PermissionsOnly
|
||||
Indicates whether to retrieve only permissions information.
|
||||
|
||||
.PARAMETER OwnerOnly
|
||||
Indicates whether to retrieve only owner information.
|
||||
|
||||
.PARAMETER ADAdministrativeGroups
|
||||
A dictionary of Active Directory administrative groups.
|
||||
|
||||
.PARAMETER Splitter
|
||||
The string used to split values in the output.
|
||||
|
||||
.PARAMETER ExcludeGroupPolicies
|
||||
A dictionary of group policies to exclude.
|
||||
|
||||
.PARAMETER Type
|
||||
An array of types to filter the output.
|
||||
|
||||
.PARAMETER LinksSummaryCache
|
||||
A cache of links summary information.
|
||||
|
||||
.EXAMPLE
|
||||
Get-XMLGPO -XMLContent $xml -GPO $gpo
|
||||
|
||||
Description:
|
||||
Retrieves information from the XML content of a specific GPO.
|
||||
|
||||
.EXAMPLE
|
||||
Get-XMLGPO -XMLContent $xml -GPO $gpo -PermissionsOnly
|
||||
|
||||
Description:
|
||||
Retrieves only the permissions information from the XML content of a specific GPO.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[XML] $XMLContent,
|
||||
|
||||
@@ -1,4 +1,32 @@
|
||||
function Get-XMLNestedRegistry {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Retrieves registry settings from XML data and formats them for output.
|
||||
|
||||
.DESCRIPTION
|
||||
This function retrieves registry settings from XML data and formats them for output. It can either provide a limited set of information or the full details of each registry setting.
|
||||
|
||||
.PARAMETER GPO
|
||||
The Group Policy Object (GPO) associated with the registry settings.
|
||||
|
||||
.PARAMETER DataSet
|
||||
An array of XML elements containing the registry settings.
|
||||
|
||||
.PARAMETER Collection
|
||||
The name of the collection of registry settings.
|
||||
|
||||
.PARAMETER Limited
|
||||
Indicates whether to provide limited information about each registry setting.
|
||||
|
||||
.EXAMPLE
|
||||
Get-XMLNestedRegistry -GPO $GPO -DataSet $DataSet -Collection "SoftwareSettings" -Limited
|
||||
Retrieves limited information about the registry settings in the "SoftwareSettings" collection.
|
||||
|
||||
.EXAMPLE
|
||||
Get-XMLNestedRegistry -GPO $GPO -DataSet $DataSet -Collection "WindowsSettings"
|
||||
Retrieves full details of the registry settings in the "WindowsSettings" collection.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
Data = $null
|
||||
Execute = {
|
||||
if ($Script:Reporting['GPOBlockedInheritance']['Exclusions']) {
|
||||
Get-GPOZaurrInheritance -IncludeBlockedObjects -IncludeExcludedObjects -OnlyBlockedInheritance -IncludeGroupPoliciesForBlockedObjects -Forest $Forest -IncludeDomains $IncludeDomains -ExcludeDomains $Excludeomains -Exclusions $Script:Reporting['GPOBlockedInheritance']['Exclusions']
|
||||
Get-GPOZaurrInheritance -IncludeBlockedObjects -IncludeExcludedObjects -OnlyBlockedInheritance -IncludeGroupPoliciesForBlockedObjects -Forest $Forest -IncludeDomains $IncludeDomains -ExcludeDomains $ExcludeDomains -Exclusions $Script:Reporting['GPOBlockedInheritance']['Exclusions']
|
||||
} else {
|
||||
Get-GPOZaurrInheritance -IncludeBlockedObjects -IncludeExcludedObjects -OnlyBlockedInheritance -IncludeGroupPoliciesForBlockedObjects -Forest $Forest -IncludeDomains $IncludeDomains -ExcludeDomains $Excludeomains
|
||||
Get-GPOZaurrInheritance -IncludeBlockedObjects -IncludeExcludedObjects -OnlyBlockedInheritance -IncludeGroupPoliciesForBlockedObjects -Forest $Forest -IncludeDomains $IncludeDomains -ExcludeDomains $ExcludeDomains
|
||||
}
|
||||
}
|
||||
Processing = {
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#$Script:Reporting['GPOOrganizationalUnit']['Variables']['WillFixPerDomain'][$OU.DomainName]++
|
||||
} elseif ($OU.Status -contains 'Excluded' -or $OU.Status -contains 'Excluded, Default OU') {
|
||||
$Script:Reporting['GPOOrganizationalUnit']['Variables']['Excluded']++
|
||||
$Script:Reporting['GPOOrganizationalUnit']['Variables']['ExcludedOU'].Add($OU.Organizationalunit)
|
||||
$null = $Script:Reporting['GPOOrganizationalUnit']['Variables']['ExcludedOU'].Add($OU.Organizationalunit)
|
||||
} else {
|
||||
$Script:Reporting['GPOOrganizationalUnit']['Variables']['Legitimate']++
|
||||
}
|
||||
@@ -52,6 +52,7 @@
|
||||
DeleteOU = 0
|
||||
Legitimate = 0
|
||||
Excluded = 0
|
||||
# Since we're using Copy-Dictionary this will get translated to Array List
|
||||
ExcludedOU = [System.Collections.Generic.List[string]]::new()
|
||||
WillFix = 0
|
||||
WillFixPerDomain = $null
|
||||
@@ -209,13 +210,13 @@
|
||||
} -LineBreak
|
||||
New-HTMLText -Text 'Once happy with results please follow with command (this will start removal process): ' -LineBreak -FontWeight bold
|
||||
New-HTMLCodeBlock -Code {
|
||||
Remove-GPOZaurrLinkEmptyOU -WhatIf -LimitProcessing 2 -Verbose
|
||||
Remove-GPOZaurrLinkEmptyOU -LimitProcessing 2 -Verbose
|
||||
}
|
||||
New-HTMLText -TextBlock {
|
||||
"Alternatively for multi-domain scenario, if you have limited Domain Admin credentials to a single domain please use following command: "
|
||||
}
|
||||
New-HTMLCodeBlock -Code {
|
||||
Remove-GPOZaurrLinkEmptyOU -WhatIf -LimitProcessing 2 -Verbose -IncludeDomains 'YourDomainYouHavePermissionsFor'
|
||||
Remove-GPOZaurrLinkEmptyOU -LimitProcessing 2 -Verbose -IncludeDomains 'YourDomainYouHavePermissionsFor'
|
||||
}
|
||||
New-HTMLText -TextBlock {
|
||||
"This command when executed deletes only first X broken GPOs. Use LimitProcessing parameter to prevent mass delete and increase the counter when no errors occur. "
|
||||
|
||||
@@ -1,4 +1,26 @@
|
||||
function New-GPOZaurrExclusions {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Creates exclusion code for Group Policy Objects (GPOs) in Zaurr format.
|
||||
|
||||
.DESCRIPTION
|
||||
The New-GPOZaurrExclusions function generates exclusion code for GPOs in Zaurr format based on the provided exclusions. It supports both script block and array types of exclusions.
|
||||
|
||||
.PARAMETER Exclusions
|
||||
Specifies the exclusions to be included in the generated code. This parameter accepts script blocks or arrays of exclusion items.
|
||||
|
||||
.EXAMPLE
|
||||
$exclusions = {
|
||||
# Exclude specific settings
|
||||
'Setting1',
|
||||
'Setting2'
|
||||
}
|
||||
New-GPOZaurrExclusions -Exclusions $exclusions
|
||||
|
||||
.EXAMPLE
|
||||
$exclusions = @('Setting1', 'Setting2')
|
||||
New-GPOZaurrExclusions -Exclusions $exclusions
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[alias('ExcludeGroupPolicies', 'ExclusionsCode', 'ExclusionsArray')][Parameter(Position = 1)][object] $Exclusions
|
||||
|
||||
@@ -1,4 +1,22 @@
|
||||
function New-GPOZaurrReportConsole {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Generates a detailed report of Group Policy Objects (GPO) applied to a computer and user.
|
||||
|
||||
.DESCRIPTION
|
||||
This function provides a comprehensive overview of the Group Policy Objects (GPO) applied to a specific computer and user. It includes information such as last applied time, computer details, domain name, organizational unit, site, GPO types, slow link status, applied GPOs, and denied GPOs.
|
||||
|
||||
.PARAMETER Results
|
||||
An IDictionary containing the results of Group Policy Object queries for both computer and user.
|
||||
|
||||
.PARAMETER ComputerName
|
||||
The name of the computer for which the GPO report is generated.
|
||||
|
||||
.EXAMPLE
|
||||
New-GPOZaurrReportConsole -Results $Results -ComputerName "MyComputer"
|
||||
Generates a detailed report of Group Policy Objects applied to the computer named "MyComputer".
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[System.Collections.IDictionary] $Results,
|
||||
|
||||
@@ -1,4 +1,35 @@
|
||||
function New-GPOZaurrReportHTML {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Generates an HTML report based on Group Policy information.
|
||||
|
||||
.DESCRIPTION
|
||||
The New-GPOZaurrReportHTML function generates an HTML report based on the Group Policy information provided. It includes detailed sections for general computer information, CPU and RAM details, operating system information, and disk information.
|
||||
|
||||
.PARAMETER Support
|
||||
Specifies the Group Policy support information to be included in the report.
|
||||
|
||||
.PARAMETER Path
|
||||
Specifies the path where the HTML report will be saved. If not provided, a temporary file will be created.
|
||||
|
||||
.PARAMETER Online
|
||||
Indicates whether to generate an online report.
|
||||
|
||||
.PARAMETER Open
|
||||
Indicates whether to open the generated report after creation.
|
||||
|
||||
.EXAMPLE
|
||||
New-GPOZaurrReportHTML -Support $GPOInfo -Path "C:\Reports\GPOReport.html"
|
||||
Generates an HTML report based on the Group Policy information in $GPOInfo and saves it to the specified path.
|
||||
|
||||
.EXAMPLE
|
||||
New-GPOZaurrReportHTML -Support $GPOInfo -Online
|
||||
Generates an online HTML report based on the Group Policy information in $GPOInfo.
|
||||
|
||||
.EXAMPLE
|
||||
New-GPOZaurrReportHTML -Support $GPOInfo -Path "C:\Reports\GPOReport.html" -Open
|
||||
Generates an HTML report based on the Group Policy information in $GPOInfo, saves it to the specified path, and opens the report after creation.
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[System.Collections.IDictionary] $Support,
|
||||
|
||||
@@ -1,4 +1,32 @@
|
||||
function New-HTMLReportAll {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Generates an HTML report based on specified parameters.
|
||||
|
||||
.DESCRIPTION
|
||||
This function generates an HTML report with customizable content based on the provided parameters. It supports generating standard reports and can be used for various reporting purposes.
|
||||
|
||||
.PARAMETER FilePath
|
||||
Specifies the file path where the HTML report will be saved.
|
||||
|
||||
.PARAMETER Online
|
||||
Indicates whether the report should be generated online.
|
||||
|
||||
.PARAMETER HideHTML
|
||||
Hides the HTML content of the report if specified.
|
||||
|
||||
.PARAMETER Type
|
||||
Specifies the type of report to generate.
|
||||
|
||||
.EXAMPLE
|
||||
New-HTMLReportAll -FilePath "C:\Reports\Report.html" -Online -Type "Summary"
|
||||
Generates an HTML report with a summary of data and saves it to the specified file path.
|
||||
|
||||
.EXAMPLE
|
||||
New-HTMLReportAll -FilePath "C:\Reports\FullReport.html" -Type "Detailed"
|
||||
Generates a detailed HTML report and saves it to the specified file path.
|
||||
|
||||
#>
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[string] $FilePath,
|
||||
|
||||
@@ -1,4 +1,34 @@
|
||||
function New-HTMLReportWithSplit {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Creates an HTML report with the option to split it into multiple files for easier viewing.
|
||||
|
||||
.DESCRIPTION
|
||||
This function generates an HTML report based on the provided parameters. It also allows splitting the report into multiple files for better organization and readability.
|
||||
|
||||
.PARAMETER FilePath
|
||||
Specifies the path where the HTML report will be saved.
|
||||
|
||||
.PARAMETER Online
|
||||
Indicates whether the report should be generated for online viewing.
|
||||
|
||||
.PARAMETER HideHTML
|
||||
Hides the HTML report file after generation.
|
||||
|
||||
.PARAMETER CurrentReport
|
||||
Specifies the type of the current report to generate.
|
||||
|
||||
.EXAMPLE
|
||||
New-HTMLReportWithSplit -FilePath "C:\Reports\GPO_Report.html" -Online -HideHTML -CurrentReport "Security"
|
||||
|
||||
Generates an HTML report for the "Security" report type and saves it to the specified file path. The report is optimized for online viewing and the HTML file is hidden after generation.
|
||||
|
||||
.EXAMPLE
|
||||
New-HTMLReportWithSplit -FilePath "C:\Reports\All_Reports.html" -CurrentReport "All"
|
||||
|
||||
Generates an HTML report for all available report types and saves it to the specified file path.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[string] $FilePath,
|
||||
|
||||
@@ -1,4 +1,33 @@
|
||||
function Remove-PrivPermission {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Removes a specified permission from a Group Policy Object (GPO).
|
||||
|
||||
.DESCRIPTION
|
||||
This function removes a specified permission from a GPO based on the provided Principal and PrincipalType. It supports removing permissions by DistinguishedName or SID. It also provides the option to include specific permission types.
|
||||
|
||||
.PARAMETER Principal
|
||||
Specifies the principal for which the permission needs to be removed.
|
||||
|
||||
.PARAMETER PrincipalType
|
||||
Specifies the type of the principal. Valid values are 'DistinguishedName', 'Name', or 'Sid'.
|
||||
|
||||
.PARAMETER GPOPermission
|
||||
Specifies the GPO permission object to remove.
|
||||
|
||||
.PARAMETER IncludePermissionType
|
||||
Specifies the permission type to include in the removal process.
|
||||
|
||||
.EXAMPLE
|
||||
Remove-PrivPermission -Principal "CN=User1,OU=Users,DC=Contoso,DC=com" -PrincipalType "DistinguishedName" -GPOPermission $PermissionObject -IncludePermissionType "Read"
|
||||
|
||||
This example removes the "Read" permission for the user with the specified DistinguishedName from the GPO.
|
||||
|
||||
.EXAMPLE
|
||||
Remove-PrivPermission -Principal "S-1-5-21-3623811015-3361044348-30300820-1013" -PrincipalType "Sid" -GPOPermission $PermissionObject -IncludePermissionType "Write"
|
||||
|
||||
This example removes the "Write" permission for the user with the specified SID from the GPO.
|
||||
#>
|
||||
[cmdletBinding(SupportsShouldProcess)]
|
||||
param(
|
||||
[string] $Principal,
|
||||
|
||||
@@ -1,4 +1,16 @@
|
||||
function Reset-GPOZaurrStatus {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Resets the status of GPO configurations.
|
||||
|
||||
.DESCRIPTION
|
||||
This function resets the status of GPO configurations by enabling the default types and disabling all other types.
|
||||
|
||||
.EXAMPLE
|
||||
Reset-GPOZaurrStatus
|
||||
Resets the status of GPO configurations to default.
|
||||
|
||||
#>
|
||||
param(
|
||||
|
||||
)
|
||||
|
||||
@@ -1,4 +1,32 @@
|
||||
function Test-SysVolFolders {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Tests the SYSVOL folders for discrepancies between Group Policy Objects (GPOs) in Active Directory and SYSVOL.
|
||||
|
||||
.DESCRIPTION
|
||||
The Test-SysVolFolders function compares the GPOs in Active Directory with the GPOs stored in the SYSVOL folder to identify any discrepancies. It checks for missing GPOs, GPOs not available in SYSVOL, and orphaned GPOs.
|
||||
|
||||
.PARAMETER GPOs
|
||||
An array of Group Policy Objects to be compared.
|
||||
|
||||
.PARAMETER Server
|
||||
The server name where the SYSVOL folder is located.
|
||||
|
||||
.PARAMETER Domain
|
||||
The domain name where the SYSVOL folder is located.
|
||||
|
||||
.PARAMETER PoliciesAD
|
||||
A dictionary containing the GPOs from Active Directory.
|
||||
|
||||
.PARAMETER PoliciesSearchBase
|
||||
The search base for the GPOs in Active Directory.
|
||||
|
||||
.EXAMPLE
|
||||
Test-SysVolFolders -GPOs $GPOs -Server "DC01" -Domain "contoso.com" -PoliciesAD $PoliciesAD -PoliciesSearchBase "OU=Group Policies,DC=contoso,DC=com"
|
||||
Description:
|
||||
This example tests the SYSVOL folders for discrepancies using the specified parameters.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[Array] $GPOs,
|
||||
|
||||
@@ -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 computer.
|
||||
|
||||
.DESCRIPTION
|
||||
The Find-CSExtension function lists Group Policy Client Side Extensions (CSEs) configured on a Windows 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,41 +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
|
||||
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(
|
||||
@@ -69,7 +72,7 @@
|
||||
}
|
||||
if ($InheritanceInformation.BlockedInheritance -and $IncludeGroupPoliciesForBlockedObjects.IsPresent) {
|
||||
try {
|
||||
$GPInheritance = Get-GPInheritance -Target $OU.distinguishedName -ErrorAction Stop
|
||||
$GPInheritance = Get-GPInheritance -Target $OU.distinguishedName -ErrorAction Stop -Domain $InheritanceInformation.DomainName
|
||||
} catch {
|
||||
Write-Warning -Message "Get-GPOZaurrInheritance - Can't get GPInheritance for $($OU.distinguishedName). Error: $($_.Exception.Message)"
|
||||
continue
|
||||
|
||||
@@ -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) links based on specified criteria.
|
||||
|
||||
.DESCRIPTION
|
||||
This function retrieves GPO links based on various parameters such as ADObject, Filter, Linked, Site, etc. It provides flexibility in searching for GPO links within Active Directory.
|
||||
|
||||
.PARAMETER ADObject
|
||||
Specifies the Active Directory object(s) to search for GPO links.
|
||||
|
||||
.PARAMETER Filter
|
||||
Specifies the filter criteria to search for GPO links.
|
||||
|
||||
.PARAMETER SearchBase
|
||||
Specifies the search base for filtering GPO links.
|
||||
|
||||
.PARAMETER SearchScope
|
||||
Specifies the search scope for filtering GPO 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 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 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 WMI filter based on a WMI filter query.
|
||||
|
||||
.DESCRIPTION
|
||||
This function creates a new WMI filter in Active Directory based on a specified WMI filter query.
|
||||
|
||||
.PARAMETER Name
|
||||
The name of the new WMI filter to be created.
|
||||
|
||||
.PARAMETER Description
|
||||
The description for the new WMI filter. 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 WMI entry.
|
||||
|
||||
.PARAMETER SkipQueryCheck
|
||||
Switch to skip the query check before creating the WMI entry.
|
||||
|
||||
.PARAMETER Force
|
||||
Switch to force the creation of the WMI entry without confirmation.
|
||||
|
||||
.PARAMETER Forest
|
||||
The forest to target for WMI creation.
|
||||
|
||||
.PARAMETER ExcludeDomains
|
||||
An array of domains to exclude from WMI application.
|
||||
|
||||
.PARAMETER IncludeDomains
|
||||
An array of domains to include for WMI application.
|
||||
|
||||
.PARAMETER ExtendedForestInformation
|
||||
Additional information about the forest for WMI customization.
|
||||
|
||||
.EXAMPLE
|
||||
New-GPOZaurrWMI -Name "TestWMIFilter1" -Query "SELECT * FROM Win32_OperatingSystem" -Force
|
||||
Creates a new WMI filter named "TestWMIFilter1" targeting all Windows operating systems.
|
||||
|
||||
.EXAMPLE
|
||||
New-GPOZaurrWMI -Name "TestWMIFilter2" -Query "SELECT * FROM Win32_Processor" -Forest "Contoso" -IncludeDomains "FinanceDomain"
|
||||
Creates a new WMI filter named "TestWMIFilter2" 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 WMI filters based on specified criteria.
|
||||
|
||||
.DESCRIPTION
|
||||
This function removes WMI filters 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 WMI filters to be removed.
|
||||
|
||||
.PARAMETER Name
|
||||
Specifies an array of names of the WMI filters to be removed.
|
||||
|
||||
.PARAMETER Forest
|
||||
Specifies the forest name where the WMI filters 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 WMI filter with the specified GUID.
|
||||
|
||||
.EXAMPLE
|
||||
Remove-GPOZaurrWMI -Name "TestWMIFilter"
|
||||
|
||||
Description
|
||||
-----------
|
||||
Removes the WMI filter 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,
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user