Solved

Drive not mapping login script

Posted on 2011-09-16
4
442 Views
Last Modified: 2012-05-12
I have a login script that maps drives for users: -
'// Map  drive
  If xuser = "auser" Then
  xNetwork.RemoveNetworkDrive "B:"
  xNetwork.MapNetworkDrive "B:", "\\server\share"
  objShell.NameSpace("B:").Self.Name = "Drive Name"
End If

This works for most users but one has problems and it only works occasionally.

Can anyone help?
0
Comment
Question by:HKFuey
  • 3
4 Comments
 
LVL 29

Assisted Solution

by:Randy Downs
Randy Downs earned 500 total points
ID: 36549034
You could try this

http://blogs.technet.com/b/grouppolicy/archive/2009/02/11/gp-preferences-will-reduce-logon-scripts-mapping-drives.aspx

GP Preferences will dramatically reduce your logon scripts

 GP Preferences has clean, easy-to-use reporting and UI

 

Lots of things get accomplished in scripts (mapped drives, set registry keys, managed devices, etc. )  GP Preferences can do all of that, plus you’ll be able to manage the setting in the UI, target your config with cool filtering, and use the reporting to see what you did. I’ll show you what I mean by using GP Preferences to map a drive.

 

Open up GPEdit for the GPO in question; click the ‘User Configuration’ folder, then click the ‘Preferences’ folder. You can see all of the user-relevant options you can set in Preferences. Find Drive Maps under ‘Windows Settings.’

Now right-click on Drive Maps and select ‘new’. You will see the dialog below: these drop down menus allow you to configure what you’ve been scripting, and more, in UI.

Here, I just filled in a couple things, the location (\\server\Users\%logonuser%) , the label (“User”), and the drive letter to use (“U:\”).
0
 

Author Comment

by:HKFuey
ID: 36549122
Hi number 1, will have a look next week when our techie gets back from hols.
0
 

Accepted Solution

by:
HKFuey earned 0 total points
ID: 36565825
In the script we were deleting then adding the mapped drive, I just removed the line that deleted it.
0
 

Author Closing Comment

by:HKFuey
ID: 36991249
Thanks for the help
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

Suggested Solutions

Over the years I have built up my own little library of code snippets that I refer to when programming or writing a script.  Many of these have come from the web or adaptations from snippets I find on the Web.  Periodically I add to them when I come…
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…
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 …

726 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