Multiple GPO at logon

Hello all,

Here is what I am trying to accomplish. I am trying to have Mapped network drives removed during a logoff process then added when a user logs on, and i have a HTML file with our firm greeting on it.

I used to have all this in a batch file at one time and deploying out with every users profile through Active Directory.

I have gotten my network drives to be removed and added like i want them to. But when i had the GPO for the VBS opening up an HTML file, even though i have this GPO at the very last on the list to process, it would (through most of my testing) map one drive letter then try opening that HTML file that is trying to open through one of the drive letters being mapped. This failed since when the HTML file tried opening the drive it is located on did not add.

I can log off and back on, and things will be ok, maybe 3rd or 4th time it might work.

Any Ideas on how to get this accomplished?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

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.

Server 2003 or 2008?
mt3dekAuthor Commented:
Server 2003 R2 STD

This is usually caused by slow connections !
So you need to enforce the GP to work over slow connection ! not 100% guaranty that will work plus it slows down the client from logging in to the machine

Group Policy Troubleshooting:

Optimize group policy object processing to protect network speed:
Acronis Data Cloud 7.8 Enhances Cyber Protection

A closer look at five essential enhancements that benefit end-users and help MSPs take their cloud data protection business further.

what if you call the HTML file from a UNC path (ie. \\server\sharename\htmlfile) rather than a drive letter?
Scott ThomsonCommented:
i like puts idea..

or you could always code in a timer in the vbs script.. approximately 60 seconds..? or more..?
or you could always throw in some error checking waiting for the drive to appear :)

let me know if you want more info
mt3dekAuthor Commented:
Here is the Code i currently have. I would love to  put everything UNC path but every attempt something has gone wrong.

dim objExplorer

objExplorer.Document.Body.InnerHTML = HTMLTextfile("H:\PUBLIC\Login.htm")

'    open ie
sub open_ie
    Set objExplorer = CreateObject("InternetExplorer.Application")
        with objExplorer
    .navigate "H:\PUBLIC\Login.htm"
    'navigate "file:///H:\PUBLIC\Login.htm"    'alternative
end with
end sub

'    open fileobject
function HTMLTextfile(pathfile)
    Const ForReading = 1
    HTMLScr = ""
    pathfile = trim(pathfile)
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    set objFile = objFSO.GetFile(pathfile)
    Set objReadFile = objFSO.OpenTextFile(pathfile,ForReading)
    Do Until objReadFile.AtEndOfStream
        HTMLScr = HTMLScr & objReadFile.ReadLine
    HTMLTextfile = HTMLScr
end function

Open in new window

I think an hta logon script would be more suited for what you are trying to do.  I have attached a simple HTA file that will map network drives.  You  should be able to modify the HTML section with your existing HTML code  and then update the drive mappings to your existing mappings.  

I would  recommend setting logon.hta as the logon script for every user rather  than trying to do it through GPO it just seems to be more reliable.  I would use the \\yourdomaincontroler\netlogon share as your repository for any images or files you call from this script.  This is also where you will need to store this file to call it as a logon script.

Here are a couple of articles with additional examples.[0].Type=SearchText&f[0].Value=HTA&x=0&y=0

I had to save the file with a .txt extension so make sure to rename it to logon.hta.  You can use Notepad to make any changes to the hta file.

mt3dekAuthor Commented:
there are only two ways that i am aware of to set a logon script, either through gpo or setting it on the users AD account and i am not going to go to everyones AD account and add a logon script for it, that is the whole purpose of GP.
I agree that is the purpose of GP and it would be great if it worked reliably,  but from past experience the most reliable way is to assign it in everyone's AD account.  The above HTA file will work either way if you want to give it a shot in a GPO and see what you get.  Just make sure you store everything in the netlogon share on your domain controller.

On a side note you can always write a VB script to add the login script to your user accounts so you wouldn't need to go to each user directly.

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
mt3dekAuthor Commented:
This user helped accomplish what i wanted to accomplish
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 XP

From novice to tech pro — start learning today.