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?
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.
Server 2003 or 2008?
mt3dekAuthor Commented:
Server 2003 R2 STD
Upgrade your Question Security!

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


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

All Courses

From novice to tech pro — start learning today.