Solved

Can run User logon script on 2012 R2

Posted on 2016-09-12
8
91 Views
Last Modified: 2016-09-21
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
0
Comment
Question by:mrmut
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 35

Expert Comment

by:Cris Hanna
ID: 41795309
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
0
 
LVL 24

Expert Comment

by:Brian B
ID: 41795312
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.
0
 
LVL 25

Expert Comment

by:Lionel MM
ID: 41795446
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.
1
RoboForm Secure Password Management System

RoboForm Everywhere - Superb Browser Support
Windows / Apple / IOS / Android / Linux / Chrome OS
Use different complex passwords everywhere
Best Secure Password Management by far
Synchronize all of your devices instantly
Safe, Secure & Highly Recommended!

 

Accepted Solution

by:
mrmut earned 0 total points
ID: 41795535
I need to run SUBST as the program I have i dependent on specific mapped drive: it is on on Terminal Server, and is DB intensive. Doing the usual drive mapping all the traffic goes over network port which slows DP interaction dramatically - therefore SUBST.

I think LIONELMM is right - the script does seem to run, but the user can not access the drive. However, i don't have a clue how to run it with elevated rights.

I did find two ways to circumvent this, but one is not optimal and the other ones is run at the Computer level:

1. [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\DOS Devices]
"Z:"="\\??\\N:\\DIRECTORY"

2. [HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
"Z Drive"="SUBST Z: N:\\DIRECTORY"

I am currently using solution 1., the two slow to execute, but I would really like the script to work as it simple and effective.
0
 
LVL 25

Assisted Solution

by:Lionel MM
Lionel MM earned 500 total points
ID: 41795813
the script does seem to run, but the user can not access the drive
would it be feasible to put a shortcut on their desktops and have them run the script before using the program? Then check out this options provided in this link, trying the script as a startup instead of as a logon script and if that doesn't work a suggestion to use an utility program.
0
 
LVL 24

Expert Comment

by:Brian B
ID: 41795984
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.
0
 

Author Comment

by:mrmut
ID: 41797419
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).
0
 

Author Closing Comment

by:mrmut
ID: 41808398
This solved the problem, making server functional.
0

Featured Post

SuperAntiSpyware Licenses Discounted by 25% !

Exclusive offer to Experts Exchange Members!
Buy SuperAntiSpyware License(s) from us and save 25% on the regular purchase price.
- Includes Full SuperAntiSpyware Vendor Support Entitlements
- Your Subscription does not begin until you activate your license
- Buy for your friends

Question has a verified solution.

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

Active Directory security has been a hot topic of late, and for good reason. With 90% of the world’s organization using this system to manage access to all parts of their IT infrastructure, knowing how to protect against threats and keep vulnerabil…
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
This Micro Tutorial will teach you the basics of configuring your computer to improve its speed. It will also teach you how to disable programs that are running in the background simultaneously. This will be demonstrated using Windows 7 operating…
This Micro Tutorial will go in depth within Systems and Security in Windows 7 and will go into detail regarding Action Center, Windows Firewall, System, etc. This will be demonstrated using Windows 7 operating system.

752 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