Solved

Windows 2003 R2 Login Script

Posted on 2010-09-22
6
319 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
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

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

In this article, we will see the basic design consideration while designing a Multi-tenant web application in a simple manner. Though, many frameworks are available in the market to develop a multi - tenant application, but do they provide data, cod…
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
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 transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…

895 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now