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?
mt3dekAsked:
Who is Participating?
 
puterg33kCommented:
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.
0
 
abt-itCommented:
Server 2003 or 2008?
0
 
mt3dekAuthor Commented:
Server 2003 R2 STD
0
Upgrade your Question Security!

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

 
TimorosCommented:
http://www.mydigitallife.info/2006/09/13/group-policy-login-or-logon-scripts-not-running-not-working-or-not-executing/

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:
http://technet.microsoft.com/en-us/library/cc736961%28WS.10%29.aspx

Optimize group policy object processing to protect network speed:
http://articles.techrepublic.com.com/5100-10878_11-5034267.html
0
 
puterg33kCommented:
what if you call the HTML file from a UNC path (ie. \\server\sharename\htmlfile) rather than a drive letter?
0
 
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
0
 
mt3dekAuthor Commented:
Here is the Code i currently have. I would love to  put everything UNC path but every attempt something has gone wrong.
WScript.Sleep(10000)

dim objExplorer

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

'-------------------------------------------------------------------------------------------------------------------------------
'    open ie
'-------------------------------------------------------------------------------------------------------------------------------
sub open_ie
    Set objExplorer = CreateObject("InternetExplorer.Application")
        with objExplorer
    .Width=800
    .Height=600
    .Left=150
    .Top=50
    .Visible=true
    .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
    Loop
    HTMLTextfile = HTMLScr
    objReadFile.Close
end function

Open in new window

0
 
puterg33kCommented:
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.  

http://gallery.technet.microsoft.com/ScriptCenter/en-us/site/search?f[0].Type=SearchText&f[0].Value=HTA&x=0&y=0

http://www.experts-exchange.com/articles/Web_Development/Miscellaneous/HTA-Hypertext-Application-tutorial.html


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.

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