rikimaru110011 Posted September 16, 2011 Posted September 16, 2011 "I don't think the COM interface makes a difference between your userid and the id of another user you want to change. So if you do not have the permission to change passwords you can't even change your own. To be 100% sure I will have to investigate the subject." You misunderstood my mind,issues raised: User domain dont change password domain of them when apear reported password exprised.I want when pword domain of them live 2 day,autoit can run apear Changes Password.if not i lock win. (Sorry English of me not good)
water Posted September 16, 2011 Author Posted September 16, 2011 I'm not sure I understand what you want to do. Let's give it a try: When the password is about to expire in 2 days you want to inform the user. He then can select to change the password. Is this correct? How to change the password is a different story because of the needed permissions. 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
rikimaru110011 Posted September 16, 2011 Posted September 16, 2011 When the password is about to expire in 2 days you want to inform the user. He then can select to change the password.Yes,correct, but I want appear a dialog box for they can to change the password.Not need press keyboard "Ctl + Atl + Dell" -> Change Password -> Windows Change Password Screen.Thanks Water
water Posted September 16, 2011 Author Posted September 16, 2011 Something like this? #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <AD.au3> _AD_Open() Global $aPassword = _AD_GetPasswordInfo() $sExpires = _DateDiff("D", _NowCalc(), $aPassword[9]) #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Change Password", 401, 181, 192, 124) $Label1 = GUICtrlCreateLabel("Your password expires in " & $sExpires & " days.", 8, 8, 384, 17) $Label2 = GUICtrlCreateLabel("Please enter the new password twice:", 8, 48, 183, 17) $InputPW1 = GUICtrlCreateInput("", 8, 72, 377, 21, $ES_PASSWORD) $InputPW2 = GUICtrlCreateInput("", 8, 104, 377, 21,$ES_PASSWORD) $ButtonChange = GUICtrlCreateButton("Change Password", 8, 144, 113, 25, $WS_GROUP) $ButtonExit = GUICtrlCreateButton("Exit", 320, 144, 65, 25, $WS_GROUP) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE, $ButtonExit _AD_Close() Exit Case $ButtonChange EndSwitch WEnd How to change the password will be implemented later. 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
water Posted September 16, 2011 Author Posted September 16, 2011 You know that this is no 24h support forum, right? Did you test the script I posted before? 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
ICANSEEYOU7687 Posted September 16, 2011 Posted September 16, 2011 Random... most likely dumb question I am trying to use the _AD_SetPassword function which seems to work great if hardcoding a password. But I made a gui which creates an AD account, and sets up everything for you, and I am trying to make the password something along the lines of First.Last!XXXX (With the XXXX being the last four of their phone number) So here are the lines I am using... Local $pright = StringRight($phone, 4) $sAD_Password = $first &"." & $last &"!" & $pright $iValue = _AD_SetPassword($username, $sAD_Password) Now to test I add a msgbox that pops up with $sAD_Password and it does come to be First.Last!XXXX with some test accounts I made. But if I try to log into these accounts on a computer on the domain, or our companies wireless (Which pulls info from AD) it tells me the username/password is incorrect.... If I change $iValue = _AD_SetPassword($username, $sAD_Password) to $iValue = _AD_SetPassword($username, "Password") It does seem to work Any ideas? I feel that maybe the variable is just the wrong type, or something silly like that, but I cant quite figure it out, any help would be more the appreciated!
water Posted September 16, 2011 Author Posted September 16, 2011 I don't see anything wrong. But do you think it makes sense to create a password that everyone knows how it is being created and therefore knows the password of everyone? As a test I would first create the password without "!" and then without ".".Lets see what happens. 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
ICANSEEYOU7687 Posted September 16, 2011 Posted September 16, 2011 Normally yes, but these are for temporary guest accounts that do not have access to anything but connecting to the wireless network. I will try taking out the "!" and let you know the results. thanks for the fast response.
rikimaru110011 Posted September 17, 2011 Posted September 17, 2011 You know that this is no 24h support forum, right? Did you test the script I posted before?Hi Water, i have write script, and i wait " How to change the password will be implemented later." Problem this is : How to change the password, ^^!.
water Posted September 17, 2011 Author Posted September 17, 2011 Version 1.1.0 has been released. Please test before using in production! For download please see my signature. 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
water Posted September 17, 2011 Author Posted September 17, 2011 Problem this is : How to change the password, ^^!.I have searched the forum and the internet but I couldn't find a way to let an ordinary user change it's domain password using AutoIt or whatever language.This might be for security reasons because the user can't be sure what the program does with his credentials.Best way I can think of is to set a flag in Active Directory so the user has to change the password on next logon. rikimaru110011 1 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
rikimaru110011 Posted September 18, 2011 Posted September 18, 2011 Hi Water, i have other way. Autoit run on computer's user, When the password is about to expire in 5 days I want autoit send mail the user. I find AD, haven't func Sendmail.Can you show me where? Thanks Water
water Posted September 18, 2011 Author Posted September 18, 2011 As the script runs on the users computer why not just show a Messagebox? If you want to send a mail it depends on the mailsystem the user has (Outlook ...)? 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
rikimaru110011 Posted September 18, 2011 Posted September 18, 2011 (edited) Ah, Thanks Water, I show a Messagebox for user. P/s :Autoit how to automatically start with Windows.I don't know Edited September 18, 2011 by rikimaru110011
water Posted September 18, 2011 Author Posted September 18, 2011 Quite old but still true: http://www.bleepingcomputer.com/tutorials/tutorial44.html tells you which registry keys to set to make a program run at boot time.Or you can put the script in the users autostart group. 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
ICANSEEYOU7687 Posted September 19, 2011 Posted September 19, 2011 (edited) I don't see anything wrong. But do you think it makes sense to create a password that everyone knows how it is being created and therefore knows the password of everyone? As a test I would first create the password without "!" and then without ".".Lets see what happens. Water, I have been messing around with this for a while, and still cannot get it to work. I think its the variable going into the function. Where Global $sAD_Password2 = $first &"." & $last & $pright $iValue = _AD_SetPassword($username, $sAD_Password2) Does NOT work, but if I just do something simple like $iValue = _AD_SetPassword($username, "Password1234") It does work. Any ideas? Edited September 19, 2011 by ICANSEEYOU7687
AdamUL Posted September 19, 2011 Posted September 19, 2011 @ICANSEEYOU7687 From what I can see, you are not doing a valid comparison with the two examples. You do not have a dot in the second password test, but you do in the first. Does this work? $iValue = _AD_SetPassword($username, "Pass.word1234") Adam
ICANSEEYOU7687 Posted September 19, 2011 Posted September 19, 2011 Yes $iValue = _AD_SetPassword($username, "Pass.word1234") Does seem to work fine... But Global $sAD_Password = $first & $last &"1234" $iValue = _AD_SetPassword($username, $sAD_Password) Does not work.
water Posted September 19, 2011 Author Posted September 19, 2011 (edited) Could you please run this test script with your data and post the result? Global $sAD_Password = $first & $last &"1234" ConsoleWrite(">>" & $sAD_Password & "<<" & @CRLF) $iValue = _AD_SetPassword($username, $sAD_Password) ConsoleWrite(">>SetPassword: " & $iValue & "--" & @error & @CRLF) So we can check that the variable contains what we expect. Edited September 19, 2011 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
Recommended Posts