Solved

Windows 2003 R2 Login Script

Posted on 2010-09-22
6
322 Views
Last Modified: 2012-05-10
I would like to have the login script select the file server closet based on the ip address and where the user is logged in. any help would be greatly appreciated.

Thank you
0
Comment
Question by:JPMCNYC
[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
  • 3
  • 3
6 Comments
 
LVL 31

Expert Comment

by:Justin Owens
ID: 33735560
Use your script to grab the gateway of the computer and store it as a variable.  Then, use an if/then statement to map the file server based on the value of the variable.  To know exactly how to do this, we would need to know what language your login script uses.
0
 

Author Comment

by:JPMCNYC
ID: 33735743
' last edit 05/02/09 12pm
On Error Resume Next

Set WshNetwork = WScript.CreateObject("WScript.Network")
         

'Set oDrives = WshNetwork.EnumNetworkDrives
         

'WScript.Echo "Network drive mappings:"
'For i = 0 to oDrives.Count - 1 Step 2
'      WScript.Echo "Port " & oDrives.Item(i) & " = " & oDrives.Item(i+1)
'Next
 


'unmap/map each drive
'
'for now this is just F:

WSHNetwork.RemoveNetworkDrive "F:", true, true
WSHNetwork.MapNetworkDrive "F:", "\\domain.com\share\shared", true


'unmap/map each drive
'
'for now this is just H:

WSHNetwork.RemoveNetworkDrive "H:", true, true
WSHNetwork.MapNetworkDrive "H:", "\\domain.com\share\home", true


'unmap/map each drive
'
'for now this is just F:

WSHNetwork.RemoveNetworkDrive "I:", true, true
WSHNetwork.MapNetworkDrive "I:", "\\domain.com\share\home\pool\deals\portcos", true


'unmap/map each drive
'
'for now this is just F:

WSHNetwork.RemoveNetworkDrive "J:", true, true
WSHNetwork.MapNetworkDrive "J:", "\\domain.com\share\home\pool\deals", true


0
 

Author Comment

by:JPMCNYC
ID: 33735774
The File servers are on DFS replication. can y ou still point it to local to the session login. for example local site when login is executed according to ip address can you point to the local file not the one in the cloud?
0
Comparison of Amazon Drive, Google Drive, OneDrive

What is Best for Backup: Amazon Drive, Google Drive or MS OneDrive? In this free whitepaper we look at their performance, pricing, and platform availability to help you decide which cloud drive is right for your situation. Download and read the results of our testing for free!

 
LVL 31

Expert Comment

by:Justin Owens
ID: 33735907
Yes, you CAN, but I would not recommend it.  If you are using DFS, you should just point to your share as you do above.  If you really need to, though, you can configure each site to use specific server shares rather than the DFS share.
0
 

Accepted Solution

by:
JPMCNYC earned 0 total points
ID: 33736040
would it mess up anything if you put a local script various logon script from user account?
0
 
LVL 31

Expert Comment

by:Justin Owens
ID: 33737415
I am not sure I understand your question.  Would you mind restating it?
0

Featured Post

The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Question has a verified solution.

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

Group policies can be applied selectively to specific devices with the help of groups. Utilising this, it is possible to phase-in group policies, over a period of time, by randomly adding non-members user or computers at a set interval, to a group f…
This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

690 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