Experts Exchange connects you with the people and services you need so you can get back to work.
Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.
for /F "skip=1 tokens=*" %%A in ('dsquery group "<Full DN" ^| dsget group -samid') do (
if /I "%%A" NEQ "dsget succeeded" (
call :Trim %%A
Open in new window
for /f "tokens=1,2" %a in ('dsquery group "<Full DN" ^| dsget group -samid -L') do (if "%a"=="samid:" echo %%b)
for /f "tokens=1,2" %%a in ('dsquery group "<Full DN" ^| dsget group -samid -L') do (if "%%a"=="samid:" echo %%b)
dsquery group "<Full DN" | dsget group -samid >file.tmp
(for /f "tokens=1,2* delims= skip=2" %%a in ('find /v /n "" file.tmp') do (
call :LTrim line
for /f "tokens=1,2* delims= skip=2" %%a in ('find /v /n "" trim.tmp') do (
if %%a gtr 1 if %%a lss !count! echo.%%b
del file.tmp trim.tmp 2>nul
if "!str!"=="" goto :eof
if not "!str:~0,1!"==" " (
) else (
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.
One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.