PowerShell Tutorials : Making a GUI Part 13 - Manipulating Active Directory

preview_player
Показать описание
In this video we combine a lot of what we learned and add in Active Directory cmdlets into our GUI application letting us manipulate AD Users with our GUI interface.

DataGrid:

Check Boxes:

TextBoxes:

Tags:
PowerShell
GUI
Programming
Scripting
Automating
JackedProgrammer
Coding
Рекомендации по теме
Комментарии
Автор

Code copy pasted for the beginning of script :
Add-Type -AssemblyName PresentationFramework


$inputXAML=Get-Content -Path $xamlFile -Raw
$inputXAML=$inputXAML -replace 'mc:Ignorable="d"', '' -replace "x:N", "N" -replace '^<Win.*', '<Window'
[XML]$XAML=$inputXAML

$reader = New-Object System.Xml.XmlNodeReader $XAML
try{

}catch{
Write-Host $_.Exception
throw
}

try{
Set-Variable -Name "var_$($_.Name)" -Value $form1.FindName($_.Name) -ErrorAction Stop
}catch{
throw
}
}

jackedprogrammer
Автор

Thank you so much @JackedProgrammer excellent tutorial thanks for diving in and doing a video with a variety of the WPF objects and bringing it all together!

scriptnerdz
Автор

Hi, excellent tutorial. Quick question: how do I get credentials dialog to popup with gui? Also in O365 format(UPN/password).

IceHockeyReferee
Автор

Good morning,

I compiled my ps1 script (WPF) with Invoke-ps2exe.
My concern is that once compiled my solution launches just behind I have the terminal which opens so far I have not found how to hide it. So I can't make the solution available for other lambda users. Would you be able to do so that the terminal does not open or does not appear in visible please?

josuerosamond
Автор

@JackedProgrammer can you add another search filter to this instead of just the SamAccountName add maybe like EmployeeID. I tried to modify it but keep getting errors. $Users = Get-ADUser -Filter ("EmployeeID -like '$Filter'") or ("SamAccountName -like '$Filter'") -Server $Server -Properties *
$Users = Get-ADUser -Filter "EmployeeID -like '$Filter' or "SamAccountName -like '$Filter'" -Server $Server -Properties *

or maybe even like a step further would be like a dropdown box next to the textbox to choose what to search by I think I'm going to try to figure this out

scriptnerdz
join shbcf.ru