diff --git a/Process-ADObjects-Configuration.ps1 b/Process-ADObjects-Configuration.ps1 index 8ac6385..28c0fc3 100644 --- a/Process-ADObjects-Configuration.ps1 +++ b/Process-ADObjects-Configuration.ps1 @@ -4,9 +4,9 @@ $Config = @{ DataRootPath = $PSScriptroot + "/Data/" EmptyDescription = "### keine Beschreibung ###" NotAvailable = "N/A" - TestMode = 3 - Verbose = $true - ToScreen = $true + TestMode = 0 + Verbose = $false + ToScreen = $false Analyze = $false ProcessDAW = $true WriteKURS = $false diff --git a/Process-ADObjects-Work-R125.ps1 b/Process-ADObjects-Work-R125.ps1 index 87e4401..cb26e63 100644 --- a/Process-ADObjects-Work-R125.ps1 +++ b/Process-ADObjects-Work-R125.ps1 @@ -7,9 +7,9 @@ function ProcessADObjects [Parameter(Mandatory = $true, Position = 1)] [String] $roletypeTag ) - $begin = Get-Date - outLog "ProcessADObjects called at: " $begin $init + $begin = Get-Date + outLog ("ProcessADObjects called at: " + $begin + $init) $adObjectEntries | Add-Member OldName "" $adObjectEntries | Add-Member GroupName "" $adObjectEntries | Add-Member GUIADGroupName "" @@ -372,9 +372,6 @@ function ProcessADObjects foreach ($item in $FileSystemAccessEntriesNew) { outLogVerbose 'foreach $item in $FileSystemAccessEntriesNew:' $item.OldName - $item | Out-String - - $roleType = "unknown" $relevantRoleTypes = $SPK.GroupManagementMappings | Where-Object { $_.OU -ieq $FI.TypeTagFilesystemAccess } | Sort-Object { [int]$_.Order } @@ -1673,10 +1670,6 @@ function ProcessADObjects $DAWGruppenverwaltungOutList.Sort($ordinalComparer) $KURSSollProfileOutList.Sort($ordinalComparer) $KURSIstMitarbeiterProfileOutList.Sort($ordinalComparer) - removeDuplicatesFromSortedList $DAWGruppenAnlegenOutList "DAWGruppenAnlegenOutList" - removeDuplicatesFromSortedList $DAWGruppenverwaltungOutList "DAWGruppenverwaltungOutList" - removeDuplicatesFromSortedList $KURSSollProfileOutList "KURSSollProfileOutList" - removeDuplicatesFromSortedList $KURSIstMitarbeiterProfileOutList "KURSIstMitarbeiterProfileOutList" $DAWGruppenverwaltungNeuOutList.Clear() $lastLdap = $null @@ -1715,5 +1708,5 @@ function ProcessADObjects $KURSSollProfileOutList.Clear() $KURSIstMitarbeiterProfileOutList.Clear() $end = Get-Date - outLog "finished: " $MyInvocation.MyCommand " on type " $roletypeTag.PadRight(30, " ") ", used " ($end - $begin) + outLog ("finished: " + $MyInvocation.MyCommand + " on type " + $roletypeTag.PadRight(30, " ") + ", used " + ($end - $begin)) } diff --git a/Process-ADObjects-Work-Y015.ps1 b/Process-ADObjects-Work-Y015.ps1 index 5d70058..cc682f7 100644 --- a/Process-ADObjects-Work-Y015.ps1 +++ b/Process-ADObjects-Work-Y015.ps1 @@ -8,7 +8,7 @@ function ProcessADObjects [String] $roletypeTag ) $begin = Get-Date - outLog "ProcessADObjects called at: " $begin $init + outLog ("ProcessADObjects called at: "+ + $begin + $init) $adObjectEntries | Add-Member OldName "" $adObjectEntries | Add-Member GroupName "" @@ -436,7 +436,7 @@ function ProcessADObjects if ($VerzeichnisArt -ieq "SPA") { outLogVerbose 'if ($VerzeichnisArt -ieq "SPA") -> true' - $ProfilNummer = "42" + ([string]$CntSPA).PadLeft(7, '0') + $ProfilNummer = "72" + ([string]$CntSPA).PadLeft(7, '0') $CntSPA++ $ProfilName = "SPA " + $NewFullName @@ -455,7 +455,7 @@ function ProcessADObjects elseif ($VerzeichnisArt -ieq "SON") { outLogVerbose 'elseif ($VerzeichnisArt -ieq "SON") -> true' - $ProfilNummer = "42" + ([string]$CntSON).PadLeft(7, '0') + $ProfilNummer = "72" + ([string]$CntSON).PadLeft(7, '0') $CntSON++ $ProfilName = "SON " + $NewFullName @@ -474,7 +474,7 @@ function ProcessADObjects elseif ($VerzeichnisArt -ieq "SPK") { outLogVerbose 'elseif ($VerzeichnisArt -ieq "SPK") -> true' - $ProfilNummer = "42" + ([string]$CntSPK).PadLeft(7, '0') + $ProfilNummer = "72" + ([string]$CntSPK).PadLeft(7, '0') $CntSPK++ $ProfilName = "SPK " + $NewFullName @@ -493,7 +493,7 @@ function ProcessADObjects elseif ($VerzeichnisArt -ieq "VRZ") { outLogVerbose 'elseif ($VerzeichnisArt -ieq "VRZ") -> true' - $ProfilNummer = "42" + ([string]$CntVRZ).PadLeft(7, '0') + $ProfilNummer = "72" + ([string]$CntVRZ).PadLeft(7, '0') $CntVRZ++ $ProfilName = "VRZ " + $NewFullName @@ -512,7 +512,7 @@ function ProcessADObjects elseif ($VerzeichnisArt -ieq "VOE") { outLogVerbose 'elseif ($VerzeichnisArt -ieq "VOE") -> true' - $ProfilNummer = "42" + ([string]$CntVOE).PadLeft(7, '0') + $ProfilNummer = "72" + ([string]$CntVOE).PadLeft(7, '0') $CntVOE++ $ProfilName = "VOE " + $NewFullName @@ -535,13 +535,13 @@ function ProcessADObjects if ($AWNRNEW -ieq "9997") { outLogVerbose 'if ($AWNRNEW -ieq "9997") -> true' - $ProfilNummer = "42" + ([string]$CntPRG).PadLeft(7, '0') + $ProfilNummer = "72" + ([string]$CntPRG).PadLeft(7, '0') $CntPRG++ } elseif ($AWNRNEW -ieq "0000") { outLogVerbose 'elseif ($AWNRNEW -ieq "0000") -> true' - $ProfilNummer = "42" + ([string]$CntPRG).PadLeft(7, '0') + $ProfilNummer = "72" + ([string]$CntPRG).PadLeft(7, '0') $CntPRG++ } else @@ -558,7 +558,7 @@ function ProcessADObjects $rbkey_array.Add("PAN_" + $AWNRNEW, 200) } - $ProfilNummer = "40" + ([string]$AWNRNEW).PadLeft(4, '0') + $rbkey_array.Item("PAN_" + $AWNRNEW) + $ProfilNummer = "70" + ([string]$AWNRNEW).PadLeft(4, '0') + $rbkey_array.Item("PAN_" + $AWNRNEW) } $NewFullName = $NewFullName.Replace("PRG_", "PRG_") @@ -579,7 +579,7 @@ function ProcessADObjects elseif ($VerzeichnisArt -ieq "PRG12") { outLogVerbose 'elseif ($VerzeichnisArt -ieq "PRG12") -> true' - $ProfilNummer = "42" + ([string]$CntPRG).PadLeft(7, '0') + $ProfilNummer = "72" + ([string]$CntPRG).PadLeft(7, '0') $CntPRG++ $ProfilName = "PROG " + $NewFullName @@ -598,7 +598,7 @@ function ProcessADObjects elseif ($VerzeichnisArt -ieq "VRZ") { outLogVerbose 'elseif ($VerzeichnisArt -ieq "VRZ") -> true' - $ProfilNummer = "42" + ([string]$CntVRZ).PadLeft(7, '0') + $ProfilNummer = "72" + ([string]$CntVRZ).PadLeft(7, '0') $CntVRZ++ $ProfilName = "VRZ " + $NewFullName @@ -617,7 +617,7 @@ function ProcessADObjects elseif ($VerzeichnisArt -ieq "SPK") { outLogVerbose 'elseif ($VerzeichnisArt -ieq "SPK") -> true' - $ProfilNummer = "42" + ([string]$CntSPK).PadLeft(7, '0') + $ProfilNummer = "72" + ([string]$CntSPK).PadLeft(7, '0') $CntSPK++ $ProfilName = "SPK " + $NewFullName @@ -1067,7 +1067,7 @@ function ProcessADObjects $MYDESC007 = $ProfilName.Replace($SPKID + "GGX-", "").Replace("Serviceportal", "SVP").Replace("Anforderungsmanagementberichte", "Anforderungsmgtberichte") - $KURSSollProfileOutLine = "40" + $AWNR + "" + ($PnrStr).ToString() + ";" + $NNNAME.Replace("-_", "-") + ";" + $MYDESC007 + ";" + $dum + ";" + $item.OldName + ";" + $MYDESC007 + ". AD Beschreibung:" + $item.'GUIADGroup.Description' + ";AppAccess" + $KURSSollProfileOutLine = "70" + $AWNR + "" + ($PnrStr).ToString() + ";" + $NNNAME.Replace("-_", "-") + ";" + $MYDESC007 + ";" + $dum + ";" + $item.OldName + ";" + $MYDESC007 + ". AD Beschreibung:" + $item.'GUIADGroup.Description' + ";AppAccess" $KURSSollProfileOutList.Add($KURSSollProfileOutLine) $ProfilNummer = "10" + $AWNR + "" + ($PnrStr).ToString() $ProfilNummerAV++ @@ -1403,7 +1403,7 @@ function ProcessADObjects } $iSonstiges = 0 - $ProfilNummerSonstigesStartWert = 430000000 + $ProfilNummerSonstigesStartWert = 730000000 $PN = "" $StelleVerant = "0570000/0012" @@ -1601,10 +1601,6 @@ function ProcessADObjects $DAWGruppenverwaltungOutList.Sort($ordinalComparer) $KURSSollProfileOutList.Sort($ordinalComparer) $KURSIstMitarbeiterProfileOutList.Sort($ordinalComparer) - removeDuplicatesFromSortedList $DAWGruppenAnlegenOutList "DAWGruppenAnlegenOutList" - removeDuplicatesFromSortedList $DAWGruppenverwaltungOutList "DAWGruppenverwaltungOutList" - removeDuplicatesFromSortedList $KURSSollProfileOutList "KURSSollProfileOutList" - removeDuplicatesFromSortedList $KURSIstMitarbeiterProfileOutList "KURSIstMitarbeiterProfileOutList" $DAWGruppenverwaltungNeuOutList.Clear() $lastLdap = $null @@ -1642,6 +1638,10 @@ function ProcessADObjects $DAWGruppenverwaltungNeuOutList.Clear() $KURSSollProfileOutList.Clear() $KURSIstMitarbeiterProfileOutList.Clear() + $end = Get-Date + outLog ("finished: " + $MyInvocation.MyCommand + " on type " + $roletypeTag.PadRight(30, " ") + ", used " + ($end - $begin)) +} + $end = Get-Date outLog "finished: " $MyInvocation.MyCommand " on type " $roletypeTag.PadRight(30, " ") ", used " ($end - $begin) } diff --git a/Process-ADObjects.ps1 b/Process-ADObjects.ps1 index ead978a..a7c9171 100755 --- a/Process-ADObjects.ps1 +++ b/Process-ADObjects.ps1 @@ -8,11 +8,11 @@ param([string]$sparkasse) Set-Location $PSScriptroot -$ErrorActionPreference = "SilentlyContinue" -$global:ErrorActionPreference = "SilentlyContinue" +# $ErrorActionPreference = "SilentlyContinue" +# $global:ErrorActionPreference = "SilentlyContinue" -# $ErrorActionPreference = "Stop" -# $global:ErrorActionPreference = "Stop" +$ErrorActionPreference = "Stop" +$global:ErrorActionPreference = "Stop" # trap # { # Write-Host "=== UNHANDLED EXCEPTION ===" -ForegroundColor Red