Hello,
I would like to see the list of AD groups in the drop-down groups.
For that I would have to insert the results of my powershell command into the UDInput.
Do you have an idea?
New-UDInput -Title "Create new user" -Endpoint {
param(
[Parameter(Mandatory)]
[string]$FirstName,
[Parameter(Mandatory)]
[string]$LastName,
[Parameter(Mandatory)]
[string]$UserName,
[Parameter(Mandatory)]
[ValidateSet("$Groups")]
[string]$Group
)
$Groups = Get-ADGroup -Filter * | Where-Object {$_.Name -notcontains "GDL*" -and $_.GroupCategory -eq "Security" -and $_.GroupScope -eq "Global"} |
Format-Table Name -AutoSize
$password = [System.Web.Security.Membership]::GeneratePassword((Get-Random -Minimum 8 -Maximum 12), 3)
$securePassword = ConvertTo-SecureString -String $password -AsPlainText -Force
$NewAdUserParameters = @{
GivenName = $FirstName
Surname = $LastName
Name = $UserName
AccountPassword = $securePassword
}
New-AdUser @NewAdUserParameters
Add-AdGroupMember -Identity $Group -Members $userName
New-UDInputAction -Content {
New-UDCard -Title "Temporary Password" -Text $Password
}
} -Validate
Thank you!
*Thanks for this script Adam Driscoll =)