Windows Thread, Problem with Home Drive and login scripts in Technical; Hi there,
I am having a few problems with home drives loosing their mappings after trying to introduce a printer ...
-
5th July 2007, 10:32 AM #1 Problem with Home Drive and login scripts
Hi there,
I am having a few problems with home drives loosing their mappings after trying to introduce a printer mapping script via group policy.
Some history - We have had an AD for several years, but not really utilized group policy for running scripts. All users have their home drive set in their AD user account profile (mapped to Z: ) and a login script (connect.bat). This has been fine and works well.
In the past, all printers (even network ones) were installed as local printers with the effect that all the computers held their own queue which obviously causes problems with monitoring and management.
On to the changes. We created printer queues on one of our servers and shared them into the AD. We then decided to use one of the scripts from here to assign the printers through a login script. The script is:
Code:
Set objWshNetwork = CreateObject("WScript.Network")
Set objAdsSystemInfo = CreateObject("adsysteminfo")
Set objComputerName = GetObject("LDAP://" & objAdsSystemInfo.ComputerName)
Set objOU = GetObject(objComputerName.Parent)
strOU = replace(objOU.Name,"OU=","")
Select Case strOU
Case "Room T1"
objWshNetwork.AddWindowsPrinterConnection "\\SERVER\Room T1 - Laser"
objWshNetwork.SetDefaultPrinter
Case "Room T2"
objWshNetwork.AddWindowsPrinterConnection "\\SERVER\Room T2 - Laser"
objWshNetwork.SetDefaultPrinter
<snip>
End Select This worked fine on all my tests, so we rolled it out to the students and we started to get problems with the Z: drive not being mapped for some of the students when the logged in. It would map to \\server\share but not the \\server\share\userid folder. We rolled the script back and the problems went away, so it was clearly an issue with the script.
I could see no problem with it, but decided to trial a simpler version of the script targetted at just one room. The script them became
Code:
Set objWshNetwork = CreateObject("WScript.Network")
objWshNetwork.AddWindowsPrinterConnection "\\SERVER\Room T1 - Laser"
objWshNetwork.SetDefaultPrinter This still caused problems with the Z: drive - but only in that room, again indicating a problem with the script.
I took out the SetDefaultPrinter line and tried this, and the script ran for a week without causing a single Z: drive mapping problem.
I decided that it must be the SetDefaultPrinter causing a problem, and so removed this from the original script, but on applying this back to the students the z: drive mapping problem happended again straight away.
So - I am at my wits end - there are no entries in any logs I can find, but there seems to be some issue between the home drive mapping, the profile login script and the group policy login scripts. Has anyone seen something like this before - any ideas of what could be wrong?
Many thanks for any help - apologies for the long post - just wanted people to see what I had tried so far.
Cheers
Jonathan
-
-
IDG Tech News
-
9th July 2007, 11:26 AM #2 Re: Problem with Home Drive and login scripts
No thoughts from anyone?
Jonathan
-
-
9th July 2007, 11:35 AM #3 Re: Problem with Home Drive and login scripts
does the script get called before or after the Z: drive is mapped?
does the default printer need ot be set if only one printer is added?
Code:
objWshNetwork.AddWindowsPrinterConnection "\\SERVER\Room T1 - Laser"
objWshNetwork.SetDefaultPrinter
if it is specified to have a default wont you need to supply the printer path
eg
Code:
objWshNetwork.SetDefaultPrinter \\SERVER\Room T1 - Laser"
if the printer script is called before the mapping and the script needs to have the printer specified to default the it may never get around to mapping the drive.
just thoughts
BoX
-
-
10th July 2007, 11:38 AM #4 Re: Problem with Home Drive and login scripts
Have you tried changing the drive letter used? I'm sure Z: is a reserved drive letter used by some system processes.
Mike.
-
-
11th July 2007, 12:17 PM #5
- Rep Power
- 0
Re: Problem with Home Drive and login scripts
We map printers by adding a printer variable value in system properties of our xp machines, we then access using the .dll file to add the correct printer, example shown below.....
if %PRINTER%==whatever rundll32 printui.dll,PrintUIEntry /y /n\\servername\printer
never failed me yet, and its completely away from mapping drives.
-
SHARE: 
Similar Threads
-
By richard in forum Hardware
Replies: 26
Last Post: 31st December 2007, 03:37 PM
-
By djstylus in forum Windows
Replies: 7
Last Post: 20th December 2007, 03:45 PM
-
By tazz in forum How do you do....it?
Replies: 13
Last Post: 5th October 2007, 03:18 PM
-
Replies: 4
Last Post: 16th January 2007, 08:36 AM
-
By k-strider in forum Hardware
Replies: 19
Last Post: 25th October 2006, 03:21 PM
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules