Run a Logon Script for User Group for Domain Server

active-directorydomain-controllergroup-policyscriptingwindows-server-2012-r2

I've been searching for an hour and have not had any success so if I overlooked this as a previously answered question please let me know.

I am trying to have a logon script that maps drives on all computers in the domain. I have followed this: https://technet.microsoft.com/en-us/library/cc781361(v=ws.10).aspx for adding the script. However it still does not run for users on the domain when they log onto their computers. Do I need to push it to the machines or activate it in some way?

To get into the Group Policy Editor I did the following (This might explain why its not working to someone). I went into Group Policy Manager –> Forest –> Domains –>MyCompany.local –Default Domain Policy. I right clicked on that and hit EDIT and from there I followed the instructions in the above link. Then I went back to Group Policy Management and right clicked on Default Domain Policy and hit "Enforced". Still nothing when users log in.

Any help is appreciated. I am a developer not a sysadmin so active directory is out of my area of expertise.

I am using Windows 2012 Server Standard R2

The PC IS on the domain.

Two weird things (possibly a hint for someone more knowledgeable)

1- When I log onto the server as the user through RDP it DOES map the drives I have set in the Group Policy Editor. But the script doesn't appear to be running (which maps other drives).

2- If I open explorer and browse to the folder with my script \MyCompany.local\sysvol\MyCompany.local\Policies{RANDOMGUID}\USER\Scripts\Logon and I try to run the script I receive this warning so I am not sure if this is a permissions issue?

http://i.stack.imgur.com/qDIwe.png

I have also tried gpupdate /force on the PC

Best Answer

I have a few suggestions.

As far as best practices go, I'd advise against modifying your Default Domain Policy. It's better to create additional policies as you need them. Having Group Policy Objects for each purpose makes it easier for you to link/unlink as you need to.

Second, if you have a 2008R2 domain and can use Group Policy preferences to map drives, that's going to be a far nicer solution. GPP negate the need for login scripts and give you a lot more control with a lot less scripting.

Here's an article detailing the process: http://blogs.technet.com/b/askds/archive/2009/01/07/using-group-policy-preferences-to-map-drives-based-on-group-membership.aspx

If you have XP clients, you'll need to install the Group Policy Client Side Extensions: https://www.microsoft.com/en-ca/download/details.aspx?id=3628