Avatar of mrmut
mrmut
Flag for Croatia asked on

Can run User logon script on 2012 R2

Have to run a USER Logon script on 2012 server through GPO, but no matter what I do the script doesn't run.

The script is simple:

SUBST Z: N:\DIRECTORY

If I run script manually, it works well. - The same setting worked like a charm on 2003 server.

EDIT1: *I have configured COMPUTER - RDP - Configure Logon Script Delay to 0 minutes.
EDIT2: *I have tried putting explorer.exe and notepad.exe into script, and those two are run correctly. But the "SUBST Z: N:\DIRECTORY" wont run
Active DirectoryWindows 7Windows Server 2012

Avatar of undefined
Last Comment
mrmut

8/22/2022 - Mon
Cris Hanna

You're just trying to map a drive, correct??
Login Scripts pretty much ended with Server 2003, everything now is done via Group Policy or Group Policy Preferences..

Mapping  Drives with Group Policy Preferences https://youtu.be/-m0hIcE8Yr8
Brian B

The network services may not be ready when the script runs. So the drive mapping is not complete. As for test try and copy a file to N:.

As was said, better to create drive mapping with policy. Alternatively, try and put a time delay at the beginning of your script.
Lionel MM

The problem is either that the users trying to use the SUBST command during ,logon do not have the required interactive admin rights or that SBST need to run with elevated rights. Will do some testing for you in the AM but in the meantime see if this info helps you.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
ASKER CERTIFIED SOLUTION
mrmut

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
Lionel MM

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Brian B

If the script requires elevated rights to run, wouldn't it also require elevated rights when you run it manually?

For what it is worth, here is a blog that talks about running elevated rights: https://blogs.msdn.microsoft.com/aaron_margosis/2007/06/29/faq-why-cant-i-bypass-the-uac-prompt/

Did you consider my suggestion? This will at least tell us if the problem is related to the network mapping.
mrmut

ASKER
Currently, I have the issue temporarily solved by HKLM registry hack, but will need to read the lionelmm blog to see what they say on the issue (I would prefer script solution).
mrmut

ASKER
This solved the problem, making server functional.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.