I was wondering how to best approach this. Basically I have a script that needs to check if USER1 is a member of local Administrators and if so, remove it. These groups are all local and the script will be run on the system I need to check (no remoting needed).
I was thinking something along the lines of capturing and evaluating the output from
net localgroup Administrators
test\user1
test\user2
However I am not sure how to capture the output for evaluation (pretty new to powershell). Has anyone done something like this? I really appreciate any help.