[Samba] Logoff script?

Ryan Novosielski novosirj at umdnj.edu
Fri Jul 25 19:31:02 GMT 2003


I looked into NET USE... problem is that it only allows for the three LPT
ports to be used, according to its help file.

Just FYI, here is a small script that I found information on from MS's
tech site. Might be of interest to someone else:

MapLabPrinters.vbs:

Set objNetwork = CreateObject("Wscript.Network")
objNetwork.AddWindowsPrinterConnection "\\NJMSA-LM\ljnlab"
objNetwork.AddWindowsPrinterConnection "\\NJMSA-LM\cpnlab1"
objNetwork.AddWindowsPrinterConnection "\\NJMSA-LM\djnlab"
objNetwork.AddWindowsPrinterConnection "\\NJMSA-LM\lp"
objNetwork.SetDefaultPrinter "\\NJMSA-LM\ljnlab"

...this is pretty self explanatory. It's run with a program called
"CSCRIPT" that comes with Win2k.

---- _  _ _  _ ___  _  _  _
|Y#| |  | |\/| |  \ |\ |  |  | Ryan Novosielski - Jr. UNIX Systems Admin
|$&| |__| |  | |__/ | \| _|  | novosirj at umdnj.edu - 973/972.0922 (2-0922)
\__/ Univ. of Med. and Dent. | IST/ACS - NJMS Medical Science Bldg - C630

On Fri, 25 Jul 2003, Bob Crandell wrote:

> To get back to your original question, there isn't a logoff script.  The NET USE I
> suggested is one way to release the printers when the user logs off.  NET USE isn't
> limited to DOS programs.  Windows programs print to a captured LPT port also.  Some
> of the older ones actually require it.
>
> I don't know what WSH is.
>
> I hope I haven't wasted too much band width.
>
> Ryan Novosielski (novosirj at umdnj.edu) wrote:
> >
> >I am not actually using NET USE. I don't have any use for the actual
> >printer ports in DOS. I suppose I could do it this way if there's no way
> >to avoid using the LPT ports. Does this do the same thing as the WSH
> >"AddPrinterConnect" or whatever it's called (my memory is failing me).
> >
> >---- _  _ _  _ ___  _  _  _
> >|Y#| |  | |\/| |  \ |\ |  |  | Ryan Novosielski - Jr. UNIX Systems Admin
> >|$&| |__| |  | |__/ | \| _|  | novosirj at umdnj.edu - 973/972.0922 (2-0922)
> >\__/ Univ. of Med. and Dent. | IST/ACS - NJMS Medical Science Bldg - C630
> >
> >On Wed, 23 Jul 2003, Bob Crandell wrote:
> >
> >> For Win2K and XP, you can:
> >> NET USE LPT1: \\server\printer /persistent:no
> >>
> >> Ryan Novosielski (novosirj at UMDNJ.EDU) wrote:
> >> >
> >> >Is there such a thing as a Samba logoff script? I am currently using
> >> >[NETLOGON] for logon scripts, but for the adding and removing of printers
> >> >via WSH, I'd prefer to also remove these printers after I log off.
> >> >
> >> >---- _  _ _  _ ___  _  _  _
> >> >|Y#| |  | |\/| |  \ |\ |  |  | Ryan Novosielski - Jr. UNIX Systems Admin
> >> >|$&| |__| |  | |__/ | \| _|  | novosirj at umdnj.edu - 973/972.0922 (2-0922)
> >> >\__/ Univ. of Med. and Dent. | IST/ACS - NJMS Medical Science Bldg - C630
> >> >
> >>
> >> --
> >> Bob Crandell
> >> Assured Computing
> >> When you need to be sure.
> >> bob at assuredcomp.com
> >> www.assuredcomp.com
> >> Voice - 541-689-9159
> >> FAX - 541-463-1627
> >> Eugene, Oregon
> >>
> >>
> >> --
> >> To unsubscribe from this list go to the following URL and read the
> >> instructions:  http://lists.samba.org/mailman/listinfo/samba
> >>
> >
>
> --
> Bob Crandell
> Assured Computing
> When you need to be sure.
> bob at assuredcomp.com
> www.assuredcomp.com
> Voice - 541-689-9159
> FAX - 541-463-1627
> Eugene, Oregon
>
>
> --
> To unsubscribe from this list go to the following URL and read the
> instructions:  http://lists.samba.org/mailman/listinfo/samba
>



More information about the samba mailing list