stavbuck Posted June 18, 2012 Posted June 18, 2012 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
water Posted June 18, 2012 Posted June 18, 2012 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: expandcollapse popup#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 2024-07-28 - Version 1.6.3.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 (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
stavbuck Posted June 18, 2012 Author Posted June 18, 2012 This looks ok but what if i'm trying to get this information from a remote machine. Also the location part styed blank.
water Posted June 18, 2012 Posted June 18, 2012 (edited) 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 June 18, 2012 by water My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.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 (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
stavbuck Posted June 18, 2012 Author Posted June 18, 2012 ok I will do some more digging and see if I can come up with something. Thanks for your help.
water Posted June 18, 2012 Posted June 18, 2012 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 2024-07-28 - Version 1.6.3.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 (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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now