TO GET THE USER STATUS : Guest account status

 

Set Fso = CreateObject("Scripting.FileSystemObject")

Set InputFile = fso.OpenTextFile("MachineList.Txt")

Do While Not (InputFile.atEndOfStream)

strComputer = InputFile.ReadLine

strUserName = "Guest"

On Error Resume Next
Set objUser = GetObject("WinNT://" & strComputer & "/" & strUserName)

If objUser.AccountDisabled = True Then

Wscript.Echo (strUserName) & " Is Disabled On " & UCase(strComputer)

Else

MsgBox UCase(strUserName) & " Is Enabled On " & UCase(strComputer)

End If

loop

0 comments:

Post a Comment