Solved How to check if a local machine has admins

November 20, 2016 at 22:16:05
Specs: Windows 7
I'm having trouble writing a batch script that checks net localgroup Administrators to see if any values are found in Administrator or not.

See More: How to check if a local machine has admins

Report •

#1
November 20, 2016 at 22:57:26
I am sorry to hear that.

Report •

#2
November 21, 2016 at 05:32:30
✔ Best Answer
Then don't. Use VBScript (easier), or PowerShell (doable), and query "WinNT://./Administrators,group" provider.

EDIT: Fewest characters would be something like this PowerShell script:

([adsi]"WinNT://./Administrators,group").Invoke('members') | % { [adsi]$_ }

How To Ask Questions The Smart Way

message edited by Razor2.3


Report •
Related Solutions


Ask Question