Article ID: 101616
Article Last Modified on 10/31/2006
landoc (this produces minimum documentation) landoc a (adds the "net access" results) landoc g (adds group information) landoc u (adds user information) landoc g u (adds user and group information) landoc g u a (maximum documentation)NOTE: This program may take some time to run. It requires a minimum temporary free disk space of approximately 24K plus 1K per user in NET.ACC and 1K per 30 groups in NET.ACC--if you use all options.
$* MUST be logged on with ADMIN privilege *$
parse upper arg cmd_param_1 cmd_param_2 cmd_param_3
push cmd_param_1
push cmd_param_2
push cmd_param_3
do 3
pull parameter
if (parameter = '/U') | (parameter = 'U') then
do_user = 'yes'
if (parameter = '/G') | (parameter = 'G') then
do_group = 'yes'
if (parameter = '/A') | (parameter = 'A') then
do_access = 'yes'
end
"if exist lan-doc.bak del lan-doc.bak"
"if exist lan.doc ren lan.doc lan-doc.bak"
"if exist get_list.dat del get_list.dat"
"net config workstation >> lan.tmp"
"net config server >> lan.tmp"
"net comm >> lan.tmp"
"net device >> lan.tmp"
"net print >> lan.tmp"
"net accounts >> lan.tmp"
call cleanup
if do_user <> 'yes' then
"net user >> lan.tmp"
else
do
"net user >> get_list.dat"
call do_list user 1
end
if do_group <> 'yes' then
"net group >> lan.tmp"
else
do
"net group >> get_list.dat"
call do_list group 2
end
call cleanup
"net share >> lan.tmp"
if do_access = 'yes' then
do
"net access >> lan.tmp"
end
call cleanup
exit
do_list:
parse arg use_type start_pos
do i = 1 to 4
tempstr = linein("get_list.dat",,1)
end
do while lines("get_list.dat") > 0
do 3
name = substr(tempstr,start_pos,25,' ')
if substr(name,1,1) = ' ' then iterate
"net " use_type name " >> lan.tmp"
tempstr = delstr(tempstr,1,24+start_pos)
end
tempstr = linein("get_list.dat",,1)
i = pos( "command completed successfully", tempstr,1)
if i > 0 then
do while lines("get_list.dat") <> 0
tempstr = linein("get_list.dat",,1)
end
end
tempstr = lineout("get_list.dat")
"del get_list.dat"
return
cleanup:
tempstr = linein("lan.tmp",1,1)
do while lines("lan.tmp") > 0
i = pos( "command completed successfully", tempstr,1)
if i = 0 then
j = lineout("lan.doc",tempstr)
else
do
j = lineout("lan.doc"," ")
j = lineout("lan.doc","******************************************")
j = lineout("lan.doc"," ")
end
tempstr = linein("lan.tmp",,1)
end
j = lineout("lan.tmp")
"del lan.tmp"
j = lineout("lan.doc"," ")
j = lineout("lan.doc","*********************************************")
j = lineout("lan.doc"," ")
j = lineout("lan.doc")
return
#
Additional query words: 2.10 2.1 2.10a 2.1a 2.20 2.2
Keywords: KB101616