windows 2003 sbs currently patched

clients are a mix of windows xp, vista, and windows 7.

Here is a simple login script I created. If I manually run the script it works just fine and they are no errors. If I set the loginscript under the users profile for the AD account. it does not appear to be running. Non of the printers get map, nor does the drive mappings occur. What am I doing wrong here. The issue happens on XP, I have yet to test on vista or windows 7 yet.

one more thing yes I am calling the script from \server.local\NETLOGON\tmg_login.vbs

Option Explicit
Dim WSHShell, wshNetwork 

Set WSHShell = CreateObject("WScript.Shell")
Set wshNetwork = CreateObject("WScript.Network")

wshNetwork.AddWindowsPrinterConnection "\\server.local\TMG-HP3600"
wshNetwork.AddWindowsPrinterConnection "\\server.local\TMG-xerox2240"

'wscript.sleep 30

wshNetwork.MapNetworkDrive "S:","\\server\DATA", True


Try calling it without the full path. Just having "tmg_login.vbs" in Login Script should also work if the script is at the root of netlogon.

| improve this answer | |
  • omg that was it. It works now. I knew it had to be something simple. – aduljr Nov 3 '09 at 0:54

If it's only happening on Vista (and possibly Windows 7) you may need to lower or disable your UAC. This can interfere with logon script processing (UAC really should have been made Domain-aware, but oh well...)

| improve this answer | |
  • does not run on XP pro clients which is most of the pcs.I Haven't tested on the couple of vista and a couple of soon to be windows 7 machines yet. I am going to dig through the group policies. maybe I missed something. – aduljr Oct 30 '09 at 23:41

Are you saving this script in the NETLOGON share, and then calling it from via the full path? (eg. \\myDomain.loc\NETLOGON\myLogonScript.vbs)


I'm wondering if it's a context issue. Sometimes the mappings will be made as the account running the script (System) and thus as a regular user you can't see the mappings.

Two things to try:

  • Add a MsgBox line to your script. If this message does appear when you log in, then it's a context issue

  • To confirm it's a context issue, after you log in, and you clear the messagebox, open a CMD window and type Net Use. You should not see any mappings. Then, type Net Use S: \\server\DATA. You should get an error message saying the drive is in use

If this is the case, let me know, and I'll tell you how to fix it.

If this isn't the case, the script isn't being called at all.

| improve this answer | |
  • yes I am in the netlogin share. I can see the script there and I can execute it after I login manually. – aduljr Oct 30 '09 at 20:51
  • Check the permissions on the script file itself. If you Cut/Paste the file into place, the permissions may be for Domain Admins only. Ensure that Authenticated Users can Read the file – Izzy Oct 30 '09 at 21:29
  • permissions looks good, authenticated users have access to read and execute the script – aduljr Oct 30 '09 at 23:34
  • I added a message box to my script WScript.echo 'test' no message pops up when I log into the desktop. If I manually run it, then it works fine and the msgbox appears. – aduljr Oct 31 '09 at 1:38
  • also when i try the net use, it does not complain about having the drive already mapped. – aduljr Oct 31 '09 at 1:39

Why not add the script to the users GPO? Setting the script on the user object and putting it in the netlogon folder is a legacy method for running scripts. I'm not saying it's causing your problem but try running it from the GPO and see if anything changes.

| improve this answer | |
  • With all due respect, I disagree. Even Microsoft advises to execute the regular Logon Script via the AD User account setting. Yes, GPO will work, and is better for more complex deployments. technet.microsoft.com/en-us/library/cc784088(WS.10).aspx – Izzy Oct 31 '09 at 2:25
  • With all due respect I disagree. That article is from 2005 and just because Microsoft has an article doesn't mean that's their recommended way of doing it. IMHO using GPO is the best method for assigning scripts to users or computers. There are instances where you need to assign a script directly on a user object, but IMHO those instances are far and few between. No offense intended. – joeqwerty Oct 31 '09 at 2:48
  • at this point I will try anything. I give it a go later tonight when i can run some more tests. – aduljr Nov 1 '09 at 17:43
  • @aduljr: Let us know how it works out for you. – joeqwerty Nov 1 '09 at 17:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.