Re: Script help please (unlock locked out accounts) NEWBIE question.



Hi,

What most people call the login ID is the NT Name, also called the
"pre-Windows 2000 logon name". This is actually the value of the
sAMAccountName attribute. This is different from the Common Name (the value
of the cn attribute), although they can have the same value. If you have the
NT name (sAMAccountName) of the user, you can use the NameTranslate object
to convert this to the Distinguished Name required for the LDAP provider.
See this link:

http://www.rlmueller.net/NameTranslateFAQ.htm

Using NameTranslate there is no need to prompt for the OU. I hope this
helps.

--
Richard
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net

"Clubsprint" <spamspamspamspam@xxxxxxxxxx> wrote in message
news:ec0em2$ice$1@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
G'day all
I've got two questions if you will
The below script (that I hacked together )will unlock a users active
directory account
that has entered the wrong password too many times but I have a
problem with the user interface. I want our helpdesk people to be
able to use the loginID instead of the users full name.
How can I get the fullname from a user input of the loginID
so that I can then use that in the GETOBJECT section?

How can I find out all the options for objUser ?
I suppose this is some sort of comand reference

Thanks regards
Mark
Aus


*****SCRIPT START**************************

'Get the user name
UserLOGID = InputBox("Enter the Login ID of the User you wish to unlock")

'if Cancel selected - exit
If (UserLOGID = "") Then Wscript.Quit
'Get the Organizational Unit
OrgInput=InputBox( _
"Select the Organizational unit by number" & vbCRLF & vbCRLF _
& " 1 - SITE1" & vbCRLF _
& " 2 - SITE2" & VbCrLf _
& " 3 - SITE3" & vbCRLF _
& " 4 - SITE4" & vbCRLF _
& " 5 - SITE5" & vbCRLF _
& " 6 - SITE6" & vbCRLF _
& " 7 - SITE7" & vbCRLF & VbCrLf )

'if Cancel selected - exit
If (OrgInput = "") Then Wscript.Quit

If (OrgInput = "1") Then OrgUnit="SITE1"

If (OrgInput = "2") Then OrgUnit="SITE2"

If (OrgInput = "3") Then OrgUnit="SITE3"

If (OrgInput = "4") Then OrgUnit="SITE4"

If (OrgInput = "5") Then OrgUnit="SITE5"

If (OrgInput = "6") Then OrgUnit="SITE6"

If (OrgInput = "7") Then OrgUnit="SITE7"

MsgBox ("You're unlocking "& UserLOGID & VbCrLf _
& "from Organizational Unit "& OrgUnit)

'error check input
If (INSTR("1234567",Action)=0) OR (Len(Action)>1) then
y = msgbox("Unacceptable input passed -- '" & OrgUnit & "'", _
vbOKOnly + vbCritical, "That was SOME bad input!")
Wscript.Quit
End If

Set objUser = GetObject _
("LDAP://cn="&; UserLOGID &",ou="& OrgUnit
&",ou=People,dc=internal,dc=business,dc=big,dc=com,dc=au")

objUser.IsAccountLocked = False
objUser.SetInfo

MsgBox ("Account has been unlocked" & vbOKOnly)

Wscript.Quit

*****SCRIPT END**************************





.



Relevant Pages

  • Re: Cannot unlock workstation
    ... screensaver kicks in they can't unlock it. ... >When i locked the workstation i had to reboot the machine ... >and i have done many modifications to secure the server, ... >> login as Admnand reset my ...
    (microsoft.public.win2000.security)
  • Re: bad logon attempts against the Unlock dialog box dont count
    ... login as administrator and start Active Directory Wizard. ... 10.- So, now, we have our domain controler locked, but we have the administrator username and password, so we unlock the computer and we login as the administrator (our "secondadmin" user is still locked). ... 14.- We are logged in, so, we lock the computer. ...
    (microsoft.public.win2000.security)
  • Re: ss2000 account lockout
    ... Either wait for the lockout duration or have an admin unlock ... Once the AD account is unlocked you can authenticate to ... automatic lockout of a login after too many failed login attempts. ...
    (microsoft.public.sqlserver.security)
  • Re: I dont want a keyring password
    ... This means that after I supply my login id and password, a few seconds later Gnome wants another password from me, to unlock the password for my wireless Lan. ... why doesn't gnome-keyring uses the user login to unlock itself. ...
    (Fedora)
  • Re: Locking the Desktop
    ... Please advise me which screen-locking application to use to make "New Login" available. ... but a recent update has left it so that only the user who locked the desktop can unlock it; a different user cannot start a new session. ...
    (Ubuntu)

Quantcast