0

有谁知道如何使用 vbscript 查询本地组的成员并返回他们的状态,即启用或禁用?

我有这个来获得组成员资格:

Set objNetwork = CreateObject("WScript.Network")
strComputer = objNetwork.ComputerName
strGroup = "Users"
Set objGroup = GetObject("WinNT://" & strComputer & "/" & strGroup & ",group")
For Each objMember In objGroup.Members
  WScript.Echo objMember.Name
Next

操作系统 = Windows 2008

4

1 回答 1

1

尝试这样的事情:

For Each objMember In objGroup.Members
  If objMember.Class = "User" Then
    Set objUser = GetObject("WinNT://" & strComputer & "/" & objMember.Name)
    WScript.Echo objUser.Name & " [" & objUser.AccountDisabled & "]"
  Else
    WScript.Echo objMember.Name
  End If
Next
于 2013-09-10T18:34:08.230 回答