Weird Win 2008 Logon Script Issue
Hi Everyone,
I have a really weird problem that I just can't get to the bottom of and I hope someone can point me in the right direction.
We have a Win 2008 Terminal Server connected to an SBS 2003 Domain which houses/issues the logon script via a GPO.
A users logs onto the Terminal Server on a PC and the logon script executes and maps the drives for the user as expected. The user, while still logged onto the original session, moves to another PC and logs onto Terminal Services only this time the drives aren't mapped for some reason.
I have run gpresult and it claims that the script is being run in both sessions, yet clearly it isn't. It is not just limited to this particular user, any user who logs onto a second session does not receive the mapped drives really weird.
I have tried mapping the drives via both batch file and vbscript all have the same result.
If I manually run the script within the user session it works and the drives are available and usable so it's not like Windows is limiting the user to one set of mapped drives per logon. I've even tried to change the licensing mode from "user" to "device" and this also made no difference.
Has anyone had this issue, and if so how did you rectify it?
Thanks in advance...
Duke
September 8th, 2009 4:38pm
Duke-If you openyour group policy managerand go to user configuration> policies> windows settings> scripts> logon what is the name of your logon script?Michael
Free Windows Admin Tool Kit Click here and download it now
September 9th, 2009 3:21am
Duke-If you openyour group policy managerand go to user configuration> policies> windows settings> scripts> logon what is the name of your logon script?Michael
Michael,The file name is TerminalSvrLogon.cmdDuke
September 9th, 2009 6:26am
Hi Duke,
According to your description, I understand that:
When your user logs onto the terminal server from the 2nd computer, the logon script didnt map the drive accordingly.
If I have misunderstand you, please do not hesitate to let me know.
Generally speaking, The logon script is only run once the user logon process. So when your user logon to TS server from the 2nd computer, does it start a new terminal session or seize the 1st computer session? When this issue occurs, if you logoff the user and logon again on the 2nd computer, does it mapped the drive correctly?
Best Regards,
Wilson JiaThis posting is provided "AS IS" with no warranties, and confers no rights.
Free Windows Admin Tool Kit Click here and download it now
September 9th, 2009 9:07am
Hi Wilson,Yes, when the user goes to the second PC a new Terminal Server session is started. I can see it in the list and it has a separate session ID. You asked: if you logoff the user and logon again on the 2nd computer, does it mapped the drive correctly?Yes, the drives map correctly. But only if you have also logged off the first session as well.It is just that the second session of any user on any PC the script does not run. This is too weird and has been driving me mad for about 2 weeks now...ThanksDuke
September 9th, 2009 9:24am
Hi Duke,Thanks for your update.Based on the test, I didnt reproduce the issue on my side.
To narrow down the issue, Could you try to assign another user configuration policy to the terminal users? Such as remove search link from the Start Menu Does it apply to the 2nd terminal session?Best Regards,WilsonThis posting is provided "AS IS" with no warranties, and confers no rights.
Free Windows Admin Tool Kit Click here and download it now
September 9th, 2009 12:21pm
Hey Wilson,I changed the "Password protect the screen saver" and it successfully applied to both sessions so it seems it's just the logon script that is not being run for some reason...Does it give you any ideas?Duke
September 9th, 2009 12:58pm
Hi Duke,It seems that only logon script doen't apply to the 2nd session. If you disable "Delete temporary folders on exit" and "Use temporary folders per session" in Terminal Service configuration on the TS, what's the result?Please paste a copy of the script file here for the further test.Best Regards.WilsonThis posting is provided "AS IS" with no warranties, and confers no rights.
Free Windows Admin Tool Kit Click here and download it now
September 9th, 2009 1:54pm
Wilson,I disabled both your suggestions and still no good. Here is the script as requested:net use M: \\servername\Management /PERSISTENT:NOnet use S: \\servername\Sales /PERSISTENT:NOnet use O: \\servername\Office /PERSISTENT:NOnet use U: \\servername\Users\%username% /PERSISTENT:NOnet use W: \\servername\Workgroup /PERSISTENT:NOnet use J: \\servername\Financial /PERSISTENT:NOVery simple, nothing fancy...You know what is even more weird? I fired up our old Win 2003 Terminal Server and ran the same test. Everything worked as expected in both sessions. No problem at all with drive mapping... What is going onhere?... I must have missed something on teh Win 2008 Server somewhere but for the life of me can't think of anything...Duke
September 9th, 2009 2:07pm
Hi Duke,
Based on your script, I still could not reproduce the issue, here is an alternative method that you can use the new Group policy Preference function in Windows Server 2008 to map the drive for your users.
According to your environment, you may follow the steps:
1. Open the Server manager on the Windows 2008 Terminal server, Install Group Policy Manage feature.
2. Open the GPMC on the TS server, create a GPO which links to your map drive user's OU.
3. Right-click and Edit, navigate to [User Configuration\Preferences\Windows Settings\Drive Maps]
4. In the right panel, create the drive maps accordingly.
5. Run gpudate /force on the TS server.
Foryour referenceabout GPP, please refer to:
http://www.msserveradmin.com/the-one-reason-you-should-use-group-policy-preferences/
http://social.technet.microsoft.com/Forums/en-US/windowsserver2008r2general/thread/7600c8ed-857e-4c05-8853-df388ad018b2
This posting is provided "AS IS" with no warranties, and confers no rights.
Free Windows Admin Tool Kit Click here and download it now
September 10th, 2009 7:25am
Hi Wilson,Tried that but when I right click to edit the mmc crashes and the event log shows:Event ID 1000
Faulting application mmc.exe, version 6.0.6002.18005, time stamp 0x49e01c0a, faulting module mmc.exe, version 6.0.6002.18005, time stamp 0x49e01c0a, exception code 0xc0000005, fault offset 0x000662c3, process id 0x1918, application start time 0x01ca31d73dba49e3.
This is getting stranger by the day... Did you read above that when I tried it on our old Win 2003 Server it work perfectly?Thank so much so far for the effort you've put into this with me...Duke
September 10th, 2009 8:39am
Hi Duke,
Sorry for my later reply. After I did some tests and researches, I found actually the logon script is not applied when the second user logs on to a terminal session. Verify it in the result of rsop.msc and check the logon scripts last run time stamp.
To work around this issue, you may configure a logon script to create a new registry value in the [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run] key to run the map drive batch file. It will always be run in this way.
Thank you for your patient and cooperation.
Best Regards,
WilsonThis posting is provided "AS IS" with no warranties, and confers no rights.
Free Windows Admin Tool Kit Click here and download it now
September 10th, 2009 1:21pm
To work around this issue, you may configure a logon script to create a new registry value in the [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run] key to run the map drive batch file. It will always be run in this way.
Hi Wilson,So I'm not going mental after all!!....Thank God someone else could replicate the issue. An alternative to the above hack is to apply the logon script to each User Profile Property Sheet in AD and then it works as expected as well...Will there be a patch for this issue at any stage in the future? Reason I ask is because if you need multiple logon scripts for different OU's your solution and my work around won't work.Thanks for all your efforts...Duke
September 10th, 2009 1:57pm
I am having the same problem that Duke described above. When a user logs in multiple times on the same terminal server, the login script does not execute in the second session. Wilson, can you comment on if there are any patches in the works for this? Has it been reported as a bug?
Free Windows Admin Tool Kit Click here and download it now
February 1st, 2010 9:36pm
We're having the exact same issue. Workarounds not possible in our hosting environment. This has forced a huge re-thinking of our plans to upgrade server farm from 2003 to 2008 this month as all our tests are failing. We have confirmed that the problem exists exactly as he said it does, whether using VBS or BAT files, in 2008 but NOT in 2003. Given that 2008 is supposed to be better with session management (especially the new Easy Print driver) this is a huge problem. Does anyone know if Microsoft is working on it? The support tech I worked with yesterday tried to tell me I was crazy, so I'm thinking they're not yet aware.
February 10th, 2010 8:55pm
We are having the same issue with our 2008 R2 Terminal Server. Has there been any progress in a FIX for this. Thank You for your help with this matter, Aaron
Free Windows Admin Tool Kit Click here and download it now
March 5th, 2010 2:19am
Hi!I have the same problem. I can se that GPO and logon script is running. I can even se that the connection to network share is done successfully, but the drives do not appear in Windows Explorer. Kind regards,Katrin
March 9th, 2010 4:59pm
We are having the same issue, but only Administrators seem to have the problem. Drives map fine for non-admins. We also noticed that if, as an admin, you launch a command prompt, the drive cannot be accessed, but if you right-click on command prompt and 'Run as administrator' the drives are accessable. We have a VBScript that is assigned via group policy (drive mapping by group) and it creates a log file that shows that the drives are mapped, both for Admins and regular users.
Free Windows Admin Tool Kit Click here and download it now
March 11th, 2010 12:29am
Hi everyone, me again,
We have just rolled out an SBS 2008 server and tried to issue the logon scripts via a GPO to a Win 2008 R2 Terminal Server and the problem still remains with the second logon. I was hoping that if the domain was 2008 that it would resolve the problem, but sadly no...
Is there any way that this problem can be raised as a bug and fix issued in the near future. Is there a website that Microsoft has that these sort of bugs can be posted? I looked and couldn't find one...
It's a real pain to have to run the scripts via the User Profile and it makes it more complicated when you have multiple groups that require different logon scripts.
Any help would be really appreciated.
Thanks in advance...
Duke
March 21st, 2010 4:47pm
Hi everyone,
I've actually been working with MS tech support on this recently. There is a hotfix for Windows 2008 that is ready for testing, but not released yet. The hotfix for Windows 2008 R2 is supposed to be ready for testing sometime in early April. As I am running R2, I'm waiting for the hotfix in April. However, if anyone is running just plain 2008, you may want to contact tech support and tell them you're willing to test the hotfix. I believe they're looking for feedback.
Free Windows Admin Tool Kit Click here and download it now
March 24th, 2010 4:19pm
I've actually been working with MS tech support on this recently. There is a hotfix for Windows 2008 that is ready for testing, but not released yet. The hotfix for Windows 2008 R2 is supposed to be ready for testing sometime in early April. As I am running R2, I'm waiting for the hotfix in April. However, if anyone is running just plain 2008, you may want to contact tech support and tell them you're willing to test the hotfix. I believe they're looking for feedback.
Hi stack227,
Do you have a URL as to where to obtain the hotfix for 2008?
Thanks
Duke
March 24th, 2010 4:33pm
hello, I meet the same problem. How can i have the same fix to test. what is the fix ID ou KB id?
Free Windows Admin Tool Kit Click here and download it now
April 2nd, 2010 12:33pm
Same problem here any links to the hotfix
April 12th, 2010 10:58pm
Good news. A KB article was just posted regarding this isssue.
http://support.microsoft.com/kb/976036
I have not tested the hotfix yet, but will probably be doing so today.
Free Windows Admin Tool Kit Click here and download it now
April 20th, 2010 3:44pm


