Function IsAccountDisabled( strDomain, strAccount )
Dim objUser
on error resume next
Set objComp = GetObject("WinNT://" & strDomain & "/" & strAccount & ",computer")
if err.number <> 0 Then
Wscrip.Echo "Не удачно ..."
End IF
Wscript.Echo = "AAAAAAAAAaa" & objComp.Description
IsAccountDisabled = objComp.AccountDisabled
End Function
Dim strUser, strDomain
'Do
' strUsr = inputbox("Please enter the user account name", "Input")
'loop until strUsr <> ""
strUser = "ral"
' Request the domain name for this user
'do
' strDom = inputbox("Please enter the domain for this account.", "Input")
'loop until strDom <> ""
strDom = "EMEXMSK"
If( IsAccountDisabled( strDom, strUsr ) = True ) Then
WScript.Echo strUser & " Account disabled"
Else
WScript.Echo strUser & " Account enabled"
End If
--
С уважением, Ратнер Арсений
a.ratner@autoemex.ru
Комментариев нет:
Отправить комментарий