Re: Printer Logon script with RootDSE, Subnets, Location
From: Torgeir Bakken \(MVP\) (Torgeir.Bakken-spam_at_hydro.com)
Date: 01/19/05
- Next message: Torgeir Bakken \(MVP\): "Re: How to execute the logon script when the network cable is conn"
- Previous message: Torgeir Bakken \(MVP\): "Re: batch file to open IE when user is login to a specific computer"
- In reply to: DJ Burdette: "Printer Logon script with RootDSE, Subnets, Location"
- Next in thread: DJ Burdette: "Re: Printer Logon script with RootDSE, Subnets, Location"
- Reply: DJ Burdette: "Re: Printer Logon script with RootDSE, Subnets, Location"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 19 Jan 2005 21:45:29 +0100
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: How to execute the logon script when the network cable is conn"
- Previous message: Torgeir Bakken \(MVP\): "Re: batch file to open IE when user is login to a specific computer"
- In reply to: DJ Burdette: "Printer Logon script with RootDSE, Subnets, Location"
- Next in thread: DJ Burdette: "Re: Printer Logon script with RootDSE, Subnets, Location"
- Reply: DJ Burdette: "Re: Printer Logon script with RootDSE, Subnets, Location"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|