vbs script for mapping network folders

Posted on 2004-11-25
Last Modified: 2010-04-13

I am managing a network of 250 users and 15 servers. I copied a script in vbs and created a test OU and put the script under the logon icon in group policy. Then i put myself in the container and my computer in the OU. I logoff the server and reboot my computer. Once i logon to my computer i get an error message stating that  "an attempt was made to remember a drive that had previously been remembered" . I then go to the OU in question and go into group policy and enable the "no override" link option check box. I did this because there is a logon script at the domain level that maps drives for users throughout the domain. The vbs script that I am having a problem with on the server at the OU level works fine because i double clicked it on my desktop and all the drive mappings are created.
Here is the script:

Dim objNet

Set objNet = CreateObject("Wscript.Network")

objNet.MapNetworkDrive "G:", "\\sdc2fp00\labrma00$"
objNet.MapNetworkDrive "H:", "\\sap3p600\ttplus$"
objNet.MapNetworkDrive "I:", "\\sap3p600\cdi$"
objNet.MapNetworkDrive "J:", "\\sdc2fp00\corporate$"
objNet.MapNetworkDrive "K:", "\\sap3p600\monarch$"
objNet.MapNetworkDrive "W:", "\\sap3p600\cinfo$"

My question is by enabling  the "no override" option in group policy I am preventing domain logon scripts to run at the specific OU. If this is so then why does this script not work at the OU level?

Please help,

Question by:Tacobell2000
    LVL 11

    Accepted Solution

    You have to turn on Block Inheritance on the OU to block policy settings set on higher OUs.  Keep in mind that this will prevent all settings from parents OUs.  Also, if the Parent OU has No Override set, then you cannot block it.
    LVL 20

    Expert Comment

    "I Then i put myself in the container and my computer in the OU" - The user account that you are loggin on with also needs to reside in that OU - If the script is a logon script it only applies to users in the OU, not computers, so it makes no difference if your computer is in there or not in relation to user configuration settings on that gpo. I mention this because it sin't clear where your user account is in relation to that OU (which container is it in?).You may also need to run
    secedit /refreshpolicy user_policy
    from a command prompt on the server to get the policy replicated across the dc's. You can also use this tool to check on the policy application and any conflicts/overrides on the pc you are logging in to,
    Gpresult.exe: Group Policy Results

    Deb :))
    LVL 20

    Expert Comment

    Hi Tacobell - just realised it was you :))

    Author Comment


    Hey Debsyl99. I have figured out what was wrong with the configuration. Basically i had to delete all previous client mapping on the user's computer and then I had to log onto the server and choose the properties of the user and under profile delete the logon script. Then i rebooted the users computer and bingo.....everything works beautifully.
    I have asked the moderators to close the question.

    LVL 20

    Expert Comment

    No probs :))

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Is Threat Intelligence?

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

    NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
    In the modern office, employees tend to move around the workplace a lot more freely. Conferences, collaborative groups, flexible seating and working from home require a new level of mobility. Technology has not only changed the behavior and the expe…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

    760 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

    7 Experts available now in Live!

    Get 1:1 Help Now