Re: Printer Logon script with RootDSE, Subnets, Location
From: DJ Burdette (dburdette_at_cl-na.com)
Date: 01/20/05
- Next message: Torgeir Bakken \(MVP\): "Re: All info on local users"
- Previous message: deeman12: "Re: All info on local users"
- In reply to: Torgeir Bakken \(MVP\): "Re: Printer Logon script with RootDSE, Subnets, Location"
- Messages sorted by: [ date ] [ thread ]
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
- Next message: Torgeir Bakken \(MVP\): "Re: All info on local users"
- Previous message: deeman12: "Re: All info on local users"
- In reply to: Torgeir Bakken \(MVP\): "Re: Printer Logon script with RootDSE, Subnets, Location"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|