[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Kixtart IP address based login script

Posted on 2006-11-07
5
Medium Priority
?
1,971 Views
Last Modified: 2008-02-01
Hello,

Does anyone know where I can find a sample Kixtart login script for IP based mappings?  What I would like to do is have the script look at the IP address of the PC, then set it to map drives to the server in the same subnet as the PC, rather than where the user account is based out of in Active Directory.  We have alot of users who move around to different buildings, but we don't want them mapping to servers in other buildings even if their account may be in a different building.  I already have the Kixtart software to get started.

Thanks in advance for your help.
0
Comment
Question by:miket71
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 5

Expert Comment

by:Yogalingam
ID: 17891978
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Establishes $location variable, determined by subnet
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
:IPCHECK
$address = @IPADDRESS0
$subnet = SubStr($address,9,3)
$subnet1 = SubStr($address,13,3)
Select
Case $subnet = "xxx" And $subnet1 >= "xxx" And $subnet1 <= "xxx"
$location = servername-1
"net use d: \\" & $location &"\" & @username &" /persistent"
Case (($subnet = "xxx" And $subnet1 >= "xxx" And $subnet1 <= "xxx") $location = servername2
"net use d: \\" & $location &"\" & @username & " /persistent"
EndSelect

See the link http://www.adminscripteditor.com/forum/tm.asp?m=8320

For more details.
0
 
LVL 5

Expert Comment

by:Yogalingam
ID: 17892004
0
 

Author Comment

by:miket71
ID: 17892937
Thanks for the reply.  Now I was wondering if you can help explain some of the variables and meanings to help get me started.

In an example I have, I would be using a PC on a 10.1.1.X subnet, so I would want it to map to \\SERVERone\SHAREone which is also on a 10.1.1.X subnet.  My location for 10.1.1.X subnet would be called LOCATIONone.

I'm not quite sure how the Address, Subnet, and Locations I use would fit into the script, as I'm starting from scratch here.  I have 13 locations altogether, but with a little more help for the first location in the script, I should be able to add the rest of them in by myself, hopefully.
0
 
LVL 85

Accepted Solution

by:
oBdA earned 1400 total points
ID: 17909731
The code above will NOT return a subnet. It's just looking at the third and fourth octett. A subnet is still calculated by a logical and of the IP address and the net mask.
Here's an example that will calculate the real subnet, including a case statement for the different locations that should get you going:

Dim $SubnetArray[3], $ArrayMask[3]
? "Getting IP information ..."
$SubnetArray = Split(EnumIPInfo(0, 0), ".", -1)
$MaskArray =  Split(EnumIPInfo(0, 1), ".", -1)
for $i = 0 to 3
  $SubnetArray[$i] = Val($SubnetArray[$i]) & Val($MaskArray[$i])
next
$Location = "Subnet-" + $SubnetArray[0] + "." + $SubnetArray[1] + "." + $SubnetArray[2] + "." + $SubnetArray[3]
select
  case ($Location = "Subnet-10.1.1.0")
    ? "Current subnet: 10.1.1.0"
    use X: "\\ServerOne\SomeShare"
  case ($Location = "Subnet-192.168.1.0")
    ? "Current subnet: 192.168.1.0"
    use X: "\\ServerTwo\SomeShare"
endselect
0
 

Author Comment

by:miket71
ID: 17914764
Great, thanks very much for your help.  We will be adding about 13 more subnets to the script so that the IP address of the PC will determine what server and share(s) it will map to.  We have some users who move around to different buildings in the course of a week, so this will come in very handy to make any PC map to and run the database applications based on the IP address/subnet of the PC/building where they are, and not where their login account is in Active Directory.  I will keep you posted on the results.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes a user will call me frantically, explaining that something has gone wrong and they have tried everything (read - they have messed it up more and now need someone to clean up) and it still does no good, can I help them?!  Usually the standa…
Windows 7 does not have the best desktop search built in. This is something Windows 7 users have struggled with. You type something in, and your search results don’t always match what you are looking for, or it doesn’t actually work at all. There ar…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question