Results 1 to 1 of 1
2016-03-17, 22:13 #1
- Join Date
- Aug 2015
- Thanked 0 Times in 0 Posts
Windows 2012 - Need to restore "C:\Windows\System32\Tasks\Microsoft" (entire folder)
Hi All, Okay. I really did it this time!
At work, I have a Windows 2012 virtual server on which a lot of scheduled tasks are ran overnight to complete jobs and prepare data for the coming morning. Most of the tasks that I have set up Run As me with my password. Last Friday I was prompted to change my password. A few years ago, while the server O/S was Windows 2003, I had written some code to use Schtasks.exe to /Change the /RU and /RP (Run as User ID and Password) for a filtered set of the current scheduled tasks. It worked perfectly and saved sooo much time. So on Friday, after changing my password, I ran my little utility so that it would update all of my tasks.
Here's the problem. I didn't realize that the TaskName(s) are now stored with a path in the name (ex. instead of just "Configuration Manager Health Evaluation", the task name is now "\Microsoft\Configuration Manager\Configuration Manager Health Evaluation") and because of this, I should have changed my query to filter for current TaskName(s) starting with "\Prod_Jobs\" (the subfolder in the Task Scheduler where my tasks are located). I didn't do this and the result was that ALL of the tasks were update to Run As me!
This is where I need your help. I'm hoping someone out there is an expert with Windows 2012 and can help me restore the previous version of the "\Microsoft" folder.
Here are the different solutions I have tried so far:
- I tried manually updating the Run As user back to SYSTEM or LOCAL SERVICE, etc for each incorrect task via the Task Scheduler interface but it seems to have changed more in the background XML files than just the Run As user because now I get errors saying that "the Task XML has an unexpected node", "the Task XML has an incorrect value", etc.
- I tried copying a previous version of the C:\Windows\System32\Tasks\Microsoft folder and pasting it, overwriting the mistakenly updated folder. Other than a couple of permission denied messages for individual tasks, it looks like it worked but if I close and reopen the Task Scheduler it's like the files are all replaced again by the wrong ones (like my copy/paste is being undone).
- I tried opening each individual XML file in that path and copy/pasting the XML from a correct previous version of each file, saving and exiting, but again it seems to be undone as soon as Task Scheduler is closed/reopened. (I need to close and reopen to see if the errors that popped up before (about the "XML containing an unexpected node", etc) are gone. Plus it would be closed/reopened every time there is a reboot or update so it needs to work.
- I googled my issue and found someone who said that I could import each individual correct Task XML via the interface but the new task has to have a different name (ex. "ProactiveScan" is wrong and the new one I import must be named something other than that "ProactiveScan2" or something similar.) Once that is done I can then delete the incorrect task and leave the #2 version. What worries me here is if there is any background process looking for the original task names. Plus there are still a few errors.
There has to be a way to restore the original "C:\Windows\System32\Tasks\Microsoft\" folder, don't you think? And why change to storing Tasks in XML files if you won't let us update those XML files or restore the folder containing those files? It's bizarre.
I've read some posts online about making some changes in the registry for this issue too but unless I know for sure what I am doing, I am not going to try that. I don't want to make things worse.
I need an expert. Is there anyone who can help me? Thanks in advance!