changed: verboseoutlog to outlog (reducing runtime)
This commit is contained in:
parent
9acdffdbb8
commit
9e18f320cd
9 changed files with 434 additions and 437 deletions
|
|
@ -17,7 +17,7 @@ per institute (down from 10 h; do not regress this).
|
|||
| `Process-ADObjects.ps1` | Main entry, loads config, dot-sources the rest |
|
||||
| `Process-ADObjects-Configuration.ps1` | `$Config` hashtable: institutes, GroupManagementMappings, flags (`TestMode`, `Verbose`, ...). Pure data, no logic |
|
||||
| `Process-ADObjects-Base.ps1` | Core lookups: membership index (`newObjectMembershipsIndex`, `getObjectMemberships`, `getUsersByMemberGroup`), `getRoleType`, prefix matcher (`buildPrefixMatcher`, `testKnownPrefixes`) |
|
||||
| `Process-ADObjects-Utility.ps1` | Logging (`openLog`/`closeLog`/`outLog`/`outLogVerbose`), input checks, exception helpers, `removeDuplicatesFromSortedList` |
|
||||
| `Process-ADObjects-Utility.ps1` | Logging (`openLog`/`closeLog`/`outLog`/`### outLogVerbose`), input checks, exception helpers, `removeDuplicatesFromSortedList` |
|
||||
| `Process-ADObjects-Work.ps1` | Institute dispatch |
|
||||
| `Process-ADObjects-Work-R125.ps1` / `-Y015.ps1` | Per-institute processing. Structurally identical copies (deduplication planned). Sections: FileSystemAccess, AppAccess, AppConfiguration, Organisation, Security, Anwenderrollen; then post-processing (sort → dedup → Neu derivation → file writes) |
|
||||
| `Process-ADObjects-Analyze.ps1` | AD object analysis. Known incomplete; cleanup planned |
|
||||
|
|
@ -28,7 +28,7 @@ per institute (down from 10 h; do not regress this).
|
|||
- **English** for all code, comments, identifiers, log messages. German only in chat.
|
||||
- **Allman** brace style (opening brace on its own line).
|
||||
- **`utf8NoBom`** for every file output; LF is fine (runs on macOS/pwsh 7).
|
||||
- No `Write-Host` in processing code — use `outLog` / `outLogVerbose`.
|
||||
- No `Write-Host` in processing code — use `outLog` / `### outLogVerbose`.
|
||||
Exceptions: the output helpers themselves (`outLog`, `outScreen`, `dumpVar`,
|
||||
`writeExceptionInfo*`).
|
||||
- Institute code is parameterized via `$SPKID` (e.g. "R125") and `$SPKNO`
|
||||
|
|
@ -44,7 +44,7 @@ per institute (down from 10 h; do not regress this).
|
|||
- `outLog ... -ToScreen $false` — file only. Named parameter only; positional
|
||||
args all go to the message (`PositionalBinding=$false` +
|
||||
`ValueFromRemainingArguments`).
|
||||
- `outLogVerbose <args...>` — trace layer, gated by `$Config.Verbose`, never to
|
||||
- `### outLogVerbose <args...>` — trace layer, gated by `$Config.Verbose`, never to
|
||||
screen. ~440 call sites instrument every loop iteration and if/elseif/else
|
||||
branch. With `Verbose = $true` a full run writes millions of lines — use
|
||||
`TestMode` for verbose runs.
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
function analyzeADObjects
|
||||
{
|
||||
Param
|
||||
param
|
||||
(
|
||||
[Parameter(Mandatory = $false, Position = 0)]
|
||||
[bool] $startParallel = $false
|
||||
|
|
@ -18,7 +18,7 @@ function analyzeADObjects
|
|||
|
||||
if ($startParallel)
|
||||
{
|
||||
outLogVerbose 'if ($startParallel) -> true'
|
||||
### outLogVerbose 'if ($startParallel) -> true'
|
||||
Start-ThreadJob -ScriptBlock { $adObjectsOrganisation += analyzeADObjectsByType $FI.TypeTagOrganisation}
|
||||
Start-ThreadJob -ScriptBlock { $adObjectsAppAccess += analyzeADObjectsByType $FI.TypeTagAppAccess}
|
||||
Start-ThreadJob -ScriptBlock { $adObjectsFilesystemAccess += analyzeADObjectsByType $FI.TypeTagFilesystemAccess}
|
||||
|
|
@ -28,7 +28,7 @@ function analyzeADObjects
|
|||
}
|
||||
else
|
||||
{
|
||||
outLogVerbose 'else -> true (if/elseif ($startParallel) -> false)'
|
||||
### outLogVerbose 'else -> true (if/elseif ($startParallel) -> false)'
|
||||
$adObjectsOrganisation += analyzeADObjectsByType $FI.TypeTagOrganisation
|
||||
$adObjectsAppAccess += analyzeADObjectsByType $FI.TypeTagAppAccess
|
||||
$adObjectsFilesystemAccess += analyzeADObjectsByType $FI.TypeTagFilesystemAccess
|
||||
|
|
@ -63,7 +63,7 @@ function analyzeDirectoryPaths
|
|||
|
||||
function analyzeADObjectsByType
|
||||
{
|
||||
Param
|
||||
param
|
||||
(
|
||||
[Parameter(Mandatory = $true, Position = 0)]
|
||||
[String] $typeTag
|
||||
|
|
@ -77,92 +77,92 @@ function analyzeADObjectsByType
|
|||
foreach ($adObject in $ADObjects)
|
||||
{
|
||||
outLogVerbose 'foreach $adObject in $ADObjects:' $adObject.ObjectName
|
||||
if (-Not ($adObject.Description))
|
||||
if (-not ($adObject.Description))
|
||||
{
|
||||
outLogVerbose 'if (-Not ($adObject.Description)) -> true'
|
||||
### outLogVerbose 'if (-Not ($adObject.Description)) -> true'
|
||||
$adObject.Description = $Config.EmptyDescription
|
||||
}
|
||||
if ($typeTag -ieq $FI.TypeTagAppConfiguration)
|
||||
{
|
||||
outLogVerbose 'if ($typeTag -ieq $FI.TypeTagAppConfiguration) -> true'
|
||||
### outLogVerbose 'if ($typeTag -ieq $FI.TypeTagAppConfiguration) -> true'
|
||||
if ($adObject.OU -cmatch $FI.RelevantGroups.AppConfiguration.Filter)
|
||||
{
|
||||
outLogVerbose 'if ($adObject.OU -cmatch $FI.RelevantGroups.AppConfiguration.Filter) -> true'
|
||||
### outLogVerbose 'if ($adObject.OU -cmatch $FI.RelevantGroups.AppConfiguration.Filter) -> true'
|
||||
$userMemberShips = getAllUserMemberships $adObject
|
||||
$adObjectEntry = @{ObjectName = $adObject.ObjectName; Path = $adObject.OU; ShortCut = $FI.RelevantGroups.AppConfiguration.ShortCut; Description = $adObject.Description; Users = $userMemberShips}
|
||||
$adGroupObjects += $adObjectEntry
|
||||
$counter++
|
||||
if ($IsTestMode -and ($counter -gt $Config.TestMode) )
|
||||
{
|
||||
outLogVerbose 'if ($IsTestMode -and ($counter -gt $Config.TestMode)) -> true'
|
||||
### outLogVerbose 'if ($IsTestMode -and ($counter -gt $Config.TestMode)) -> true'
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif ($typeTag -ieq $FI.TypeTagAppAccess)
|
||||
{
|
||||
outLogVerbose 'elseif ($typeTag -ieq $FI.TypeTagAppAccess) -> true'
|
||||
### outLogVerbose 'elseif ($typeTag -ieq $FI.TypeTagAppAccess) -> true'
|
||||
if ($adObject.OU -cmatch $FI.RelevantGroups.AppAccess.Filter)
|
||||
{
|
||||
outLogVerbose 'if ($adObject.OU -cmatch $FI.RelevantGroups.AppAccess.Filter) -> true'
|
||||
### outLogVerbose 'if ($adObject.OU -cmatch $FI.RelevantGroups.AppAccess.Filter) -> true'
|
||||
$userMemberShips = getAllUserMemberships $adObject
|
||||
$adObjectEntry = @{ObjectName = $adObject.ObjectName; Path = $adObject.OU; ShortCut = $FI.RelevantGroups.AppAccess.ShortCut; Description = $adObject.Description; Users = $userMemberShips}
|
||||
$adGroupObjects += $adObjectEntry
|
||||
$counter++
|
||||
if ($IsTestMode -and ($counter -gt $Config.TestMode) )
|
||||
{
|
||||
outLogVerbose 'if ($IsTestMode -and ($counter -gt $Config.TestMode)) -> true'
|
||||
### outLogVerbose 'if ($IsTestMode -and ($counter -gt $Config.TestMode)) -> true'
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif ($typeTag -ieq $FI.TypeTagFileSystemAccess)
|
||||
{
|
||||
outLogVerbose 'elseif ($typeTag -ieq $FI.TypeTagFileSystemAccess) -> true'
|
||||
### outLogVerbose 'elseif ($typeTag -ieq $FI.TypeTagFileSystemAccess) -> true'
|
||||
if ($adObject.OU -cmatch $FI.RelevantGroups.FilesystemAccess.Filter)
|
||||
{
|
||||
outLogVerbose 'if ($adObject.OU -cmatch $FI.RelevantGroups.FilesystemAccess.Filter) -> true'
|
||||
### outLogVerbose 'if ($adObject.OU -cmatch $FI.RelevantGroups.FilesystemAccess.Filter) -> true'
|
||||
$userMemberShips = getAllUserMemberships $adObject
|
||||
$adObjectEntry = @{ObjectName = $adObject.ObjectName; Path = $adObject.OU; ShortCut = $FI.RelevantGroups.FilesystemAccess.ShortCut; Description = $adObject.Description; Users = $userMemberShips}
|
||||
$adGroupObjects += $adObjectEntry
|
||||
$counter++
|
||||
if ($IsTestMode -and ($counter -gt $Config.TestMode) )
|
||||
{
|
||||
outLogVerbose 'if ($IsTestMode -and ($counter -gt $Config.TestMode)) -> true'
|
||||
### outLogVerbose 'if ($IsTestMode -and ($counter -gt $Config.TestMode)) -> true'
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif ($typeTag -ieq $FI.TypeTagOrganisation)
|
||||
{
|
||||
outLogVerbose 'elseif ($typeTag -ieq $FI.TypeTagOrganisation) -> true'
|
||||
### outLogVerbose 'elseif ($typeTag -ieq $FI.TypeTagOrganisation) -> true'
|
||||
if ($adObject.OU -cmatch $FI.RelevantGroups.Organisation.Filter)
|
||||
{
|
||||
outLogVerbose 'if ($adObject.OU -cmatch $FI.RelevantGroups.Organisation.Filter) -> true'
|
||||
### outLogVerbose 'if ($adObject.OU -cmatch $FI.RelevantGroups.Organisation.Filter) -> true'
|
||||
$userMemberShips = getAllUserMemberships $adObject
|
||||
$adObjectEntry = @{ObjectName = $adObject.ObjectName; Path = $adObject.OU; ShortCut = $FI.RelevantGroups.Organisation.ShortCut; Description = $adObject.Description; Users = $userMemberShips}
|
||||
$adGroupObjects += $adObjectEntry
|
||||
$counter++
|
||||
if ($IsTestMode -and ($counter -gt $Config.TestMode) )
|
||||
{
|
||||
outLogVerbose 'if ($IsTestMode -and ($counter -gt $Config.TestMode)) -> true'
|
||||
### outLogVerbose 'if ($IsTestMode -and ($counter -gt $Config.TestMode)) -> true'
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif ($typeTag -ieq $FI.TypeTagSecurity)
|
||||
{
|
||||
outLogVerbose 'elseif ($typeTag -ieq $FI.TypeTagSecurity) -> true'
|
||||
### outLogVerbose 'elseif ($typeTag -ieq $FI.TypeTagSecurity) -> true'
|
||||
if ($adObject.OU -cmatch $FI.RelevantGroups.Security.Filter)
|
||||
{
|
||||
outLogVerbose 'if ($adObject.OU -cmatch $FI.RelevantGroups.Security.Filter) -> true'
|
||||
### outLogVerbose 'if ($adObject.OU -cmatch $FI.RelevantGroups.Security.Filter) -> true'
|
||||
$userMemberShips = getAllUserMemberships $adObject
|
||||
$adObjectEntry = @{ObjectName = $adObject.ObjectName; Path = $adObject.OU; ShortCut = $FI.RelevantGroups.Security.ShortCut; Description = $adObject.Description; Users = $userMemberShips}
|
||||
$adGroupObjects += $adObjectEntry
|
||||
$counter++
|
||||
if ($IsTestMode -and ($counter -gt $Config.TestMode) )
|
||||
{
|
||||
outLogVerbose 'if ($IsTestMode -and ($counter -gt $Config.TestMode)) -> true'
|
||||
### outLogVerbose 'if ($IsTestMode -and ($counter -gt $Config.TestMode)) -> true'
|
||||
break
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ function getObjectMemberships
|
|||
}
|
||||
else
|
||||
{
|
||||
outLogVerbose 'else -> true (if/elseif (?) -> false)'
|
||||
### outLogVerbose 'else -> true (if/elseif (?) -> false)'
|
||||
@($bucket)
|
||||
}
|
||||
|
||||
|
|
@ -60,7 +60,7 @@ function getAllUserMemberships
|
|||
$groupMemberships = @(getObjectMemberships $adObjectEntry.ObjectName "group" "group")
|
||||
foreach ($groupMembership in $groupMemberships)
|
||||
{
|
||||
outLogVerbose 'foreach $groupMembership in $groupMemberships:' $groupMembership.MemberName
|
||||
### outLogVerbose 'foreach $groupMembership in $groupMemberships:' $groupMembership.MemberName
|
||||
$result.AddRange(@(getObjectMemberships $groupMembership.MemberName "user" "group"))
|
||||
}
|
||||
return @($result)
|
||||
|
|
@ -81,7 +81,7 @@ function getUsersByMemberGroup
|
|||
}
|
||||
else
|
||||
{
|
||||
outLogVerbose 'else -> true (if/elseif (?) -> false)'
|
||||
### outLogVerbose 'else -> true (if/elseif (?) -> false)'
|
||||
@($bucket)
|
||||
}
|
||||
return $result
|
||||
|
|
@ -118,18 +118,18 @@ function newObjectMembershipsIndex
|
|||
|
||||
foreach ($entry in $ADObjectMemberships)
|
||||
{
|
||||
outLogVerbose 'foreach $entry in $ADObjectMemberships:' $entry.GroupName
|
||||
### outLogVerbose 'foreach $entry in $ADObjectMemberships:' $entry.GroupName
|
||||
$key = getMembershipIndexKey $($entry.GroupName) $($entry.MemberClass)
|
||||
$key0 = "$($entry.GroupName)`0$($entry.MemberClass)".ToLowerInvariant()
|
||||
if (-not($key -eq $key0))
|
||||
{
|
||||
outLogVerbose 'if (-not($key -eq $key0)) -> true'
|
||||
### outLogVerbose 'if (-not($key -eq $key0)) -> true'
|
||||
throw "this is BAAAD"
|
||||
}
|
||||
$bucket = $index[$key]
|
||||
if ($null -eq $bucket)
|
||||
{
|
||||
outLogVerbose 'if ($null -eq $bucket) -> true'
|
||||
### outLogVerbose 'if ($null -eq $bucket) -> true'
|
||||
$bucket = [System.Collections.Generic.List[object]]::new()
|
||||
$index[$key] = $bucket
|
||||
}
|
||||
|
|
@ -152,17 +152,17 @@ function getRoleType
|
|||
$relevantRoleTypes = $SPK.GroupManagementMappings | Where-Object {$_.OU -ieq $typeTag} | Sort-Object { [int]$_.Order }
|
||||
foreach ($relevantRoleType in $relevantRoleTypes)
|
||||
{
|
||||
outLogVerbose 'foreach $relevantRoleType in $relevantRoleTypes:' $relevantRoleType.TypeName
|
||||
### outLogVerbose 'foreach $relevantRoleType in $relevantRoleTypes:' $relevantRoleType.TypeName
|
||||
if ($adObjectEntry.OldName -cmatch $relevantRoleType.TagRegExp)
|
||||
{
|
||||
outLogVerbose 'if ($adObjectEntry.OldName -cmatch $relevantRoleType.TagRegExp) -> true'
|
||||
### outLogVerbose 'if ($adObjectEntry.OldName -cmatch $relevantRoleType.TagRegExp) -> true'
|
||||
$roleType = $relevantRoleType.TypeName
|
||||
break
|
||||
}
|
||||
}
|
||||
if (($typeTag -ieq $FI.TypeTagSecurity) -and ($roleType -ieq "unknown"))
|
||||
{
|
||||
outLogVerbose 'if (($typeTag -ieq $FI.TypeTagSecurity) -and ($roleType -ieq "unknown")) -> true'
|
||||
### outLogVerbose 'if (($typeTag -ieq $FI.TypeTagSecurity) -and ($roleType -ieq "unknown")) -> true'
|
||||
$roleType = "GPO"
|
||||
}
|
||||
return $roletype
|
||||
|
|
@ -177,7 +177,7 @@ function buildPrefixMatcher
|
|||
|
||||
if (-not (Test-Path $CsvPath))
|
||||
{
|
||||
outLogVerbose 'if (-not (Test-Path $CsvPath)) -> true'
|
||||
### outLogVerbose 'if (-not (Test-Path $CsvPath)) -> true'
|
||||
throw "Prefix CSV not found: $CsvPath"
|
||||
}
|
||||
|
||||
|
|
@ -185,11 +185,11 @@ function buildPrefixMatcher
|
|||
|
||||
foreach ($row in $SPK.ProfilPrefixes)
|
||||
{
|
||||
outLogVerbose 'foreach $row in $SPK.ProfilPrefixes:' $row
|
||||
### outLogVerbose 'foreach $row in $SPK.ProfilPrefixes:' $row
|
||||
$prefix = $row.Prefix
|
||||
if ([string]::IsNullOrEmpty($prefix))
|
||||
{
|
||||
outLogVerbose 'if ([string]::IsNullOrEmpty($prefix)) -> true'
|
||||
### outLogVerbose 'if ([string]::IsNullOrEmpty($prefix)) -> true'
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
@ -197,7 +197,7 @@ function buildPrefixMatcher
|
|||
$bucket = $null
|
||||
if (-not $byLength.TryGetValue($len, [ref] $bucket))
|
||||
{
|
||||
outLogVerbose 'if (-not $byLength.TryGetValue($len, [ref] $bucket)) -> true'
|
||||
### outLogVerbose 'if (-not $byLength.TryGetValue($len, [ref] $bucket)) -> true'
|
||||
$bucket = [System.Collections.Generic.HashSet[string]]::new([System.StringComparer]::Ordinal)
|
||||
$byLength[$len] = $bucket
|
||||
}
|
||||
|
|
@ -223,24 +223,24 @@ function testKnownPrefixes
|
|||
|
||||
if ([string]::IsNullOrEmpty($Value))
|
||||
{
|
||||
outLogVerbose 'if ([string]::IsNullOrEmpty($Value)) -> true'
|
||||
### outLogVerbose 'if ([string]::IsNullOrEmpty($Value)) -> true'
|
||||
return $false
|
||||
}
|
||||
|
||||
$valueLen = $Value.Length
|
||||
foreach ($len in $Matcher.Lengths)
|
||||
{
|
||||
outLogVerbose 'foreach $len in $Matcher.Lengths:' $len
|
||||
### outLogVerbose 'foreach $len in $Matcher.Lengths:' $len
|
||||
if ($len -gt $valueLen)
|
||||
{
|
||||
outLogVerbose 'if ($len -gt $valueLen) -> true'
|
||||
### outLogVerbose 'if ($len -gt $valueLen) -> true'
|
||||
continue
|
||||
}
|
||||
$candidate = $Value.Substring(0, $len)
|
||||
$bucket = $Matcher.ByLength[$len]
|
||||
if ($bucket.Contains($candidate))
|
||||
{
|
||||
outLogVerbose 'if ($bucket.Contains($candidate)) -> true'
|
||||
### outLogVerbose 'if ($bucket.Contains($candidate)) -> true'
|
||||
return $true
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,9 +14,9 @@ function TestExcel {
|
|||
$colCount = $workSheet.UsedRange.LastColumn
|
||||
|
||||
for ($i = 2; $i -le $rowCount; $i++) {
|
||||
outLogVerbose 'for ($i = 2; $i -le $rowCount; $i++) iteration:' $i
|
||||
outLog ('for ($i = 2; $i -le $rowCount; $i++) iteration: ' + $i)
|
||||
for ($j = 1; $j -le $colCount; $j++) {
|
||||
outLogVerbose 'for ($j = 1; $j -le $colCount; $j++) iteration:' $j
|
||||
### outLogVerbose 'for ($j = 1; $j -le $colCount; $j++) iteration:' $j
|
||||
$value = $workSheet.Range[$i, $j].DisplayText
|
||||
$newValue = $value -replace "`n", " --- " -replace "`r", " --- " -replace ";", "--" -replace "`"", "'"
|
||||
$workSheet.Range[$i, $j].Text = $newValue
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
function convertUTF8ToASCII
|
||||
{
|
||||
param ([Parameter(Mandatory = $true, Position = 0)] [String]$utf8Text)
|
||||
|
|
@ -89,6 +88,7 @@ function removeDuplicatesFromSortedList
|
|||
param
|
||||
(
|
||||
[Parameter(Mandatory = $true)]
|
||||
[AllowEmptyCollection()]
|
||||
[System.Collections.Generic.List[string]] $List,
|
||||
[Parameter(Mandatory = $false)]
|
||||
[string] $ListName = "list"
|
||||
|
|
@ -344,13 +344,6 @@ function moveToInstituteTmpPath
|
|||
return $tmpFilePath
|
||||
}
|
||||
|
||||
function convertUTF8ToASCII
|
||||
{
|
||||
param ([Parameter(Mandatory = $true, Position = 0)][string]$text)
|
||||
$utf8Text = [system.text.encoding]::UTF8.GetBytes($text)
|
||||
$asciiText = [system.text.encoding]::convert([text.encoding]::UTF8, [text.encoding]::ASCII, $utf8Text)
|
||||
-join [system.text.encoding]::ASCII.GetChars($asciiText)
|
||||
}
|
||||
|
||||
|
||||
function writeExceptionInfoReduced
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -8,17 +8,17 @@ function prepareADObjectsByType {
|
|||
$counter = 1
|
||||
$count = $ADObjects.Count
|
||||
foreach ($adObject in $ADObjects) {
|
||||
outLogVerbose 'foreach $adObject in $ADObjects:' $adObject.ObjectName
|
||||
outLog ('foreach $adObject in $ADObjects: ' + $adObject.ObjectName)
|
||||
if (-Not ($adObject.Description)) {
|
||||
outLogVerbose 'if (-Not ($adObject.Description)) -> true'
|
||||
### outLogVerbose 'if (-Not ($adObject.Description)) -> true'
|
||||
$adObject.Description = $Config.EmptyDescription
|
||||
}
|
||||
|
||||
$currentADObject = $null
|
||||
if ($typeTag -ieq $FI.TypeTagAppConfiguration) {
|
||||
outLogVerbose 'if ($typeTag -ieq $FI.TypeTagAppConfiguration) -> true'
|
||||
### outLogVerbose 'if ($typeTag -ieq $FI.TypeTagAppConfiguration) -> true'
|
||||
if ($adObject.OU -cmatch $FI.RelevantGroups.AppConfiguration.Filter) {
|
||||
outLogVerbose 'if ($adObject.OU -cmatch $FI.RelevantGroups.AppConfiguration.Filter) -> true'
|
||||
### outLogVerbose 'if ($adObject.OU -cmatch $FI.RelevantGroups.AppConfiguration.Filter) -> true'
|
||||
$userMemberShips = @()
|
||||
$adObjectEntry = @{ObjectName = $adObject.ObjectName; Path = $adObject.OU; ShortCut = $FI.RelevantGroups.AppConfiguration.ShortCut; Description = $adObject.Description; Users = $userMemberShips}
|
||||
$adObjectFileEntry = $adObject.ObjectName + ";" + $adObject.OU + ";" + $FI.RelevantGroups.AppConfiguration.ShortCut + ";" + $adObject.Description
|
||||
|
|
@ -26,15 +26,15 @@ function prepareADObjectsByType {
|
|||
$adGroupObjects += $adObjectEntry
|
||||
$counter++
|
||||
if ($IsTestMode -and ($counter -gt $Config.TestMode) ) {
|
||||
outLogVerbose 'if ($IsTestMode -and ($counter -gt $Config.TestMode)) -> true'
|
||||
### outLogVerbose 'if ($IsTestMode -and ($counter -gt $Config.TestMode)) -> true'
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif ($typeTag -ieq $FI.TypeTagAppAccess) {
|
||||
outLogVerbose 'elseif ($typeTag -ieq $FI.TypeTagAppAccess) -> true'
|
||||
### outLogVerbose 'elseif ($typeTag -ieq $FI.TypeTagAppAccess) -> true'
|
||||
if ($adObject.OU -cmatch $FI.RelevantGroups.AppAccess.Filter) {
|
||||
outLogVerbose 'if ($adObject.OU -cmatch $FI.RelevantGroups.AppAccess.Filter) -> true'
|
||||
### outLogVerbose 'if ($adObject.OU -cmatch $FI.RelevantGroups.AppAccess.Filter) -> true'
|
||||
$userMemberShips = @()
|
||||
$adObjectEntry = @{ObjectName = $adObject.ObjectName; Path = $adObject.OU; ShortCut = $FI.RelevantGroups.AppAccess.ShortCut; Description = $adObject.Description; Users = $userMemberShips}
|
||||
$adObjectFileEntry = $adObject.ObjectName + ";" + $adObject.OU + ";" + $FI.RelevantGroups.AppAccess.ShortCut + ";" + $adObject.Description
|
||||
|
|
@ -42,15 +42,15 @@ function prepareADObjectsByType {
|
|||
$adGroupObjects += $adObjectEntry
|
||||
$counter++
|
||||
if ($IsTestMode -and ($counter -gt $Config.TestMode) ) {
|
||||
outLogVerbose 'if ($IsTestMode -and ($counter -gt $Config.TestMode)) -> true'
|
||||
### outLogVerbose 'if ($IsTestMode -and ($counter -gt $Config.TestMode)) -> true'
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif ($typeTag -ieq $FI.TypeTagFileSystemAccess) {
|
||||
outLogVerbose 'elseif ($typeTag -ieq $FI.TypeTagFileSystemAccess) -> true'
|
||||
### outLogVerbose 'elseif ($typeTag -ieq $FI.TypeTagFileSystemAccess) -> true'
|
||||
if ($adObject.OU -cmatch $FI.RelevantGroups.FilesystemAccess.Filter) {
|
||||
outLogVerbose 'if ($adObject.OU -cmatch $FI.RelevantGroups.FilesystemAccess.Filter) -> true'
|
||||
### outLogVerbose 'if ($adObject.OU -cmatch $FI.RelevantGroups.FilesystemAccess.Filter) -> true'
|
||||
$userMemberShips = @()
|
||||
$adObjectEntry = @{ObjectName = $adObject.ObjectName; Path = $adObject.OU; ShortCut = $FI.RelevantGroups.FilesystemAccess.ShortCut; Description = $adObject.Description; Users = $userMemberShips}
|
||||
$adObjectFileEntry = $adObject.ObjectName + ";" + $adObject.OU + ";" + $FI.RelevantGroups.FilesystemAccess.ShortCut + ";" + $adObject.Description
|
||||
|
|
@ -58,15 +58,15 @@ function prepareADObjectsByType {
|
|||
$adGroupObjects += $adObjectEntry
|
||||
$counter++
|
||||
if ($IsTestMode -and ($counter -gt $Config.TestMode) ) {
|
||||
outLogVerbose 'if ($IsTestMode -and ($counter -gt $Config.TestMode)) -> true'
|
||||
### outLogVerbose 'if ($IsTestMode -and ($counter -gt $Config.TestMode)) -> true'
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif ($typeTag -ieq $FI.TypeTagOrganisation) {
|
||||
outLogVerbose 'elseif ($typeTag -ieq $FI.TypeTagOrganisation) -> true'
|
||||
### outLogVerbose 'elseif ($typeTag -ieq $FI.TypeTagOrganisation) -> true'
|
||||
if ($adObject.OU -cmatch $FI.RelevantGroups.Organisation.Filter) {
|
||||
outLogVerbose 'if ($adObject.OU -cmatch $FI.RelevantGroups.Organisation.Filter) -> true'
|
||||
### outLogVerbose 'if ($adObject.OU -cmatch $FI.RelevantGroups.Organisation.Filter) -> true'
|
||||
$userMemberShips = @()
|
||||
$adObjectEntry = @{ObjectName = $adObject.ObjectName; Path = $adObject.OU; ShortCut = $FI.RelevantGroups.Organisation.ShortCut; Description = $adObject.Description; Users = $userMemberShips}
|
||||
$adObjectFileEntry = $adObject.ObjectName + ";" + $adObject.OU + ";" + $FI.RelevantGroups.Organisation.ShortCut + ";" + $adObject.Description
|
||||
|
|
@ -74,15 +74,15 @@ function prepareADObjectsByType {
|
|||
$adGroupObjects += $adObjectEntry
|
||||
$counter++
|
||||
if ($IsTestMode -and ($counter -gt $Config.TestMode) ) {
|
||||
outLogVerbose 'if ($IsTestMode -and ($counter -gt $Config.TestMode)) -> true'
|
||||
### outLogVerbose 'if ($IsTestMode -and ($counter -gt $Config.TestMode)) -> true'
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif ($typeTag -ieq $FI.TypeTagSecurity) {
|
||||
outLogVerbose 'elseif ($typeTag -ieq $FI.TypeTagSecurity) -> true'
|
||||
### outLogVerbose 'elseif ($typeTag -ieq $FI.TypeTagSecurity) -> true'
|
||||
if ($adObject.OU -cmatch $FI.RelevantGroups.Security.Filter) {
|
||||
outLogVerbose 'if ($adObject.OU -cmatch $FI.RelevantGroups.Security.Filter) -> true'
|
||||
### outLogVerbose 'if ($adObject.OU -cmatch $FI.RelevantGroups.Security.Filter) -> true'
|
||||
$userMemberShips = @()
|
||||
$adObjectEntry = @{ObjectName = $adObject.ObjectName; Path = $adObject.OU; ShortCut = $FI.RelevantGroups.Security.ShortCut; Description = $adObject.Description; Users = $userMemberShips}
|
||||
$adObjectFileEntry = $adObject.ObjectName + ";" + $adObject.OU + ";" + $FI.RelevantGroups.Security.ShortCut + ";" + $adObject.Description
|
||||
|
|
@ -90,16 +90,16 @@ function prepareADObjectsByType {
|
|||
$adGroupObjects += $adObjectEntry
|
||||
$counter++
|
||||
if ($IsTestMode -and ($counter -gt $Config.TestMode) ) {
|
||||
outLogVerbose 'if ($IsTestMode -and ($counter -gt $Config.TestMode)) -> true'
|
||||
### outLogVerbose 'if ($IsTestMode -and ($counter -gt $Config.TestMode)) -> true'
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif ($typeTag -ieq $FI.TypeTagRole) {
|
||||
outLogVerbose 'elseif ($typeTag -ieq $FI.TypeTagRole) -> true'
|
||||
### outLogVerbose 'elseif ($typeTag -ieq $FI.TypeTagRole) -> true'
|
||||
|
||||
if ($adObject.OU -like "*Anwenderrollen*") {
|
||||
outLogVerbose 'if ($adObject.OU -like "*Anwenderrollen*") -> true'
|
||||
### outLogVerbose 'if ($adObject.OU -like "*Anwenderrollen*") -> true'
|
||||
$userMemberShips = @()
|
||||
$adObjectEntry = @{ObjectName = $adObject.ObjectName; Path = $adObject.OU; ShortCut = $FI.RelevantGroups.Role.ShortCut; Description = $adObject.Description; Users = $userMemberShips}
|
||||
$adObjectFileEntry = $adObject.ObjectName + ";" + $adObject.OU + ";" + $FI.RelevantGroups.Role.ShortCut + ";" + $adObject.Description
|
||||
|
|
@ -109,7 +109,7 @@ function prepareADObjectsByType {
|
|||
|
||||
|
||||
if ($IsTestMode -and ($counter -gt $Config.TestMode) ) {
|
||||
outLogVerbose 'if ($IsTestMode -and ($counter -gt $Config.TestMode)) -> true'
|
||||
### outLogVerbose 'if ($IsTestMode -and ($counter -gt $Config.TestMode)) -> true'
|
||||
break
|
||||
}
|
||||
}
|
||||
|
|
|
|||
0
Process-ADObjects.ps1
Executable file → Normal file
0
Process-ADObjects.ps1
Executable file → Normal file
Loading…
Add table
Add a link
Reference in a new issue