Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Windows 2003 R2 Login Script

Posted on 2010-09-22
6
Medium Priority
?
325 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
  • 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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Had a business requirement to store the mobile number in an environmental variable. This is just a quick article on how this was done.
High user turnover can cause old/redundant user data to consume valuable space. UserResourceCleanup was developed to address this by automatically deleting user folders when the user account is deleted.
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 …
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Suggested Courses

810 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