Jump to content

Active Directory UDF - Help & Support


water
 Share

Recommended Posts

"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)

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

You know that this is no 24h support forum, right? :graduated:

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

 

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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.

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

 

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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 by ICANSEEYOU7687
Link to comment
Share on other sites

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 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

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...