mirror of
https://github.com/EvotecIT/GPOZaurr.git
synced 2026-07-26 11:49:17 +00:00
40 lines
1.3 KiB
PowerShell
40 lines
1.3 KiB
PowerShell
function Get-WellKnownFolders {
|
|
<#
|
|
.SYNOPSIS
|
|
Gets users and computers well known folders for a forest
|
|
|
|
.DESCRIPTION
|
|
Gets users and computers well known folders for a forest
|
|
|
|
.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
|
|
|
|
.EXAMPLE
|
|
Get-WellKnownFolders
|
|
|
|
.NOTES
|
|
General notes
|
|
#>
|
|
[cmdletBinding()]
|
|
param(
|
|
[alias('ForestName')][string] $Forest,
|
|
[string[]] $ExcludeDomains,
|
|
[alias('Domain', 'Domains')][string[]] $IncludeDomains,
|
|
[System.Collections.IDictionary] $ExtendedForestInformation
|
|
)
|
|
|
|
$ForestInformation = Get-WinADForestDetails -Forest $Forest -IncludeDomains $IncludeDomains -ExcludeDomains $ExcludeDomains -ExtendedForestInformation $ExtendedForestInformation -Extended
|
|
foreach ($Domain in $ForestInformation.Domains) {
|
|
$ForestInformation.DomainsExtended[$Domain].ComputersContainer
|
|
$ForestInformation.DomainsExtended[$Domain].UsersContainer
|
|
}
|
|
} |