Bryan wrote:
>I am currently using this script to map network drives based on group
>membership.
> http://www.microsoft.com/technet/scr...4/hey1210.mspx
>
> I now need to modify it so it is also based on the location of the
> computer. For instance we have a remote site that uses a ISDN connection
> and I dont want the drive mapings to happen accros this link, instead I
> would like the drive mappings to go to the local server and not accross
> the ISDN line.
>
> So if the user belongs to group a and the ip is 192.168.36.1 then they map
> H to server1\folders
> And then if the user is in group a and the ip is 192.168.56.1 then they
> map H to server2\folders
>
> Let me know if anyone can me or point me in the right direction. I
> hope all it is to just add a couple of lines in the script I am already
> using.
>
> Thank you
> bthompson@dhmh.state.md.us
Retrieving IP address can get complex. One solution could be to use Computer
account group membership. All computers in a subnet could be made members of
a group, then test for computer object group membership. Another option is
to retrieve the Site from AD.
You can use properties of the ADSystemInfo object for this. The
Distinguished Name of the current computer is objSysInfo.ComputerName. The
name of the current site is objSysInfo.SiteName.
--
Richard Mueller
Microsoft MVP Scripting and ADSI
Hilltop Lab -
http://www.rlmueller.net
--