Re: Printer Logon script with RootDSE, Subnets, Location

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: DJ Burdette (dburdette_at_cl-na.com)
Date: 01/20/05


Date: Thu, 20 Jan 2005 15:40:03 -0600

This will work if all offices have a site associated with them. We however
only have one site and many subnets. (Not my design) That is why I was
trying to rely on subnets. Thanks for the help.

D.J.

"Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> wrote in message
news:edfPafm$EHA.3596@TK2MSFTNGP12.phx.gbl...
> DJ Burdette wrote:
>
> > I'm trying to make a logon script that will determine the workstations
> > Subnets, and Location to determine what printers it should install.
I've
> > found the information from dsquery subnet -name 192.168.1.*|dsget
> > subnet -loc. This way users won't have to go into Start, Search,
Printers,
> > Printer on the network. I already have the subnets setup on the system,
but
> > I'm having a hard time getting a script to determine what the location
is,
> > and then I have to figure out how to tell it to lookup and install all
> > printers with this information. Any help would be appreciated.
> Hi
>
> If you have Active Directory, and your AD Sites are defined up
> along with your subnet locations, this is another way
> (using VBScript):
>
> '--------------------8<----------------------
> Set oADsSysInfo = CreateObject("ADSystemInfo")
> sSiteName = oADsSysInfo.SiteName
>
> ' use only lowercase text in the site names tests
> Select Case LCase(sSiteName)
> Case "something1"
> MapDrive "k:", "\\server1\share"
> Case "something2"
> MapDrive "k:", "\\server2\share"
> Case "something3"
> MapDrive "k:", "\\server3\share"
> End Select
>
> Sub MapDrive(ByVal sDriveLetter, ByVal sUNCPath)
> Set oWshNet = CreateObject("WScript.Network")
>
> On Error Resume Next
> oWshNet.RemoveNetworkDrive sDriveLetter, True
> On Error Goto 0
> oWshNet.MapNetworkDrive sDriveLetter, sUNCPath
>
> End Sub
> '--------------------8<----------------------
>
>
> WSH 5.6 documentation (local help file) can be downloaded from here
> if you haven't got it already:
> http://msdn.microsoft.com/downloads/list/webdev.asp
>
>
> --
> torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
> Administration scripting examples and an ONLINE version of
> the 1328 page Scripting Guide:
> http://www.microsoft.com/technet/scriptcenter/default.mspx



Relevant Pages

  • Re: Printer Logon script with RootDSE, Subnets, Location
    ... > Subnets, and Location to determine what printers it should install. ... -- torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: ...
    (microsoft.public.windows.server.scripting)
  • Printer Logon script with RootDSE, Subnets, Location
    ... I'm trying to make a logon script that will determine the workstations ... Subnets, and Location to determine what printers it should install. ...
    (microsoft.public.windows.server.scripting)
  • Re: problem with network printers
    ... > I have configured a print server in a win2k3 environment, ... I am unable to attach printers across subnets. ... > network segment as the print server. ...
    (microsoft.public.windows.server.networking)
  • RE: RH4 CUPS
    ... We have 4 subnets each having multi ip printers and what we do in cupsd.conf is ... BrowseProtocols cups ... This restricts all printers from any other subnet. ... Subject: RH4 CUPS ...
    (RedHat)