Jump to content

GUI Help


Recommended Posts

Hi people

I hope you can help, what I am trying to do is the below.

1, If I select User and click Check it will give me information on Location and Password Status.

2, If I click on Machine and click Check it will give me the IP and currently Logged on User.

I am trying to do this with Radio buttons, I have created Input boxes but not sure what to do from there.

I will be doing this in a Domain enviroment and I have the ADFunctions installed on my Laptop.

I have attached the AU3 file.

Hope someone can help me out here.

Test.au3

Link to comment
Share on other sites

You could use my AD.au3 which is the successor of ADfunctions.au3. As an example how to get the location I modified your script:

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GuiIPAddress.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <AD.au3>
Global $sUser, $sLocation
_AD_Open()

#region ## # START Koda GUI section ### Form=C:\Documents and Settings\sbuck\Desktop\Form1.kxf
$Form1 = GUICreate("Form1", 374, 126, 192, 114)
$Radio1 = GUICtrlCreateRadio("Radio1", 8, 72, 17, 17)
GUICtrlCreateLabel("User", 32, 8, 26, 17)
$Input1 = GUICtrlCreateInput(@UserName, 8, 32, 129, 21)
$Button1 = GUICtrlCreateButton("Check", 144, 32, 49, 25)
$Radio2 = GUICtrlCreateRadio("Radio2", 8, 8, 17, 17)
GUICtrlCreateLabel("Machine", 24, 72, 45, 17)
$IPAddress1 = _GUICtrlIpAddress_Create($Form1, 104, 96, 97, 17)
_GUICtrlIpAddress_Set($IPAddress1, "0.0.0.0")
GUICtrlCreateLabel("Location", 248, 0, 45, 17)
$Output1 = GUICtrlCreateInput("", 248, 16, 113, 21)
GUICtrlCreateLabel("Currently Logged On", 248, 40, 101, 17)
$Output2 = GUICtrlCreateInput("", 248, 56, 113, 21)
GUICtrlCreateLabel("Password Status", 248, 80, 83, 17)
$Output3 = GUICtrlCreateInput("", 248, 96, 113, 21)
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
_AD_Close()
Exit
Case $Button1
_CheckUser()
EndSwitch
WEnd

Func _CheckUser()
$sUser = GUICtrlRead($Input1)
$sLocation = _AD_GetObjectAttribute(@UserName, "Location")
GUICtrlSetData($Output1, $sLocation)
EndFunc ;==>_CheckUser

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

This looks ok but what if i'm trying to get this information from a remote machine. Also the location part styed blank.

The machine related information needs to be gathered using WMI. All AD related information can be gathered using my UDF.

Here the location part is blank too. This is because the location is not maintained in AD.

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Glad to be of service ;)

If you have AD related questions I will be glad to help.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...