Guis & Active Directory
Posted: Tue Jun 20, 2023 4:19 am
Hi,
I'm using the following:
Product: PowerShell Studio 2023 (64 Bit)
Build: v5.8.223
OS: Windows 10 Enterprise (64 Bit)
Build: v10.0.19045.0
I'm trying to write my very first forms project as an assist to our Service Desk.
I have a Multi form project with a main form and one called Reset password. I've setup a button and the click event code is the following:
I know the code works as I've put it into PowerShell to make sure. However the only thing the form does is close !
Any help would be appreciated.
I'm using the following:
Product: PowerShell Studio 2023 (64 Bit)
Build: v5.8.223
OS: Windows 10 Enterprise (64 Bit)
Build: v10.0.19045.0
I'm trying to write my very first forms project as an assist to our Service Desk.
I have a Multi form project with a main form and one called Reset password. I've setup a button and the click event code is the following:
- $btnLookup_Click={
- #TODO: Place custom script here
- if (($txtCallNumber.Text -ne $null) -and ($txtUsername.Text -ne $null))
- {
- $LookupUser = $null
- $LookupUser = Get-ADUser -Filter 'SAMAccountName -eq "$($txtUsername.Text)' -Properties Mail
- If (($LookupUser | Measure-Object).Count -eq 1)
- {
- $txtName.Text = $LookupUser.Name
- $txtEmail.Text = $LookupUser.Mail
- }
- }
- }
Any help would be appreciated.