#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <WindowsConstants.au3>
#include <AD.au3>
_AD_Open()
#Region ###
$Form1 = GUICreate("AD账号解锁重置", 410, 220, 363, 185, $WS_SYSMENU)
$Input1 = GUICtrlCreateInput("", 152, 40, 113, 24);3
$Label1 = GUICtrlCreateLabel("请输入工号", 32, 40, 84, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$Button1 = GUICtrlCreateButton("确定", 304, 40, 57, 25)
$Label2 = GUICtrlCreateLabel("工号锁定情况", 32, 88, 100, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$Checkbox1 = GUICtrlCreateCheckbox("账户已锁定", 152, 80, 113, 33)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
GUICtrlSetState(-1,128)
$Button2 = GUICtrlCreateButton("解锁", 304, 88, 57, 25)
GUICtrlSetState(-1,128)
$Label3 = GUICtrlCreateLabel("密码重置", 32, 136, 68, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$Input2 = GUICtrlCreateInput("", 152, 136, 113, 24)
$Button3 = GUICtrlCreateButton("重置", 304, 136, 57, 25);11
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$account = GUICtrlRead($Input1)
$mima = GUICtrlRead($Input2)
$nMsg = GUIGetMsg()
Switch $nMsg
Case -3
Exit
Case $Button1
If _AD_IsObjectLocked($account) Then
GUICtrlSetState($Checkbox1,65)
GUICtrlSetState($Button2,64)
Else
GUICtrlSetState($Checkbox1,128)
GUICtrlSetState($Button2,128)
EndIf
Case $Button2
$iValue = _AD_UnlockObject($account)
If $iValue = 1 And GUICtrlGetState($Checkbox1) = 80 Then
GUICtrlSetState($Checkbox1,128)
GUICtrlSetState($Button2,128)
EndIf
Case $Button3
If $account <> "" Then
If _AD_SetPassword($account,$mima,1) Then
MsgBox(4096,"成功","重置成功!")
EndIf
Else
MsgBox(4096,"注意","请输入要重置的账号!")
EndIf
EndSwitch
WEnd
AD UDF的地址