Jump to content

Recommended Posts

Posted

Hi guys and gals. I'm sure that somewhere on this site is the solution i'm looking for but i've looked and can't find anything. Anyway...

 

As part of an updated Intranet system i am designing and administrative portal for carrying out simple domain user tasks without the need for the AD console.

 

The two things i wan't to do is:

>reset a single user's password - providing the script with the OU, username and new password.

>Enable or disable a users account (if required) - once again providing the script with the user's OU and username

 

if required our entire domain name is:

 

bramcote.http://www.bramcotepark.notts.sch.uk

 

Many Thanks - any questions ask away.

  • 3 weeks later...
Posted

Thanks for the responses. Just got back from a lovely time in Florida, but now back into the slog of web programming ready for when the little darlings start back on tuesday.

 

I've had a look at the files and scripts suggested, boy they're very complex but im reading through and picking bits up. Hopefully will have a working example ready one day if i ever get over the fear of accidentally resetting every password in the Domain / OU :silent:

 

Thanks

Posted

There's a configuration file with all the bits you need to alter to get self service password reset to work and that's about all you have to do apart from setting it up as a website.

 

If you have any specific issues let us know.

 

Ben

  • 2 years later...
Posted

This script is a great script for Public access computer that need to abide by CALEA laws. Basicly it is a Password of the day script. It will generate a password reset a specified user to that password and email a group or individual "The password of the Day" You either must run this on a system that has rights to change passwords or run with an account that does. Use task scheduler to run this at whatever time you would like.

 

================================================

================================================

 

Option Explicit

Dim objUser, objEmail

Dim strPassword

Dim intAccValue, strPwd1, strPwd2, strPwd3, StrPW

 

'Generate Password

strPwd1 = GeneratePassword("ABCDEFGHJKLMNPQRSTUVWXYZ", 3)

strPwd2 = GeneratePassword("abcdefghijkmnpqrstuvwxyz", 4)

strPwd3 = GeneratePassword("123456789", 1)

 

Function GeneratePassword(strCharacters, intLength)

Randomize

Dim strS, intI

For intI = 1 To intLength

strS = strS + Mid(strCharacters, Int(Rnd() * Len(strCharacters))+1, 1)

Next

GeneratePassword=strS

 

End Function

 

StrPW = strPwd1 & strPwd2 & strPwd3

 

'Set account to Reset

 

Set objUser = GetObject("LDAP://CN=USER,OU=USERS,DC=YOUR,DC=Domain")

 

'Set Account Attributes

intAccValue = 544

 

objUser.SetPassword(StrPW)

objUser.SetInfo

 

objUser.Put "userAccountControl", intAccValue

objUser.SetInfo

 

'Send email Settings are configured for NON-SMTP service computer

 

Set objEmail = CreateObject("CDO.Message")

 

objEmail.From = "[email protected]"

objEmail.To = "[email protected]"

objEmail.Subject = "Password of the Day"

objEmail.Textbody = "Todays password is " &StrPW&". "

objEmail.Configuration.Fields.Item _

("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

objEmail.Configuration.Fields.Item _

("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _

"smtp.wcu.edu"

objEmail.Configuration.Fields.Item _

("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25

objEmail.Configuration.Fields.Update

objEmail.Send

 

=====================================================

=====================================================

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 account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...