G'day all
I've got two questions if you will
The below script (that I hacked together )will unlock a users 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**************************