Chris Stauffer at myITForum.com

You want me to do What?

Syndication

News

Links to blogs i like

Links

Check for Disables Account with Ron's webconsole

This script will allow you to check for disabled accounts in AD. In our enviornment we are not allowed to reenable an account but we can check to see if it is disables and request that it be re-enabled though remedy. If the account wasn't disabled because of a security issue or a termination then the Domain team will re-enable it.

 

 So this sub script simply allows you to check and see is a user is disabled.

 

 open the Admin.asp file in notepad and add the following to the end of the text just before the </script> line

 

'******************************************************************* 

'Check For Disabled account

Sub Btn4_OnClick
Dim User
Dim UserName
UserName = InputBox("Enter the Username you want to change the password for :","UserName","")
Set User = GetObject("WinNT://" & UserDomain & "/" & UserName & ",user")
IsAccountDisabled = User.AccountDisabled
If IsAccountDisabled = True  Then
    MsgBox("Account disabled")
End If
If IsAccountDisabled = False  Then
    MsgBox("Account enabled")
End If
End Sub

 

'****************************************************************************

 

 

Then to to line 18 it should look like this

 

   <P align="center"><input style="WIDTH: 180px" type="button" value="Check Lockout Status" name="Btnl" ID="Button1"><input style="WIDTH: 180px" type="button" value="Unlock Account" name="Btn2" ID="Button2"><input style="WIDTH: 180px" type="button" value="Reset Password" name="Btn3" ID="Button3"></P>

Change it to look like this

 

<P align="center">
   <input style="WIDTH: 180px" type="button" value="Check Lockout Status" name="Btnl" ID="Button1">
   <input style="WIDTH: 180px" type="button" value="Unlock Account" name="Btn2" ID="Button2">
   </P><P align="center">
   <input style="WIDTH: 180px" type="button" value="Reset Password" name="Btn3" ID="Button3">
   <input style="WIDTH: 180px" type="button" value="Check for Disabled Account" name="Btn4" ID="Button4">
   </P> 

 

 

or you can just replace the whole page with the file i have attached. be sure to change the domain to your domain.

 

 

Enjoy

Chris Stauffer <><

Attachment: Admin.asp.txt
Published Wednesday, July 09, 2008 10:51 AM by cstauffer

Comments

No Comments