Let's see if I can get another simple answer to what feels like a simple question. I have had absolutly zero success finding a solution.
A few hours ago I was helped with a login script I am putting in place on our network. In the process of finding the answers to my previous questions I found that I could make my script a little more dynamic.
I am now seeking advice and direction on Mapping Printers based off of my location on the network and my IP address on login. Problem is, my users are logging into the terminal server which always has the same location.
Is there a simple way to have the Terminal Server Login script grab the client IP address to then use to set a default printer close to the user? I only have two locations with their own unique IP sets:
- 10.0.39.X
- 10.0.40.X
I guess to add a third would be some sort of way to ignore those who sign in from home via the VPN and aren't looking to print anything.
I would like the script to assign a printer based off of their client IP address is a 39 or a 40.
Again, I am using Windows 2003 Server as my OS. This is not Citrix.
Here is my current login script:
A few hours ago I was helped with a login script I am putting in place on our network. In the process of finding the answers to my previous questions I found that I could make my script a little more dynamic.
I am now seeking advice and direction on Mapping Printers based off of my location on the network and my IP address on login. Problem is, my users are logging into the terminal server which always has the same location.
Is there a simple way to have the Terminal Server Login script grab the client IP address to then use to set a default printer close to the user? I only have two locations with their own unique IP sets:
- 10.0.39.X
- 10.0.40.X
I guess to add a third would be some sort of way to ignore those who sign in from home via the VPN and aren't looking to print anything.
I would like the script to assign a printer based off of their client IP address is a 39 or a 40.
Again, I am using Windows 2003 Server as my OS. This is not Citrix.
Here is my current login script:
Code:
Option Explicit
Dim objNetwork, strUNCPrinter, strUserName, strComputer
strUNCPrinter = "\\FURNACE\MAIN_PRINTER"
Set objNetwork = CreateObject("WScript.Network")
On Error Resume Next
objNetwork.AddWindowsPrinterConnection strUNCPrinter
objNetwork.SetDefaultPrinter strUNCPrinter
strUserName = objNetwork.UserName
objNetwork.MapNetworkDrive "H:" , "\\SERVER1\USERS\" & strUserName
objNetwork.MapNetworkDrive "E:" , "\\SERVER1\FOLDER1"
strComputer = objNetwork.ComputerName
Select Case Left(strComputer,4)
Case "SERV"
objNetwork.MapNetworkDrive "R:" , "\\SERVER2\FOLDER2"
objNetwork.MapNetworkDrive "S:" , "\\SERVER2\FOLDER3"
End Select
WScript.Quit