Help with reporting on groups and user accounts

Howdy
I’ve tried some queries and searched online but I’m not having any luck. I need to create a couple of reports. Does anyone know if there’s a way to schedule a report that would give me all members in the local administrators group on Windows Servers? The version varies from 2008/2008R2/2012/2012R2.

I want to exclude domain controllers and I do have a group in bigfix created of all windows servers excluding dcs.
The report has to include specific item, for each account found I have to be able to determine if it’s a local or domain account, I need the server name next to each account found, the domain name the account belongs to, if it’s local then it would list the machine name, then I need to show the samaccountname and display name for the user accounts found, if it’s a group that’s a member of the local admins group then showing just the group name is fine.

I’d like to be able to run this for all groups on the servers, or only against one like the local admins group.

If anyone can help it’s appreciated!

1 Like

Perhaps this will get you started for the groups.
Relevance to produce local groups and accounts, for a domain controller only the group names.
if (product type of operating system != nt domain controller product type) then ((name of it, sids of members of it) of local groups as string) else ((name of it) of local groups as string)
You can then use local user and domain user to query some of the properties.
(full name of it, name of it) of domain user "blah"
Of course that will require some compound relevance to put that together.