Need 2003 terminal server to ignore group policy, active directory domain, mapping drives.........

Hello All, Hope you can help!!!

     I have a single windows 2003 active directory domain spread accross 3 sites using 3 servers (1 at each site). I use group policy to run .vbs scripts to map users drives to the relevant servers/directories. I have build a 2003 terminal server joined to the domain as a member server that users will need to access using thier normal domain username/passwd. For the users to run the application I am running on the terminal server they need a specific drive mapped, unfortunatley when they log on to the terminal server thier usuall group policy is running, forcing thier normal .vbs scripts to run causing errors as the drive letter I need to map on the terminal server is mapped in thier normal login but to a different place. I cannot change the drive letters so I need a way to get the terminal server to ignore thier group policy settings or some magic .vbs script that can determin what server they are loggin onto & act accordingly.
PhotronicsBridgendAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Chris DentPowerShell DeveloperCommented:

I'm not sure how well it works with scripts...

But if you move the Terminal Server into it's own Organisation Unit. Then create a Group Policy object for that OU which enabled Loopback Policy Processing in Replace Mode.

To do that, create a group policy, go to Computer Configuration, Administrative Templates, System and Group Policy. Then set "User Group Policy loopback processing mode" to Enabled and Replace.

Now policies set on the Terminal Server OU will overwrite any settings defined on the users policies which should allow you to apply a different script setting. All other user policies will apply as normal.

Any good?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
PhotronicsBridgendAuthor Commented:
Had looked at his but wasn`t quite sure about how to implement it on the terminal server. Will give it a try..Cheers
0
Chris DentPowerShell DeveloperCommented:

If it doesn't I have another way (which is via script). Which I'll post as soon as I've finished messing around with it ;)
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Chris DentPowerShell DeveloperCommented:

Probably the easiest way to handle the script is via the Computer Name - so when you have someone log onto a specific computer you can do things differently.

There are other options such as the Operating System name, but since I don't have a Terminal Server to test it on I'm not sure that's going to be reliable.

Now to grab the computer name we have several options, it can be read from the Windows Management Instrumentation or from the list of Environmental Variables. We'll use the Environmental Variables for this example:

' This script uses the Windows Shell object to read in the Environmental Variable for
' the Computer Name

Dim objShell, objEnvVar

' Create a Shell Object

set objShell = CreateObject("Wscript.Shell")

' Read in the variables

Set objEnVar = objShell.Environment("PROCESS")

' Then check against one

If (objEnVar.Item("ComputerName") = "The-Terminal-Server") Then
    <This is where the things we want to do goes>
End If

Now how you want to implement that depends on what you have in place at the moment. One crude method is simply to tag it onto the end of your existing scripts with the script below - which basically deletes the existing mapping and makes a new one:

If (objEnVar.Item("ComputerName") = "The-Terminal-Servers-Name") Then    
    strDrive = "L:"
    strSharePath = "\\<Server>\<Share>"

    bolDrive = objFileSystem.DriveExists(strDrive)
    If (bolDrive = FALSE) Then
        objNetwork.MapNetworkDrive strDrive, strSharePath
    Else
        objNetwork.RemoveNetworkDrive strDrive
        objNetwork.MapNetworkDrive strDrive, strSharePath
    End If

End If


And just for clarity (if that's at all possible at this stage), that gives the full section of code as:

Dim objShell, objEnvVar, objFileSystem, objNetwork
Dim strDrive, strShare
Dim bolDrive

' Initialize Objects

Set objFileSystem = CreateObject("Scripting.FilesystemObject")
Set objNetwork = CreateObject("WScript.Network")
Set objShell = CreateObject("Wscript.Shell")

' Read in the list of variables

Set objEnVar = objShell.Environment("PROCESS")

' Re-map the drive if the Computer Name is the Terminal Server

If (objEnVar.Item("ComputerName") = "The-Terminal-Servers-Name") Then    
    strDrive = "L:"
    strSharePath = "\\<Server>\<Share>"

    bolDrive = objFileSystem.DriveExists(strDrive)
    If (bolDrive = FALSE) Then
        objNetwork.MapNetworkDrive strDrive, strSharePath
    Else
        objNetwork.RemoveNetworkDrive strDrive
        objNetwork.MapNetworkDrive strDrive, strSharePath
    End If

End If
0
Chris DentPowerShell DeveloperCommented:

Let me know if you have any problems with that lot or need any further details. :)
0
PhotronicsBridgendAuthor Commented:
hay Chris, haven`t forgotten about you. Just trying to find time to test this with some (live) users. I have used the GPO route which seems to have worked well with the single test user I tried this morning . As I said need to get some actual users to test this with me which will be this afternoon.. Will let you know how it goes..PS Probably gonna use your script anyway but for something else...   ;-)  if thats OK..Cheers
0
Chris DentPowerShell DeveloperCommented:

No problem at all.

Yell if the script doesn't work as you expect or it needs changing (or fixing) in any way.
0
PhotronicsBridgendAuthor Commented:
Worked a treat, thanks Chris ! ! You are a Gent.. Wiil sort your points out now,
0
Chris DentPowerShell DeveloperCommented:

Glad it helped :)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Server 2003

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.