Solved

Windows 2003 R2 Login Script

Posted on 2010-09-22
6
318 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:DrUltima
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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 31

Expert Comment

by:DrUltima
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:DrUltima
ID: 33737415
I am not sure I understand your question.  Would you mind restating it?
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Learn about cloud computing and its benefits for small business owners.
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…
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 to another domain controller. Log onto the new domain controller with a user account t…

758 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

22 Experts available now in Live!

Get 1:1 Help Now