Solved

Windows 2003 R2 Login Script

Posted on 2010-09-22
6
321 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
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 
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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

Background Information Recently I have fixed file server permission issues for one of my client. The client has 1800 users and one Windows Server 2008 R2 domain joined file server with 12 TB of data, 250+ shared folders and the folder structure i…
Always backup Domain, SYSVOL etc.using processes according to Microsoft Best Practices. This is meant as a disaster recovery process for small environments that did not implement backup processes and did not run a secondary domain controller that ne…
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…
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …

726 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