1

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

I have also tried gpupdate /force

  • Did you ever get this resolved? I know exactly what you need to do to get a login script to run for all domain users at login. If you need help, I have an answer for you so let me know. – Pimp Juice IT Mar 1 '18 at 18:35
  • No I didn't get it to work. – Cade Jun 24 '18 at 13:21
  • Cade - Great, I just added an answer for you that should help you resolve this easily just as I outlined. – Pimp Juice IT Jun 24 '18 at 16:52
0

Setting up Logon Scripts to Map Drives at Logon


1. Create the Drive Mapping(s) Logon Script

Note: This example uses "L" and "H" drive to map to UNC paths to server shares for those drive mappings but you can scale, adjust accordingly, etc. for your needs.

IF EXIST L: NET USE L: /DELETE /YES
IF EXIST H: NET USE H: /DELETE /YES

NET USE L: \\<ServerName>\departments
NET USE H: \\<ServerName>\Homes\%username%

EXIT /B

2. Copy the Login Script to the Domain Sysvol Share

Go to \\%logonserver%\sysvol from a domain admin account once logged onto a machine. Once in there you will see a shortcut link with the domain name and you will want to click to go into it. Once in it you will see a folder named scripts and this is the folder the login script will reside.

Domain Name Folder Shortcut Link

  • enter image description here

Scripts Folder

  • enter image description here

Login Script

  • enter image description here

3. Configure AD Account to use Logon Script

From Active Directory Users and Computers (logon to a domain controller), open the user account object which you want to map drives with a logon script. In the account's properties, go to the Profile tab and then in the Logon script field you type in just the file name of the batch file logon script name only that you dropped into the \scripts folder per the above step #2.

enter image description here


Final

Simply logoff any machines this account is already logged onto and then log back onto that machine for the drives to be mapped so if you're already logged onto a machine with that domain user account which you need the drive mapping(s), simply logoff of it and then log back onto it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.