You are here:
ActiveXperts.com > ActiveXperts Network Monitor > WindowsManagement > Scripts > Users and Groups > Local Groups
Quicklinks
strComputer = "MyComputer"
Set objGroup = GetObject("WinNT://" & strComputer & "/Administrators,group")
Set objUser = GetObject("WinNT://" & strComputer & "/kenmyer,user")
objGroup.Add(objUser.ADsPath)
strComputer = "MyComputer"
Set colAccounts = GetObject("WinNT://" & strComputer & "")
Set objUser = colAccounts.Create("group", "FinanceUsers")
objUser.SetInfo
strComputer = "MyComputer"
Set objComputer = GetObject("WinNT://" & strComputer & "")
objComputer.Delete "group", "FinanceUsers"
strComputer = "MyComputer"
Set objGroup = GetObject("WinNT://" & strComputer & "/Adminstrators,group")
Set objUser = GetObject("WinNT://" & strComputer & "/kenmyer,user")
objGroup.Remove(objUser.ADsPath)
strComputer = "atl-win2k-01"
Set colGroups = GetObject("WinNT://" & strComputer & "")
colGroups.Filter = Array("group")
For Each objGroup In colGroups
Wscript.Echo objGroup.Name
For Each objUser in objGroup.Members
Wscript.Echo vbTab & objUser.Name
Next
Next
strComputer = "atl-win2k-01"
Set colGroups = GetObject("WinNT://" & strComputer & "")
colGroups.Filter = Array("group")
For Each objGroup In colGroups
For Each objUser in objGroup.Members
If objUser.name = "kenmyer" Then
Wscript.Echo objGroup.Name
End If
Next
Next