Group tool

  • Thread starter Thread starter Craig Matchan
  • Start date Start date
C

Craig Matchan

Hi everyone,

can anyone point me to any tools (GUI or CL) that will produce

- a list of groups
- What directories those groups have been applied to

Does such a tool exist?

tia

Craig
 
Hi everyone,

can anyone point me to any tools (GUI or CL) that will produce

- a list of groups
- What directories those groups have been applied to

Does such a tool exist?

tia

Craig

The following script will product a list of groups:

@echo off
if /i {%1}=={L} goto OK
if /i {%1}=={D} goto OK
if /i {%1}=={B} goto OK
@echo Syntax: groups [L/D/B]&goto :EOF
:OK
setlocal
set type=%1
if /i "%type%" EQU "D" call :getd
if /i "%type%" EQU "B" call :getd
if /i "%type%" EQU "B" call :getl
if /i "%type%" EQU "L" call :getl
endlocal
goto :EOF
:getd
for /f "Tokens=*" %%g in ('net group /domain ^|findstr /l /c:"*"') do (
call :fix D "%%g"
)
goto :EOF
:getl
for /f "Tokens=*" %%g in ('net localgroup ^|findstr /l /c:"*"') do (
call :fix L "%%g"
)
goto :EOF
:fix
set grp=%2
set grp=%grp:"=%
set grp=%grp:~1%
@echo %1 %grp%


You can use the ouput in a FOR command to run CACLS on each folder and pipe the
output.

Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com
 
Hi everyone,

can anyone point me to any tools (GUI or CL) that will produce

- a list of groups
- What directories those groups have been applied to

Does such a tool exist?

tia

Craig
Oops

Changing formats between various NT-based operating systems and service packs,
so use:

@echo off
if /i {%1}=={L} goto OK
if /i {%1}=={D} goto OK
if /i {%1}=={B} goto OK
@echo Syntax: groups [L/D/B]&goto :EOF
:OK
setlocal
set type=%1
if /i "%type%" EQU "D" call :getd
if /i "%type%" EQU "B" call :getd
if /i "%type%" EQU "B" call :getl
if /i "%type%" EQU "L" call :getl
endlocal
goto :EOF
:getd
for /f "Tokens=* Delims=*" %%g in ('net group /domain ^|findstr /l /c:"*"') do (
call :fix D "%%g"
)
goto :EOF
:getl
for /f "Tokens=* Delims=*" %%g in ('net localgroup ^|findstr /l /c:"*"') do (
call :fix L "%%g"
)
goto :EOF
:fix
set ld=%1
set grp=%2
set grp=%grp:"=%
for /f "Tokens=1-3 Delims=*" %%a in ('@echo %grp%') do (
call :fix1 "%%a" "%%b" "%%c%
)
goto :EOF
:fix1
set grp=%1
set grp=%grp: "=%
set grp=%grp:"=%
if "%grp%" NEQ "" @echo %ld% %grp%
set grp=%2
set grp=%grp: "=%
set grp=%grp:"=%
if "%grp%" NEQ "" @echo %ld% %grp%
set grp=%3
set grp=%grp: "=%
set grp=%grp:"=%
if "%grp%" NEQ "" @echo %ld% %grp%

Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com
 
G'day Jerold,

thanks very much. I was more or less thinking I would have to resort to a
shell script of some sort. Very nice of you to provide one for me though :)
Many thanks.

Whilst I have you though, here's another question :) Are you aware of any
tools (GUI based) that will copy files along with their accosiated ACLs and
ownership attributes. Currently I'm using xcopy with the appropriate
switches.

Regards

Craig

Jerold Schulman said:
Hi everyone,

can anyone point me to any tools (GUI or CL) that will produce

- a list of groups
- What directories those groups have been applied to

Does such a tool exist?

tia

Craig
Oops

Changing formats between various NT-based operating systems and service
packs,
so use:

@echo off
if /i {%1}=={L} goto OK
if /i {%1}=={D} goto OK
if /i {%1}=={B} goto OK
@echo Syntax: groups [L/D/B]&goto :EOF
:OK
setlocal
set type=%1
if /i "%type%" EQU "D" call :getd
if /i "%type%" EQU "B" call :getd
if /i "%type%" EQU "B" call :getl
if /i "%type%" EQU "L" call :getl
endlocal
goto :EOF
:getd
for /f "Tokens=* Delims=*" %%g in ('net group /domain ^|findstr /l
/c:"*"') do (
call :fix D "%%g"
)
goto :EOF
:getl
for /f "Tokens=* Delims=*" %%g in ('net localgroup ^|findstr /l /c:"*"')
do (
call :fix L "%%g"
)
goto :EOF
:fix
set ld=%1
set grp=%2
set grp=%grp:"=%
for /f "Tokens=1-3 Delims=*" %%a in ('@echo %grp%') do (
call :fix1 "%%a" "%%b" "%%c%
)
goto :EOF
:fix1
set grp=%1
set grp=%grp: "=%
set grp=%grp:"=%
if "%grp%" NEQ "" @echo %ld% %grp%
set grp=%2
set grp=%grp: "=%
set grp=%grp:"=%
if "%grp%" NEQ "" @echo %ld% %grp%
set grp=%3
set grp=%grp: "=%
set grp=%grp:"=%
if "%grp%" NEQ "" @echo %ld% %grp%

Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top