[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

Windows Login Script Error

Posted on 2008-02-08
8
Medium Priority
?
373 Views
Last Modified: 2012-06-27
Hi,
I logged in to XP machine connected to Windows 2003 Active Directory domain. My home directory mapped through a login script--- issues: 1) each time I login in I lose my home directory so I have to map it manually again 2) I keep getting error message on my screen (see attached file) the blank is the server name. How do I fix this error message?
Thanks,
Savi

scripterror.bmp
0
Comment
Question by:savoyajolie
8 Comments
 
LVL 66

Expert Comment

by:johnb6767
ID: 20854071
Is your DNS server in the system set to the internal DNS Server for the domain?
0
 

Author Comment

by:savoyajolie
ID: 20854187
Can you clarify your question? If you meant that the server reporting netlogon script error is a DNS server yes it is.
0
 
LVL 8

Accepted Solution

by:
kind4me earned 375 total points
ID: 20854496
logintest.vbs is attempting to map a drive that is already mapped.  With in the VBS script you should clear the mappings on the drives before assining them.  Something like this:

<<Script Start>>
On Error Resume Next

Set objSysInfo = CreateObject("ADSystemInfo")
Set objNetwork = CreateObject("Wscript.Network")

'removes mapped drive H
objNetwork.RemoveNetworkDrive "H:", True, True

'creats maped drive H
objNetwork.MapNetworkDrive "H:", "\\Server\Share"
<<Script End>

This will remove the mapping, then go ahead and run the line to map it.
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:savoyajolie
ID: 20854607
We have already a script called login.vbs that allows home directory and other network drive mapping. Can I delete logintest.vbs from netlogon?
If I use your script where do I run it under netlogon or on the my desktop?
0
 
LVL 8

Expert Comment

by:kind4me
ID: 20854681
wait wait, don't run my script per se.  I just wanted to give you an example.  Here is what I think is happening from your slighlty unclear explaination.  You are asking the script logintest.vbs to map a drive for you that is already mapped.  It is faulting and doesn't have "On Error Resume Next".  So either the script fails before mapping the drives, or the confilict in the script prevents the drives from being mapped.

You have mentioned nothing about login.vbs in you earlier posts so I can't advise you on that.  What I can tell you is that I find it to be bad practice to run 2 scripts that are meant to compliment each other at the same time.  You should combine the scripts into one so you don't get timing issues.  If you are not familiar with VBS maybe go back to a batch script, I prefer batch for longin scripts.  

You can use my code snipit to remove any drive mappings that you will be assigning later in the script.  Said another way:  if my script is going to assign an H: drive to \\server\%username\  I will have the script remove any mappings to H: that may already exist on the computer first using the code above and then later in the same script map the H: drive
0
 
LVL 8

Expert Comment

by:kind4me
ID: 20855124
Set clDrives = WshNetwork.EnumNetworkDrives
For i = 0 to clDrives.Count -1 Step 2
WSHNetwork.RemoveNetworkDrive clDrives.Item(i), True, True
Next

is better for clearing drives if you want to use code I give you.
0
 
LVL 15

Assisted Solution

by:sr75
sr75 earned 375 total points
ID: 20855283
Did you check to see if H: wasn't already being set by Active Directory as well.  That will cause those issues (even if you think you are removing the mapping).
0
 

Author Comment

by:savoyajolie
ID: 20922042
Thank you very much kind4me and sr75 I learned something new from both of you. The problem was reported to me but I never wrote those scripts and I wrote to you becuase I want to implement a better scripting by understanding the problem first. Having said that I would like

1) To replace the VBS script using batch files for login scripts--- kind4me can you assist me how to get better information on writing a batch

2) sr75 to answer your question the user's H: drive was mapped through Active Directory as well. So do you want me to remove the Active Directory mapping if we are using the script mapping? Are you recommending to use either Active Directory mapping or login script mapping instead of using both?

Thanks,
Savi
0

Featured Post

Upgrade your Question Security!

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

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension . This reminded me of questions that come up here at EE along the lines of, "How can I tell the type of file from its cont…
Virtualization software lets you run different versions of Windows, Ubuntu Linux and other versions of Linux all at the same time, rather than running each one directly from your computer's hard drive.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
Suggested Courses

591 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question