Use WMIC to query members of the local administrator group

Does anyone know a way to query members of a local admin group using WMIC (on a remote server)? I know this is possible thanks to powershell and vbs, but I'm really looking for a command line option (called from an internal PHP site).

I tried the following

wmic /Node:"ComputerName" path win32_groupuser where (groupcomponent="win32_group.name=\"administrators\",domain=\"Domain\"")

but could not get it to work.

+4
source share
1 answer

This is what worked for me:

wmic /Node:"ComputerName" path win32_groupuser where (groupcomponent="win32_group.name=\"administrators\",domain=\"Computername\"")
+3
source

Source: https://habr.com/ru/post/1547452/


All Articles