Added or improved help on all functions.

This commit is contained in:
neztach
2024-07-05 13:00:03 -05:00
parent bd103a513b
commit 92f3fcb692
97 changed files with 3074 additions and 35 deletions
+28
View File
@@ -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,
+25
View File
@@ -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,
+25
View File
@@ -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,
+28
View File
@@ -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,
+25
View File
@@ -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,
+34
View File
@@ -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,
+28
View File
@@ -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,
+25
View File
@@ -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,
+22
View File
@@ -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,
+23
View File
@@ -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,
+31
View File
@@ -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,
+22
View File
@@ -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,
+22
View File
@@ -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,
+28
View File
@@ -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
+22
View File
@@ -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,
+22
View File
@@ -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,
+22
View File
@@ -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,
+22
View File
@@ -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,
+21
View File
@@ -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,
+21
View File
@@ -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,
+22
View File
@@ -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,
+15
View File
@@ -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
+21
View File
@@ -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,
+33
View File
@@ -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
+34
View File
@@ -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 = '*',
+29
View File
@@ -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,
+33
View File
@@ -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,
+41
View File
@@ -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,
+39
View File
@@ -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,
+17 -17
View File
@@ -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(
+47
View File
@@ -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,
+23
View File
@@ -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,
+25
View File
@@ -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,
+44
View File
@@ -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,
+29
View File
@@ -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,
+65
View File
@@ -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,
+47
View File
@@ -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,
+28
View File
@@ -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,
+22
View File
@@ -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
+18
View File
@@ -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,
+31
View File
@@ -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,
+28
View File
@@ -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,
+30
View File
@@ -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,
+29
View File
@@ -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,
+12
View File
@@ -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(
)
+28
View File
@@ -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,