Link to home
Start Free TrialLog in
Avatar of miket71
miket71Flag for United States of America

asked on

Kixtart IP address based login script

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.
Avatar of Yogalingam
Yogalingam

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;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.
Avatar of miket71

ASKER

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.
ASKER CERTIFIED SOLUTION
Avatar of oBdA
oBdA

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of miket71

ASKER

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.