Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mapping Drives based on IP Range

Status
Not open for further replies.

KevinBugg

Technical User
Feb 8, 2008
65
Hi,

We have 4 sites, all running on different subnets

1. 10.10.x.x
2. 10.20.x.x
3. 10.30.x.x
4. 10.40.x.x

I want to create a logon script that detects the ip address a machine is coming from, then map the relevant printers and drives depending on the ip range. Can someone help with this? Im happy to do the printer and drive mapping etc but detecting the ip range is causing me some problems.

Thanks in advance

Kev
 
you can use something like:
Code:
IPNodes = split(IPAddress, ".")
ip = left(IPNodes (1), 1)
Select Case ip
  Case 1
    DriveLetter = "z"
  Case 2
    DriveLetter = "y"
  Case 3
    DriveLetter = "x"
  Case 4
    DriveLetter = "w"
End Select
 
Check out my FAQ for scripting for multiple physical locations:
That is a follow up to my FAQ for login scripts:
I hope that helps.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top