Hi All, I currently have a script that challenges the user for a username and password that is passed on to map drives among other things. I'm trying to add validation to this for incorrect passwords. ie. if the password is incorrect the drive mapping is attempted with the wrong password and you are presented with a windows gui logon. I've had to exit the script and start again. Is there a way to validate a password against active directory to give an error code rather than it attempt to process the script with incorrect credentials? I've searched the forums alot for some clues, but have not found anything in this area with AD. Thanks, jtsm #include <GuiConstants.au3> #include <Inet.au3> #include <file.au3> ;If Not IsDeclared('WS_CLIPSIBLINGS') Then Global $WS_CLIPSIBLINGS = 0x04000000 $GUIPass=GuiCreate("Logon", 222, 149,(@DesktopWidth-222)/2, (@DesktopHeight-179)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS) $Button_Enter = GuiCtrlCreateButton("CTS Update ", 95, 90, 35, 35,$BS_ICON) GUICtrlSetState(-1,$GUI_DEFBUTTON) GUICtrlSetImage (-1, "shell32.dll",162) ;44 $Button_Exit = GuiCtrlCreateButton("Exit", 150, 90, 35, 35,$BS_ICON) GUICtrlSetImage (-1, "shell32.dll",131) ;27 $LocalVersion=FileGetVersion("C:\windows\system32\winlogon.exe") $Label_Ver = GuiCtrlCreateLabel("v."& $Localversion, 20, 90, 55, 35) GUICtrlSetImage (-1, "shell32.dll",135) ;27 ;user Logon Screen $Input_UserID = GuiCtrlCreateInput("", 80, 30, 120, 20) GUICtrlSetState(-1, $GUI_FOCUS) $Input_UserPWD = GuiCtrlCreateInput("", 80, 60, 120, 20,$ES_PASSWORD) $Label_UserID = GuiCtrlCreateLabel("User Name", 20, 30, 60, 20) $Label_UserPWD = GuiCtrlCreateLabel("Password", 20, 60, 50, 20) $Group_Access = GuiCtrlCreateGroup("Authorised Access Only", 10, 0, 200, 140) ControlFocus ( "Logon", "Authorised Access Only", 6 ) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button_Exit Exit Case $msg = $Button_Enter Do if GUICtrlRead($Input_UserID) = "" And GUICtrlRead($Input_UserPWD) = "" Then Exit ;Case $msg = $Button_Enter Until GUICtrlRead($Input_UserID) > "" And GUICtrlRead($Input_UserPWD) > "" GuiSetState(@SW_HIDE,$GUIPass) DriveMapDel("j:") DriveMapAdd("j:","\\SERVER\SHARE", 8,"DOMAIN\"& GUICtrlRead($Input_UserID), ""& GUICtrlRead($Input_UserPWD)) Exit EndSelect WEnd GUIDelete($GUIPass) Exit