|
UnlockUserAccount
Checks if user account is locked, if it is the script asks you if you wish to unlock
'On Error Resume Next
Dim User
Dim UserName
Dim UserDomain
UserDomain = "CRB"
UserName = InputBox("Type UserName to se if the Account is locked", "Account Locked ?", "concwo")
if UserName <> "" then
Set User = GetObject("WinNT://" & UserDomain & "/" & UserName & ",user")
If User.IsAccountLocked = True then
MsgBox Username & ": Account is Locked"
If Msgbox ("Unlockacount?",vbYesNo)=vbYes then
User.IsAccountLocked = false
User.SetInfo
end if
Else
MsgBox Username & ": Account is Open"
End If
end if
|