Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Running scheduled task on 2008 R2 domain controller

Posted on 2014-12-22
13
Medium Priority
?
794 Views
Last Modified: 2015-01-17
I've got a scheduled task (DHCPLFR.EXE) that is to roll up dhcp server logs each night.  
It runs on a 2008 R2 domain controller and up until last week it ran fine.  It stopped working as soon as we moved the account it uses out of the domain admin group.

Is there a way to keep the .exe job working without giving the service account it uses domain admin rights?

logs show it completed the job but nothing is actually run.  this is the log output

Task Scheduler successfully completed task "\DHCP Log Backup" , instance "{4352d922-50f2-49f5-bddb-488430928e58}" , action "C:\Windows\System32\dhcp\dhcplfr\DHCPLFR.exe" with return code 3762507597.

Thanks
0
Comment
Question by:NIS_RULE
[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
  • 7
  • 6
13 Comments
 
LVL 17

Expert Comment

by:Chris Millard
ID: 40513490
If you want to give the task to a non-domain admin account, make sure that the account you wish to use has read access on the folder containing the logs, and write access on the folder where the logs need to be copied to.

Also make sure that the non-domain admin account has the rights to log on locally and log on as a service.
0
 

Author Comment

by:NIS_RULE
ID: 40513519
The account has full access to the logs folder, however it does not have access to the folder higher up (i.e. c:\windows\system32\dhcp)  for some reason windows won't let me give that account any access to those higher level folders either.
0
 
LVL 17

Expert Comment

by:Chris Millard
ID: 40513569
And can you log on to the server as that user ok? If so, can you  click start->run, and type the full path to the log folder and see if Explore will open up in that folder?
0
Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 

Author Comment

by:NIS_RULE
ID: 40513575
No, the user is a standard domain user, does not have rights to login interactively to that domain controller.
0
 
LVL 17

Expert Comment

by:Chris Millard
ID: 40513605
That is probably the reason why. You need to grant the login interactively right to that user account.
0
 

Author Comment

by:NIS_RULE
ID: 40513612
Our security policy does not allow login interactively for non domain admin accounts on domain controllers.

I have another task scheduled with the same account on the same server except it isn't an .exe (it's a batch file) and it works fine.  

I don't know if there is something special needed for an .exe file to run as scheduled task vs a batch file.
0
 
LVL 17

Expert Comment

by:Chris Millard
ID: 40513635
Ah ok. Can you call the exe from within a batch?
0
 

Author Comment

by:NIS_RULE
ID: 40513645
Tried adding it to a batch file and running the batch file.  get same failure.  :(
0
 
LVL 17

Expert Comment

by:Chris Millard
ID: 40513649
Can you move the exe to a non-system directory and run it from there as the non-domain admin user?
0
 

Author Comment

by:NIS_RULE
ID: 40513653
The exe is only designed to work from that directory.  I would have to track down the developer of the app and have them re-code it if I were to move it  :(
0
 
LVL 17

Expert Comment

by:Chris Millard
ID: 40513881
OK - let's try a different approach. DHCP logs are in the format DhcpSrvLog-day.log

I've written a batch file that will copy yesterdays log to a file called DhcpSrvLog-yyyymmdd.log (yesterdays date). This will mean you not having to use the exe.

Save the code below to a batch file (I use the .cmd extension). You'll need to change 'temp\' (line 19) to a location that you want to save the log files to.

Try it out and let me know how it goes.

@echo off
REM Create VBS script

set vbsfile=DateInfo.vbs

echo	Dim dt, yesterday>%vbsfile%
echo	dt = DateAdd("d", -1, Date)>>%vbsfile%
echo	YesterdayDate = Right(Year(dt),4) ^& Right("0" ^& Month(dt),2) ^& Right("0" ^& Day(dt),2)>>%vbsfile%
echo	Newdate = Date>>%vbsfile%
echo	YesterdayNameShort = WeekdayName(DatePart("W",Newdate)-1, True)>>%vbsfile%
echo	wscript.echo YesterdayNameShort^&" "^&YesterdayDate>>%vbsfile%

REM    Store output of vbs script in variables
for /f "tokens=1-2 delims= " %%A in ( ' cscript //nologo %vbsfile% ' ) do (
   set YesterdayNameShort=%%A
   set YesterdayDate=%%B
)

copy %systemroot%\System32\dhcp\DhcpSrvLog-%YesterdayNameShort%.log temp\DhcpSrv-%YesterdayDate%.log

del DateInfo.vbs

Open in new window

0
 

Accepted Solution

by:
NIS_RULE earned 0 total points
ID: 40544805
Thanks for the input.  I found a solution by running the scheduled tasks as system account rather as a service account we created.
0
 

Author Closing Comment

by:NIS_RULE
ID: 40554966
Found work around
0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

I was prompted to write this article after the recent World-Wide Ransomware outbreak. For years now, System Administrators around the world have used the excuse of "Waiting a Bit" before applying Security Patch Updates. This type of reasoning to me …
Resolving an irritating Remote Desktop connection that stops your saved credentials from being used.
This tutorial will walk an individual through configuring a drive on a Windows Server 2008 to perform shadow copies in order to quickly recover deleted files and folders. Click on Start and then select Computer to view the available drives on the se…
This tutorial will show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…

704 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