Tuesday, May 04, 2010

Check Active Directory Group Membership in Batch Files


echo off
net group "domain admins" /domain | find "%username%" > nul
if errorlevel 1 goto notadmin
goto admin
:admin
echo "these action will be performed if the current user is in the group"
goto quit
:notadmin
echo "notadmin"
:quit