scripts/AD_AIO.ps1 aktualisiert
This commit is contained in:
@@ -318,6 +318,7 @@ function Create-User {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
[System.Windows.Forms.MessageBox]::Show("Vorgang abgeschlossen.")
|
||||||
})
|
})
|
||||||
|
|
||||||
# Event-Handler für den Beenden-Button hinzufügen
|
# Event-Handler für den Beenden-Button hinzufügen
|
||||||
@@ -335,7 +336,7 @@ function Create-User {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Formular anzeigen
|
# Formular anzeigen
|
||||||
$form.Show()
|
$form.ShowDialog()
|
||||||
}
|
}
|
||||||
|
|
||||||
# Funktion, die beim Klick auf "Create Groups" ausgeführt wird
|
# Funktion, die beim Klick auf "Create Groups" ausgeführt wird
|
||||||
@@ -441,12 +442,13 @@ function Create-Groups {
|
|||||||
$outputTextBox.SelectionColor = 'Green'
|
$outputTextBox.SelectionColor = 'Green'
|
||||||
$outputTextBox.AppendText("Globale Gruppe '$groupName' wurde erfolgreich erstellt.`r`n")
|
$outputTextBox.AppendText("Globale Gruppe '$groupName' wurde erfolgreich erstellt.`r`n")
|
||||||
} else {
|
} else {
|
||||||
$outputTextBox.SelectionColor = 'Green'
|
$outputTextBox.SelectionColor = 'Orange'
|
||||||
$outputTextBox.AppendText("Globale Gruppe '$groupName' existiert bereits.`r`n")
|
$outputTextBox.AppendText("Globale Gruppe '$groupName' existiert bereits.`r`n")
|
||||||
}
|
}
|
||||||
} elseif ($groupType -eq "DL_OS") {
|
} elseif ($groupType -eq "DL_OS") {
|
||||||
# DomainLocal Gruppen ohne Suffix erstellen
|
# DomainLocal Gruppen ohne Suffix erstellen
|
||||||
$domainLocalGroupName = "$groupName"
|
$domainLocalGroupName = "$groupName"
|
||||||
|
$group = Get-ADGroup -Filter { Name -eq $domainLocalGroupName }
|
||||||
if (-not $group) {
|
if (-not $group) {
|
||||||
New-ADGroup -Name $domainLocalGroupName `
|
New-ADGroup -Name $domainLocalGroupName `
|
||||||
-GroupScope DomainLocal `
|
-GroupScope DomainLocal `
|
||||||
@@ -455,7 +457,7 @@ function Create-Groups {
|
|||||||
$outputTextBox.SelectionColor = 'Green'
|
$outputTextBox.SelectionColor = 'Green'
|
||||||
$outputTextBox.AppendText("DomainLocal Gruppe '$domainLocalGroupName' wurde erfolgreich erstellt.`r`n")
|
$outputTextBox.AppendText("DomainLocal Gruppe '$domainLocalGroupName' wurde erfolgreich erstellt.`r`n")
|
||||||
} else {
|
} else {
|
||||||
$outputTextBox.SelectionColor = 'Green'
|
$outputTextBox.SelectionColor = 'Orange'
|
||||||
$outputTextBox.AppendText("DomainLocal Gruppe '$domainLocalGroupName' existiert bereits.`r`n")
|
$outputTextBox.AppendText("DomainLocal Gruppe '$domainLocalGroupName' existiert bereits.`r`n")
|
||||||
}
|
}
|
||||||
} elseif ($groupType -eq "DL") {
|
} elseif ($groupType -eq "DL") {
|
||||||
@@ -472,7 +474,7 @@ function Create-Groups {
|
|||||||
$outputTextBox.SelectionColor = 'Green'
|
$outputTextBox.SelectionColor = 'Green'
|
||||||
$outputTextBox.AppendText("DomainLocal Gruppe '$domainLocalGroupName' wurde erfolgreich erstellt.`r`n")
|
$outputTextBox.AppendText("DomainLocal Gruppe '$domainLocalGroupName' wurde erfolgreich erstellt.`r`n")
|
||||||
} else {
|
} else {
|
||||||
$outputTextBox.SelectionColor = 'Green'
|
$outputTextBox.SelectionColor = 'Orange'
|
||||||
$outputTextBox.AppendText("DomainLocal Gruppe '$domainLocalGroupName' existiert bereits.`r`n")
|
$outputTextBox.AppendText("DomainLocal Gruppe '$domainLocalGroupName' existiert bereits.`r`n")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -500,7 +502,7 @@ function Create-Groups {
|
|||||||
$form.Controls.Add($exitButton)
|
$form.Controls.Add($exitButton)
|
||||||
|
|
||||||
# Formular anzeigen
|
# Formular anzeigen
|
||||||
$form.Show()
|
$form.ShowDialog()
|
||||||
}
|
}
|
||||||
|
|
||||||
# Funktion, die beim Klick auf "ADGDL" ausgeführt wird
|
# Funktion, die beim Klick auf "ADGDL" ausgeführt wird
|
||||||
@@ -703,7 +705,7 @@ function ADGDL {
|
|||||||
})
|
})
|
||||||
$form.Controls.Add($exitButton)
|
$form.Controls.Add($exitButton)
|
||||||
|
|
||||||
$form.Show()
|
$form.ShowDialog()
|
||||||
}
|
}
|
||||||
|
|
||||||
# Funktion, die beim Klick auf "SMB-Rechte" ausgeführt wird
|
# Funktion, die beim Klick auf "SMB-Rechte" ausgeführt wird
|
||||||
@@ -968,7 +970,6 @@ function SMB-RIGHTS {
|
|||||||
New-ADGroup -Name $dlGroupName -GroupScope DomainLocal -Path $ouPath
|
New-ADGroup -Name $dlGroupName -GroupScope DomainLocal -Path $ouPath
|
||||||
$newDLs += $dlGroupName # Hinzufügen des DL-Namens zur Liste
|
$newDLs += $dlGroupName # Hinzufügen des DL-Namens zur Liste
|
||||||
# Erfolgsnachricht (grün)
|
# Erfolgsnachricht (grün)
|
||||||
Add-DebugMessage -message "Erstellt: $dlGroupName" -isPositive $true
|
|
||||||
} catch {
|
} catch {
|
||||||
# Fehlernachricht (schwarz)
|
# Fehlernachricht (schwarz)
|
||||||
Add-DebugMessage -message "Fehler bei der Erstellung der Gruppe '$dlGroupName': $_" -isPositive $false
|
Add-DebugMessage -message "Fehler bei der Erstellung der Gruppe '$dlGroupName': $_" -isPositive $false
|
||||||
@@ -990,8 +991,6 @@ function SMB-RIGHTS {
|
|||||||
Set-Acl -Path $subfolder.FullName -AclObject $acl
|
Set-Acl -Path $subfolder.FullName -AclObject $acl
|
||||||
# Füge die Berechtigungen zur Liste hinzu
|
# Füge die Berechtigungen zur Liste hinzu
|
||||||
$newRights += "Recht '$permissionName' auf $($subfolder.FullName) für $dlGroupName gesetzt"
|
$newRights += "Recht '$permissionName' auf $($subfolder.FullName) für $dlGroupName gesetzt"
|
||||||
# Erfolgsnachricht (grün)
|
|
||||||
Add-DebugMessage -message "Berechtigung '$permissionName' auf $($subfolder.FullName) für $dlGroupName gesetzt." -isPositive $true
|
|
||||||
} catch {
|
} catch {
|
||||||
# Fehlernachricht (schwarz)
|
# Fehlernachricht (schwarz)
|
||||||
Add-DebugMessage -message "Fehler beim Setzen der Berechtigung auf $($subfolder.FullName) für '$dlGroupName': $_" -isPositive $false
|
Add-DebugMessage -message "Fehler beim Setzen der Berechtigung auf $($subfolder.FullName) für '$dlGroupName': $_" -isPositive $false
|
||||||
@@ -1010,6 +1009,8 @@ function SMB-RIGHTS {
|
|||||||
# Trennstrich
|
# Trennstrich
|
||||||
$separator = '+' * 90 # Zeichen '+' wiederholen
|
$separator = '+' * 90 # Zeichen '+' wiederholen
|
||||||
Add-DebugMessage -message $separator -isSeparator $true
|
Add-DebugMessage -message $separator -isSeparator $true
|
||||||
|
|
||||||
|
[System.Windows.Forms.MessageBox]::Show("Vorgang abgeschlossen.")
|
||||||
})
|
})
|
||||||
|
|
||||||
$form.Controls.Add($startButton)
|
$form.Controls.Add($startButton)
|
||||||
@@ -1038,7 +1039,7 @@ function SMB-RIGHTS {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Formular anzeigen
|
# Formular anzeigen
|
||||||
$form.Show()
|
$form.ShowDialog()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user