Jump to content



Photo

GUI Help


  • Please log in to reply
5 replies to this topic

#1 stavbuck

stavbuck

    Seeker

  • Active Members
  • 12 posts

Posted 18 June 2012 - 08:38 AM

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.

Attached Files







#2 water

water

    ?

  • MVPs
  • 10,693 posts

Posted 18 June 2012 - 11:55 AM

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:
AutoIt         
#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

UDFs:

Active Directory (2012-10-12 - Version 1.3.0.0 released) - Download - General Help & Support - Example Scripts - Wiki

OutlookEX (2012-10-07 - Version 0.9.0.0 released) - Download - General Help & Support - Example Scripts - Wiki

ExcelChart (2013-01-21 - Version 0.3.1.1 released) - Download - General Help & Support - Example Scripts

WordEX (2012-12-29 - Version 1.3 released) - Download

ExcelEX (2013-05-11 - Alpha 4 released) - Download


#3 stavbuck

stavbuck

    Seeker

  • Active Members
  • 12 posts

Posted 18 June 2012 - 12:23 PM

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

#4 water

water

    ?

  • MVPs
  • 10,693 posts

Posted 18 June 2012 - 12:30 PM

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, 18 June 2012 - 12:31 PM.

UDFs:

Active Directory (2012-10-12 - Version 1.3.0.0 released) - Download - General Help & Support - Example Scripts - Wiki

OutlookEX (2012-10-07 - Version 0.9.0.0 released) - Download - General Help & Support - Example Scripts - Wiki

ExcelChart (2013-01-21 - Version 0.3.1.1 released) - Download - General Help & Support - Example Scripts

WordEX (2012-12-29 - Version 1.3 released) - Download

ExcelEX (2013-05-11 - Alpha 4 released) - Download


#5 stavbuck

stavbuck

    Seeker

  • Active Members
  • 12 posts

Posted 18 June 2012 - 12:35 PM

ok I will do some more digging and see if I can come up with something. Thanks for your help.

#6 water

water

    ?

  • MVPs
  • 10,693 posts

Posted 18 June 2012 - 12:37 PM

Glad to be of service ;)
If you have AD related questions I will be glad to help.

UDFs:

Active Directory (2012-10-12 - Version 1.3.0.0 released) - Download - General Help & Support - Example Scripts - Wiki

OutlookEX (2012-10-07 - Version 0.9.0.0 released) - Download - General Help & Support - Example Scripts - Wiki

ExcelChart (2013-01-21 - Version 0.3.1.1 released) - Download - General Help & Support - Example Scripts

WordEX (2012-12-29 - Version 1.3 released) - Download

ExcelEX (2013-05-11 - Alpha 4 released) - Download





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users