BigDaddyO Posted January 3, 2020 Posted January 3, 2020 (edited) Hello, edit: Never mind, I think my problem is that the passwords were reset today and I think they are prevented from being reset more than once per day. I'll try the _AD_ChangePassword again Monday. I've got a bunch of production AD test accounts where the password expires every 60 days and there are way too many to change them manually. Currently I have to create a ticket for the security team and wait in their Queue for them to update the passwords but i'm wondering if there is a way for me to write a script to change the passwords since I know the old password as long as I do it before it expires. I've tried the _AD_ChangePassword but that's not working as it seems to only be for the currently logged in user. The _AD_SetPassword is only for Admins as there is no where to put the old password. Any ideas? the only thing i've found close is a powershell cmdlet "Set-ADAccountPassword" but I'm looking for AutoIt. Thanks, Mike Edited January 3, 2020 by BigDaddyO
water Posted January 3, 2020 Posted January 3, 2020 Correct: _AD_ChangePasswort only works for the currently logged on user. _AD_SetPassword allows to set the password for a user or computer (Parameter 1) by an admin. I will have a look if it is possible to set the password for accounts that are "managed" by you. 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 January 3, 2020 Posted January 3, 2020 (edited) "Delegation" is the magic word as described here (Source : The Real MCTS/MCITP Exam 70-647 Prep Kit, page 240): Spoiler Edited January 3, 2020 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
BigDaddyO Posted January 8, 2020 Author Posted January 8, 2020 I put this in a loop and was able to change the password for my 600 AD test accounts. My Test accounts increment as gnrcTestAccount10001 > 10600 so I was able to loop and use $i to increment through the accounts. Local $oUsr = ObjGet("WinNT://" & @LogonDomain & "/" & $sBulkPW_Account & $i & ",user") If @error Then MsgBox(262160,"Update Failed","Unable to access the account for " & $sBulkPW_Account & $i) ExitLoop EndIf $oUsr.ChangePassword($sBulkPW_PWcurrent, $sBulkPW_PWnew) If @error Then MsgBox(262160,"Update Failed","Unable to change the password for " & $sBulkPW_Account & $i) ExitLoop EndIf
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