scripts/AD_GROUPS_CREATE.ps1 aktualisiert
This commit is contained in:
@@ -1,278 +1,169 @@
|
||||
$myWindowsIdentity = [System.Security.Principal.WindowsIdentity]::GetCurrent()
|
||||
$myPrincipal = New-Object System.Security.Principal.WindowsPrincipal($myWindowsIdentity)
|
||||
$runAsAdmin = [Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()
|
||||
$adminRole = [Security.Principal.WindowsBuiltInRole]::Administrator
|
||||
|
||||
if (-not $myPrincipal.IsInRole([System.Security.Principal.WindowsBuiltInRole]::Administrator)) {
|
||||
$arguments = "& '" + $myinvocation.mycommand.definition + "'"
|
||||
Start-Process powershell -ArgumentList $arguments -Verb runAs
|
||||
Exit
|
||||
if (-not $runAsAdmin.IsInRole($adminRole)) {
|
||||
# Relaunch the script as Administrator
|
||||
$arguments = "$($myinvocation.MyCommand.Definition)"
|
||||
Start-Process powershell -ArgumentList "-NoProfile -ExecutionPolicy Bypass -File $arguments" -Verb RunAs
|
||||
exit
|
||||
}
|
||||
|
||||
Add-Type -AssemblyName System.Windows.Forms
|
||||
Import-Module ActiveDirectory
|
||||
|
||||
# Master-OU und Domäne ermitteln
|
||||
$masterOU = "OU=Benutzer,DC=domain,DC=com" # Beispielwert, passe ihn an eure Umgebung an
|
||||
$masterGroupOU = "OU=Gruppen,DC=domain,DC=com" # Beispielwert, passe ihn an eure Umgebung an
|
||||
|
||||
# Holen Sie sich die Domäne aus dem Active Directory
|
||||
$domain = (Get-ADDomain).DNSRoot
|
||||
|
||||
# GUI erstellen
|
||||
$form = New-Object System.Windows.Forms.Form
|
||||
$form.Text = "Benutzererstellung"
|
||||
$form.Size = New-Object System.Drawing.Size(990, 600) # Gesamtgröße der Form anpassen
|
||||
$form.Text = "Gruppen Erstellung"
|
||||
$form.Size = New-Object System.Drawing.Size(600, 555) # Gesamtgröße der Form anpassen
|
||||
|
||||
# Funktion zur Berechnung der maximalen Breite der ComboBox
|
||||
function Set-DropDownWidth {
|
||||
param (
|
||||
[System.Windows.Forms.ComboBox]$comboBox
|
||||
)
|
||||
|
||||
$maxLength = 0
|
||||
foreach ($item in $comboBox.Items) {
|
||||
$itemLength = $item.Length
|
||||
if ($itemLength -gt $maxLength) {
|
||||
$maxLength = $itemLength
|
||||
}
|
||||
}
|
||||
|
||||
# Setze die DropDownWidth entsprechend der maximalen Länge
|
||||
$comboBox.DropDownWidth = $maxLength * 6 # Schätzbreite (Zeichen * 8 Pixel)
|
||||
}
|
||||
|
||||
# Masterkennwort Eingabefeld
|
||||
$masterPasswordLabel = New-Object System.Windows.Forms.Label
|
||||
$masterPasswordLabel.Text = "Masterkennwort:"
|
||||
$masterPasswordLabel.Location = New-Object System.Drawing.Point(10, 12)
|
||||
$masterPasswordLabel.Size = New-Object System.Drawing.Size(100, 20)
|
||||
$form.Controls.Add($masterPasswordLabel)
|
||||
|
||||
$masterPasswordTextBox = New-Object System.Windows.Forms.TextBox
|
||||
$masterPasswordTextBox.Location = New-Object System.Drawing.Point(110, 10)
|
||||
$masterPasswordTextBox.Size = New-Object System.Drawing.Size(200, 20)
|
||||
$masterPasswordTextBox.UseSystemPasswordChar = $true # Passwortfeld
|
||||
$form.Controls.Add($masterPasswordTextBox)
|
||||
|
||||
# Master-OU für Benutzer Auswahl
|
||||
$masterOULabel = New-Object System.Windows.Forms.Label
|
||||
$masterOULabel.Text = "Master-OU (Benutzer):"
|
||||
$masterOULabel.Location = New-Object System.Drawing.Point(320, 12)
|
||||
$masterOULabel.Size = New-Object System.Drawing.Size(120, 20)
|
||||
$form.Controls.Add($masterOULabel)
|
||||
|
||||
$masterOUComboBox = New-Object System.Windows.Forms.ComboBox
|
||||
$masterOUComboBox.Location = New-Object System.Drawing.Point(440, 10)
|
||||
$masterOUComboBox.Size = New-Object System.Drawing.Size(200, 20) # ComboBox-Größe festgelegt
|
||||
$masterOUComboBox.DropDownStyle = 'DropDownList'
|
||||
|
||||
# OUs aus dem AD für Benutzer abrufen und in die ComboBox einfügen
|
||||
$ouList = Get-ADOrganizationalUnit -Filter * | Select-Object -ExpandProperty DistinguishedName
|
||||
$masterOUComboBox.Items.AddRange($ouList)
|
||||
$masterOUComboBox.SelectedItem = $masterOU # Standardwerte setzen
|
||||
$form.Controls.Add($masterOUComboBox)
|
||||
|
||||
# Berechne und setze die DropDownWidth basierend auf der maximalen Länge
|
||||
Set-DropDownWidth -comboBox $masterOUComboBox
|
||||
|
||||
# Master-OU für Gruppen Auswahl
|
||||
$masterGroupOULabel = New-Object System.Windows.Forms.Label
|
||||
$masterGroupOULabel.Text = "Master-OU (Gruppen):"
|
||||
$masterGroupOULabel.Location = New-Object System.Drawing.Point(645, 12)
|
||||
$masterGroupOULabel.Size = New-Object System.Drawing.Size(120, 20)
|
||||
$form.Controls.Add($masterGroupOULabel)
|
||||
|
||||
$masterGroupOUComboBox = New-Object System.Windows.Forms.ComboBox
|
||||
$masterGroupOUComboBox.Location = New-Object System.Drawing.Point(765, 10)
|
||||
$masterGroupOUComboBox.Size = New-Object System.Drawing.Size(200, 20) # ComboBox-Größe für Gruppen
|
||||
$masterGroupOUComboBox.DropDownStyle = 'DropDownList'
|
||||
|
||||
# OUs aus dem AD für Gruppen abrufen und in die ComboBox einfügen
|
||||
$groupOUList = Get-ADOrganizationalUnit -Filter * | Select-Object -ExpandProperty DistinguishedName
|
||||
$masterGroupOUComboBox.Items.AddRange($groupOUList)
|
||||
$masterGroupOUComboBox.SelectedItem = $masterGroupOU # Standardwerte setzen
|
||||
$form.Controls.Add($masterGroupOUComboBox)
|
||||
|
||||
# Berechne und setze die DropDownWidth basierend auf der maximalen Länge
|
||||
Set-DropDownWidth -comboBox $masterGroupOUComboBox
|
||||
|
||||
# DataGridView erstellen
|
||||
# DataGridView für Gruppen erstellen
|
||||
$dataGridView = New-Object System.Windows.Forms.DataGridView
|
||||
$dataGridView.Size = New-Object System.Drawing.Size(954, 300) # Breite und Höhe des DataGridViews festgelegt
|
||||
$dataGridView.Location = New-Object System.Drawing.Point(10, 40) # Position des DataGridViews
|
||||
$dataGridView.Anchor = [System.Windows.Forms.AnchorStyles]::Top
|
||||
$dataGridView.Size = New-Object System.Drawing.Size(564, 300) # Breite und Höhe des DataGridViews
|
||||
$dataGridView.Location = New-Object System.Drawing.Point(10, 10) # Position des DataGridViews
|
||||
$form.Controls.Add($dataGridView)
|
||||
|
||||
# Die Breite der DropDown-Liste manuell anpassen, da DropDownWidth für DataGridViewComboBoxColumn nicht unterstützt wird
|
||||
$maxLength = 0
|
||||
foreach ($item in $masterGroupOUComboBox.Items) {
|
||||
$itemLength = $item.ToString().Length
|
||||
if ($itemLength -gt $maxLength) {
|
||||
$maxLength = $itemLength
|
||||
}
|
||||
}
|
||||
|
||||
# Definieren der Spalten für die DataGridView
|
||||
$dataGridView.ColumnCount = 6
|
||||
$dataGridView.Columns[0].Name = "Titel" # Titel in der ersten Spalte
|
||||
$dataGridView.Columns[1].Name = "Vorname" # Vorname
|
||||
$dataGridView.Columns[2].Name = "Nachname" # Nachname
|
||||
$dataGridView.Columns[3].Name = "Globalgruppe" # Globalgruppe
|
||||
$dataGridView.Columns[4].Name = "Standardpasswort" # Standardpasswort
|
||||
$dataGridView.Columns[5].Name = "OU" # OU (wird als ComboBox hinzugefügt)
|
||||
$dataGridView.Columns[5].Width = $ouComboBoxColumn
|
||||
$dataGridView.ColumnCount = 3
|
||||
$dataGridView.Columns[0].Name = "Typ" # Typ in der ersten Spalte
|
||||
$dataGridView.Columns[1].Name = "Gruppenname" # Gruppenname in der zweiten Spalte
|
||||
$dataGridView.Columns[2].Name = "OU" # OU in der dritten Spalte
|
||||
|
||||
# Dropdown für die OU in der DataGridView-ComboBox-Spalte
|
||||
$ouComboBoxColumn = New-Object System.Windows.Forms.DataGridViewComboBoxColumn
|
||||
$ouComboBoxColumn.HeaderText = "OU"
|
||||
$ouComboBoxColumn.Items.AddRange($ouList) # Hier fügen wir alle OUs hinzu
|
||||
$dataGridView.Columns.RemoveAt(5) # Entfernt die ursprüngliche OU-Spalte
|
||||
$dataGridView.Columns.Insert(5, $ouComboBoxColumn) # Fügt die ComboBox-Spalte an der richtigen Stelle ein
|
||||
$ouComboBoxColumn.Width = $maxLength * 6
|
||||
# Breite der Spalten festlegen
|
||||
$dataGridView.Columns[0].Width = 75 # Typ-Spalte auf 50 Pixel setzen
|
||||
$dataGridView.Columns[1].Width = 100 # Gruppenname-Spalte auf 100 Pixel setzen
|
||||
$dataGridView.Columns[2].Width = 345 # OU-Spalte auf 400 Pixel setzen
|
||||
|
||||
# RichTextBox für Ausgaben (anstelle von TextBox)
|
||||
# Dropdown für den Typ (GG oder DL)
|
||||
$typColumn = New-Object System.Windows.Forms.DataGridViewComboBoxColumn
|
||||
$typColumn.HeaderText = "Typ"
|
||||
$typColumn.Items.Add("GG")
|
||||
$typColumn.Items.Add("DL")
|
||||
$typColumn.Items.Add("DL_OS")
|
||||
$dataGridView.Columns.RemoveAt(0)
|
||||
$dataGridView.Columns.Insert(0, $typColumn)
|
||||
# Breite der Typ-Spalte setzen
|
||||
$typColumn.Width = 75 # Du kannst hier den Wert nach Bedarf anpassen
|
||||
|
||||
# Dropdown für die OU-Auswahl in der dritten Spalte
|
||||
$ouColumn = New-Object System.Windows.Forms.DataGridViewComboBoxColumn
|
||||
$ouColumn.HeaderText = "OU"
|
||||
$groupOUList = Get-ADOrganizationalUnit -Filter * | Select-Object -ExpandProperty DistinguishedName
|
||||
foreach ($ou in $groupOUList) {
|
||||
$ouColumn.Items.Add($ou)
|
||||
}
|
||||
$dataGridView.Columns.RemoveAt(2)
|
||||
$dataGridView.Columns.Insert(2, $ouColumn)
|
||||
|
||||
# Breite der OU-Spalte setzen
|
||||
$ouColumn.Width = 345 # Du kannst hier den Wert nach Bedarf anpassen
|
||||
|
||||
# RichTextBox für Ausgaben
|
||||
$outputTextBox = New-Object System.Windows.Forms.RichTextBox
|
||||
$outputTextBox.Multiline = $true
|
||||
$outputTextBox.Location = New-Object System.Drawing.Point(10, 350) # Position unterhalb des DataGridViews
|
||||
$outputTextBox.Size = New-Object System.Drawing.Size(954, 150) # Größe der RichTextBox festgelegt
|
||||
$outputTextBox.Location = New-Object System.Drawing.Point(10, 320) # Position unterhalb des DataGridViews
|
||||
$outputTextBox.Size = New-Object System.Drawing.Size(564, 150) # Größe der RichTextBox
|
||||
$outputTextBox.ScrollBars = 'Vertical'
|
||||
$form.Controls.Add($outputTextBox)
|
||||
|
||||
# OK-Button erstellen
|
||||
# OK-Button für Gruppen erstellen
|
||||
$okButton = New-Object System.Windows.Forms.Button
|
||||
$okButton.Text = "Benutzer erstellen"
|
||||
$okButton.Size = New-Object System.Drawing.Size(380, 30) # Größe des Buttons festgelegt
|
||||
$okButton.Location = New-Object System.Drawing.Point(10, 510) # Position des Buttons unter der TextBox
|
||||
$okButton.Text = "Gruppen erstellen"
|
||||
$okButton.Size = New-Object System.Drawing.Size(280, 30) # Größe des Buttons
|
||||
$okButton.Location = New-Object System.Drawing.Point(10, 475) # Position des Buttons
|
||||
$okButton.Add_Click({
|
||||
foreach ($row in $dataGridView.Rows) {
|
||||
if ($row.Index -lt $dataGridView.RowCount - 1) { # Nicht für die leere letzte Zeile
|
||||
$groupType = $row.Cells[0].Value
|
||||
$groupName = $row.Cells[1].Value
|
||||
$groupOU = $row.Cells[2].Value
|
||||
|
||||
if (-not $groupType -or -not $groupName -or -not $groupOU) {
|
||||
$outputTextBox.SelectionColor = 'Red'
|
||||
$outputTextBox.AppendText("Fehler: Alle Felder (Typ, Gruppenname, OU) müssen ausgefüllt sein.`r`n")
|
||||
continue
|
||||
}
|
||||
|
||||
# Präfix vor den Gruppennamen setzen, basierend auf dem Typ
|
||||
if ($groupType -eq "GG") {
|
||||
$groupName = "GG_" + $groupName # Für globale Gruppen "GG_" voranstellen
|
||||
} elseif ($groupType -eq "DL_OS") {
|
||||
$groupName = "DL_" + $groupName # Für globale Gruppen "DL_OS" voranstellen
|
||||
} elseif ($groupType -eq "DL") {
|
||||
$groupName = "DL_" + $groupName # Für DomainLocal Gruppen "DL_" voranstellen
|
||||
}
|
||||
|
||||
try {
|
||||
if ($groupType -eq "GG") {
|
||||
# Globale Gruppe erstellen (keine Suffixe, aber Präfix wird hinzugefügt)
|
||||
$group = Get-ADGroup -Filter { Name -eq $groupName }
|
||||
if (-not $group) {
|
||||
New-ADGroup -Name $groupName `
|
||||
-GroupScope Global `
|
||||
-Path $groupOU `
|
||||
-Description "Globale Gruppe für $groupName"
|
||||
$outputTextBox.SelectionColor = 'Green'
|
||||
$outputTextBox.AppendText("Globale Gruppe '$groupName' wurde erfolgreich erstellt.`r`n")
|
||||
} else {
|
||||
$outputTextBox.SelectionColor = 'Green'
|
||||
$outputTextBox.AppendText("Globale Gruppe '$groupName' existiert bereits.`r`n")
|
||||
}
|
||||
} elseif ($groupType -eq "DL_OS") {
|
||||
# DomainLocal Gruppen ohne Suffix erstellen
|
||||
$domainLocalGroupName = "$groupName"
|
||||
if (-not $group) {
|
||||
New-ADGroup -Name $domainLocalGroupName `
|
||||
-GroupScope DomainLocal `
|
||||
-Path $groupOU `
|
||||
-Description "DomainLocal Gruppe für $domainLocalGroupName"
|
||||
$outputTextBox.SelectionColor = 'Green'
|
||||
$outputTextBox.AppendText("DomainLocal Gruppe '$domainLocalGroupName' wurde erfolgreich erstellt.`r`n")
|
||||
} else {
|
||||
$outputTextBox.SelectionColor = 'Green'
|
||||
$outputTextBox.AppendText("DomainLocal Gruppe '$domainLocalGroupName' existiert bereits.`r`n")
|
||||
}
|
||||
} elseif ($groupType -eq "DL") {
|
||||
# DomainLocal Gruppen mit Suffixen erstellen
|
||||
$suffixes = "_FA", "_RW", "_RX", "_RO"
|
||||
foreach ($suffix in $suffixes) {
|
||||
$domainLocalGroupName = "$groupName$suffix"
|
||||
$group = Get-ADGroup -Filter { Name -eq $domainLocalGroupName }
|
||||
if (-not $group) {
|
||||
New-ADGroup -Name $domainLocalGroupName `
|
||||
-GroupScope DomainLocal `
|
||||
-Path $groupOU `
|
||||
-Description "DomainLocal Gruppe für $domainLocalGroupName"
|
||||
$outputTextBox.SelectionColor = 'Green'
|
||||
$outputTextBox.AppendText("DomainLocal Gruppe '$domainLocalGroupName' wurde erfolgreich erstellt.`r`n")
|
||||
} else {
|
||||
$outputTextBox.SelectionColor = 'Green'
|
||||
$outputTextBox.AppendText("DomainLocal Gruppe '$domainLocalGroupName' existiert bereits.`r`n")
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
# Fehler bei der Gruppen-Erstellung
|
||||
$outputTextBox.SelectionColor = 'Red'
|
||||
$outputTextBox.AppendText("Fehler bei der Erstellung der Gruppe '$groupName': $_.Exception.Message`r`n")
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
# Beenden-Button erstellen
|
||||
$exitButton = New-Object System.Windows.Forms.Button
|
||||
$exitButton.Text = "Beenden"
|
||||
$exitButton.Size = New-Object System.Drawing.Size(380, 30) # Größe des Buttons festgelegt
|
||||
$exitButton.Location = New-Object System.Drawing.Point(585, 510) # Position des Beenden-Buttons
|
||||
$exitButton.Size = New-Object System.Drawing.Size(280, 30)
|
||||
$exitButton.Location = New-Object System.Drawing.Point(295, 475) # Position des Beenden-Buttons
|
||||
$exitButton.Add_Click({
|
||||
$form.Close() # Formular schließen
|
||||
})
|
||||
|
||||
# Buttons zum Formular hinzufügen
|
||||
$form.Controls.Add($okButton)
|
||||
$form.Controls.Add($exitButton)
|
||||
|
||||
# Event-Handler für den OK-Button hinzufügen
|
||||
$okButton.Add_Click({
|
||||
$masterPassword = $masterPasswordTextBox.Text # Masterkennwort holen
|
||||
foreach ($row in $dataGridView.Rows) {
|
||||
if ($row.Index -lt $dataGridView.RowCount - 1) { # Nicht für die leere letzte Zeile
|
||||
$title = $row.Cells[0].Value
|
||||
$firstName = $row.Cells[1].Value
|
||||
$lastName = $row.Cells[2].Value
|
||||
$globalGroup = $row.Cells[3].Value
|
||||
$password = $row.Cells[4].Value
|
||||
$ou = $row.Cells[5].Value # Hier wird die ausgewählte OU aus der ComboBox abgerufen
|
||||
|
||||
# Wenn keine OU in der Zeile gewählt wurde, nehme die Master-OU
|
||||
if (-not $ou) {
|
||||
$ou = $masterOUComboBox.SelectedItem
|
||||
}
|
||||
|
||||
# Wenn kein Passwort angegeben wurde, nutze das Masterkennwort
|
||||
if (-not $password) {
|
||||
$password = $masterPassword
|
||||
}
|
||||
|
||||
# Überprüfen, ob notwendige Felder ausgefüllt sind
|
||||
if (-not $firstName -or -not $lastName) {
|
||||
$missingField = if (-not $firstName) { "Vorname" } elseif (-not $lastName) { "Nachname" }
|
||||
$outputTextBox.AppendText("Fehler bei der Erstellung des Benutzers '$firstName $lastName': $missingField fehlt.`r`n")
|
||||
continue
|
||||
}
|
||||
|
||||
# Benutzername generieren: erster Buchstabe des Vornamens + Nachname
|
||||
$username = ($firstName.Substring(0, 1) + $lastName).ToLower()
|
||||
|
||||
# E-Mail-Adresse generieren
|
||||
$email = Get-EmailAddress -username $username
|
||||
|
||||
# Benutzer erstellen
|
||||
try {
|
||||
# Versuchen, den Benutzer abzurufen (auch wenn er bereits existiert)
|
||||
$user = Get-ADUser -Filter { SamAccountName -eq $username }
|
||||
if (-not $user) {
|
||||
# Benutzer erstellen, falls er nicht existiert
|
||||
try {
|
||||
New-ADUser -Name "$firstName $lastName" `
|
||||
-GivenName "$firstName" `
|
||||
-Surname "$lastName" `
|
||||
-SamAccountName "$username" `
|
||||
-UserPrincipalName "$email" `
|
||||
-AccountPassword (ConvertTo-SecureString $password -AsPlainText -Force) `
|
||||
-Enabled $true `
|
||||
-Path "$ou"
|
||||
|
||||
$outputTextBox.SelectionColor = 'Green'
|
||||
$outputTextBox.AppendText("Benutzer $username wurde erfolgreich erstellt.`r`n")
|
||||
}
|
||||
catch {
|
||||
$outputTextBox.SelectionColor = 'Red'
|
||||
$outputTextBox.AppendText("Fehler bei der Erstellung des Benutzers '$firstName $lastName': $_.Exception.Message`r`n")
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
# Erfolgsnachricht für vorhandenen Benutzer
|
||||
$outputTextBox.SelectionColor = 'Green'
|
||||
$outputTextBox.AppendText("Benutzer $username existiert bereits.`r`n")
|
||||
}
|
||||
|
||||
# Gruppenzuordnung durchführen, auch wenn der Benutzer schon existiert
|
||||
if ($globalGroup) {
|
||||
# Gruppen-OU immer auf die Master-OU setzen
|
||||
$groupOU = $masterGroupOU
|
||||
try {
|
||||
# Überprüfen, ob die Gruppe existiert
|
||||
$group = Get-ADGroup -Filter { Name -eq $globalGroup }
|
||||
try {
|
||||
# Gruppe erstellen, falls sie nicht existiert
|
||||
$groupName = "GG_" + $globalGroup
|
||||
New-ADGroup -Name $groupName `
|
||||
-GroupScope Global `
|
||||
-Path $groupOU `
|
||||
-Description "Globale Gruppe für $groupName" `
|
||||
-Enabled $true
|
||||
# Erfolgsnachricht
|
||||
$outputTextBox.SelectionColor = 'Green'
|
||||
$outputTextBox.AppendText("Globale Gruppe '$groupName' wurde erfolgreich erstellt.`r`n")
|
||||
}
|
||||
catch {
|
||||
$outputTextBox.SelectionColor = 'Red'
|
||||
$outputTextBox.AppendText("Fehler bei der Erstellung der Gruppe '$groupName': $_.Exception.Message`r`n")
|
||||
$outputTextBox.AppendText("Fehlerdetails: $_`r`n")
|
||||
}
|
||||
}
|
||||
catch {
|
||||
# Fehler bei der Gruppenzuordnung
|
||||
$outputTextBox.SelectionColor = 'Red'
|
||||
$outputTextBox.AppendText("Fehler bei der Gruppenzuordnung für Benutzer '$username': $_.Exception.Message`r`n")
|
||||
}
|
||||
}
|
||||
}
|
||||
catch {
|
||||
# Fehler bei der Benutzererstellung
|
||||
$outputTextBox.SelectionColor = 'Red'
|
||||
$outputTextBox.AppendText("Fehler bei der Erstellung des Benutzers '$firstName $lastName': $_.Exception.Message`r`n")
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
# Event-Handler für den Beenden-Button hinzufügen
|
||||
$exitButton.Add_Click({
|
||||
$form.Close() # Formular schließen
|
||||
})
|
||||
|
||||
# Funktion zum Erstellen der E-Mail-Adresse
|
||||
function Get-EmailAddress {
|
||||
param (
|
||||
[string]$username
|
||||
)
|
||||
|
||||
return "$username@$domain"
|
||||
}
|
||||
|
||||
# Formular anzeigen
|
||||
$form.ShowDialog()
|
||||
|
||||
Reference in New Issue
Block a user