I'm currently using VBScript to enumerate the members of the local
Administrator groups on PC in my domain using the WinNT provider like so:
ThisComputer = "."
TargetGroup = "Administrators"
Set objLocalGroup = GetObject("WinNT://./Administrators,group")
For Each objGroupMember In objLocalGroup.Members
WScript.echo objGroupMember.Name
Next
The problem is that it only returns the username of the group member, not
the domain, so I can't be sure if the account is a local account or a domain
account. My current solution is to also enumerate the local accounts, but
that is more of a workaround. I'd like to be able to get normal looking
output:
Domain\user
Domain\Group
Local\User
etc.
I know that WMI can determine if accounts are local or domain, but that's
more complicated than I'm familiar with.