Microsoft KB Archive/101616: Difference between revisions

From BetaArchive Wiki
(importing KB archive)
 
m (Text replacement - """ to """)
Line 50: Line 50:
<br />
<br />


* A or /A adds the results of &quot;net access&quot; to the document
* A or /A adds the results of "net access" to the document
* G or /G adds a verbose group listing to the document
* G or /G adds a verbose group listing to the document
* U or /U adds a verbose user listing to the document
* U or /U adds a verbose user listing to the document


&quot;Verbose&quot; means that instead of getting just a list of groups or users on the server you will receive information on each individual group or user.<br />
"Verbose" means that instead of getting just a list of groups or users on the server you will receive information on each individual group or user.<br />
<br />
<br />
You must run this program at the server or other OS/2 machine while logged on with ADMIN privileges. Examples of program execution at an OS/2 command prompt are:
You must run this program at the server or other OS/2 machine while logged on with ADMIN privileges. Examples of program execution at an OS/2 command prompt are:
<pre class="fixed_text">  landoc            (this produces minimum documentation)
<pre class="fixed_text">  landoc            (this produces minimum documentation)
   landoc a          (adds the &quot;net access&quot; results)
   landoc a          (adds the "net access" results)
   landoc g          (adds group information)
   landoc g          (adds group information)
   landoc u          (adds user information)
   landoc u          (adds user information)
Line 79: Line 79:
     do_access = 'yes'
     do_access = 'yes'
end
end
&quot;if exist lan-doc.bak del lan-doc.bak&quot;
"if exist lan-doc.bak del lan-doc.bak"
&quot;if exist lan.doc ren lan.doc lan-doc.bak&quot;
"if exist lan.doc ren lan.doc lan-doc.bak"
&quot;if exist get_list.dat del get_list.dat&quot;
"if exist get_list.dat del get_list.dat"
&quot;net config workstation &gt;&gt; lan.tmp&quot;
"net config workstation &gt;&gt; lan.tmp"
&quot;net config server &gt;&gt; lan.tmp&quot;
"net config server &gt;&gt; lan.tmp"
&quot;net comm &gt;&gt; lan.tmp&quot;
"net comm &gt;&gt; lan.tmp"
&quot;net device &gt;&gt; lan.tmp&quot;
"net device &gt;&gt; lan.tmp"
&quot;net print &gt;&gt; lan.tmp&quot;
"net print &gt;&gt; lan.tmp"
&quot;net accounts &gt;&gt; lan.tmp&quot;
"net accounts &gt;&gt; lan.tmp"
call cleanup
call cleanup
if do_user &lt;&gt; 'yes' then
if do_user &lt;&gt; 'yes' then
     &quot;net user &gt;&gt; lan.tmp&quot;
     "net user &gt;&gt; lan.tmp"
else
else
     do
     do
     &quot;net user &gt;&gt; get_list.dat&quot;
     "net user &gt;&gt; get_list.dat"
     call do_list user 1
     call do_list user 1
     end
     end
if do_group &lt;&gt; 'yes' then
if do_group &lt;&gt; 'yes' then
     &quot;net group &gt;&gt; lan.tmp&quot;
     "net group &gt;&gt; lan.tmp"
else
else
     do
     do
     &quot;net group &gt;&gt; get_list.dat&quot;
     "net group &gt;&gt; get_list.dat"
     call do_list group 2
     call do_list group 2
     end
     end
call cleanup
call cleanup
&quot;net share &gt;&gt; lan.tmp&quot;
"net share &gt;&gt; lan.tmp"
if do_access = 'yes' then
if do_access = 'yes' then
     do
     do
     &quot;net access &gt;&gt; lan.tmp&quot;
     "net access &gt;&gt; lan.tmp"
     end
     end
call cleanup
call cleanup
Line 114: Line 114:
parse arg use_type start_pos
parse arg use_type start_pos
do i = 1 to 4
do i = 1 to 4
tempstr = linein(&quot;get_list.dat&quot;,,1)
tempstr = linein("get_list.dat",,1)
end
end
do while lines(&quot;get_list.dat&quot;) &gt; 0
do while lines("get_list.dat") &gt; 0
do 3
do 3
name = substr(tempstr,start_pos,25,' ')
name = substr(tempstr,start_pos,25,' ')
if substr(name,1,1) = ' ' then iterate
if substr(name,1,1) = ' ' then iterate
&quot;net &quot; use_type name &quot; &gt;&gt; lan.tmp&quot;
"net " use_type name " &gt;&gt; lan.tmp"
tempstr = delstr(tempstr,1,24+start_pos)
tempstr = delstr(tempstr,1,24+start_pos)
end
end
tempstr = linein(&quot;get_list.dat&quot;,,1)
tempstr = linein("get_list.dat",,1)
i = pos( &quot;command completed successfully&quot;, tempstr,1)
i = pos( "command completed successfully", tempstr,1)
if  i &gt; 0 then
if  i &gt; 0 then
     do while lines(&quot;get_list.dat&quot;) &lt;&gt; 0
     do while lines("get_list.dat") &lt;&gt; 0
     tempstr = linein(&quot;get_list.dat&quot;,,1)
     tempstr = linein("get_list.dat",,1)
         end
         end
end
end
tempstr = lineout(&quot;get_list.dat&quot;)
tempstr = lineout("get_list.dat")
&quot;del get_list.dat&quot;
"del get_list.dat"
return
return
cleanup:
cleanup:
tempstr = linein(&quot;lan.tmp&quot;,1,1)
tempstr = linein("lan.tmp",1,1)
do while lines(&quot;lan.tmp&quot;) &gt; 0
do while lines("lan.tmp") &gt; 0
i = pos( &quot;command completed successfully&quot;, tempstr,1)
i = pos( "command completed successfully", tempstr,1)
if i = 0 then
if i = 0 then
   j = lineout(&quot;lan.doc&quot;,tempstr)
   j = lineout("lan.doc",tempstr)
else
else
   do
   do
   j = lineout(&quot;lan.doc&quot;,&quot; &quot;)
   j = lineout("lan.doc"," ")
   j = lineout(&quot;lan.doc&quot;,&quot;******************************************&quot;)
   j = lineout("lan.doc","******************************************")
   j = lineout(&quot;lan.doc&quot;,&quot; &quot;)
   j = lineout("lan.doc"," ")
   end
   end
tempstr = linein(&quot;lan.tmp&quot;,,1)
tempstr = linein("lan.tmp",,1)
end
end
j = lineout(&quot;lan.tmp&quot;)
j = lineout("lan.tmp")
&quot;del lan.tmp&quot;
"del lan.tmp"
j = lineout(&quot;lan.doc&quot;,&quot; &quot;)
j = lineout("lan.doc"," ")
j = lineout(&quot;lan.doc&quot;,&quot;*********************************************&quot;)
j = lineout("lan.doc","*********************************************")
j = lineout(&quot;lan.doc&quot;,&quot; &quot;)
j = lineout("lan.doc"," ")
j = lineout(&quot;lan.doc&quot;)
j = lineout("lan.doc")
return
return
#
#

Revision as of 09:20, 20 July 2020

Knowledge Base


A Program to Generate Documentation on LAN Manager Servers

Article ID: 101616

Article Last Modified on 10/31/2006

This article was previously published under Q101616

SUMMARY

This article contains a REXX program that can be used to easily document much of a server's configuration--including users, groups, resources and configurable parameters.

MORE INFORMATION

To use the program do the following:

  • Cut-and-paste the listing beginning with (including) the first dollar sign and continuing to (but not including) the pound sign.
  • Search-and-replace the dollar sign with a forward slash (/).
  • Save the file as LANDOC.CMD or some other *.CMD name.

There are three command line switches to the program:

  • A or /A adds the results of "net access" to the document
  • G or /G adds a verbose group listing to the document
  • U or /U adds a verbose user listing to the document

"Verbose" means that instead of getting just a list of groups or users on the server you will receive information on each individual group or user.

You must run this program at the server or other OS/2 machine while logged on with ADMIN privileges. Examples of program execution at an OS/2 command prompt are:

   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