mickeyshelley1
asked on
I need help mapping a network drive in Group Policy.
Hi,
I am having a problem making this vbs file work in group policy. Basically I am trying to get a certain network drive to map to selected users when they log in. I have placed this in group policy, but i guess that I am not doing it correctly or either the file is bad. The vbs file works fine if I run it manually. Below is the file. Please help, I am at a dead end.
Thanks:
Option Explicit
Dim objNetwork
Dim strDriveLetter, strRemotePath
strDriveLetter = "p:"
strRemotePath = "\\w2kabb1\Database"
' Purpose of script to create a network object. (objNetwork)
' Then to apply the MapNetworkDrive method. Result h: drive
Set objNetwork = CreateObject("WScript.Netw ork")
objNetwork.MapNetworkDrive strDriveLetter, strRemotePath
WScript.Quit
I am having a problem making this vbs file work in group policy. Basically I am trying to get a certain network drive to map to selected users when they log in. I have placed this in group policy, but i guess that I am not doing it correctly or either the file is bad. The vbs file works fine if I run it manually. Below is the file. Please help, I am at a dead end.
Thanks:
Option Explicit
Dim objNetwork
Dim strDriveLetter, strRemotePath
strDriveLetter = "p:"
strRemotePath = "\\w2kabb1\Database"
' Purpose of script to create a network object. (objNetwork)
' Then to apply the MapNetworkDrive method. Result h: drive
Set objNetwork = CreateObject("WScript.Netw
objNetwork.MapNetworkDrive
WScript.Quit
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
once the vbs is done attach to the user side of the gpo and then attach to an ou.
sorry add the following before dim line
ON ERROR RESUME Next
ON ERROR RESUME Next
ASKER
The code works. Can you tell me where I am going wrong in applying it to Group Policy. Shouldn't it be as simple as it running when certain users log on.
Example of Groups:
Admin
-power users
- Users
I have the Group Policy located in the Users folder. Shouldn't that make it to where that policy would apply to the Users only. It is also in the Windows settings/logon in the properties settings.
Example of Groups:
Admin
-power users
- Users
I have the Group Policy located in the Users folder. Shouldn't that make it to where that policy would apply to the Users only. It is also in the Windows settings/logon in the properties settings.
Are your users residing in the OU you have your GPO linked to? Are you using GPMC? Under the User section/windows settings/scripts/login click on show files, is your script located in there? If not then paste it in there. You might need to run gpupdate /force on the client machine.
Also make sure authenticated users have "read and apply group policy " enabled in the security settings.
That's all you need for it to work.
Also make sure authenticated users have "read and apply group policy " enabled in the security settings.
That's all you need for it to work.
so you set this under user config - windows settings - Scripts - logon.
Once complete you attach to an ou where you moved the group of users
am I right so far?
Once complete you attach to an ou where you moved the group of users
am I right so far?
If you have the group policy located on the users container then that is your problem. The users container is a "container" not an organization unit. You cannot apply gpo's here.
Create a OU and then link it to that OU, then move your users inside the OU.
Create a OU and then link it to that OU, then move your users inside the OU.