Friday, May 18, 2012 9:23 PM
How can I scan mapped drives using Forefront Endpoint Protection from command using task scheduler?
If I use in task scheduler "C:\Program Files\Microsoft Security Client\Antimalware\mpcmdrun" -Scan -scantype 3 -File C:\Temp the scan works but if I use
"C:\Program Files\Microsoft Security Client\Antimalware\mpcmdrun" -Scan -scantype 3 -File G:\Temp (G is a mapped drive) in task scheduler I get
Warning: MpScan() encounter errror. hr = 0x80508023
ERROR: MpScan(dwOptions=16385) Completion Failed 80508023
If I run "C:\Program Files\Microsoft Security Client\Antimalware\mpcmdrun" -Scan -scantype 3 -File G:\Temp (G is a mapped drive) from a command window is runs fine.
I need to do this from task scheduler so I can setup tasks to scan my NAS.
Friday, May 18, 2012 9:29 PM
When you run the scan using Task Scheduler it runs using the System Account and the drive is not mapped, that could be the problem.
I would create a script Powershell/.cmd file and run it using a service acocunt with the necessery permissions and have the script map the drive, then initiate a scan.
that should work.
- Marked As Answer by freebird_ Tuesday, May 22, 2012 7:54 PM
Friday, May 18, 2012 10:00 PMOk, I have got a Powershell script working and running in task scheduler but I am getting the same error. Can you please explain how to run it using a service account and map a drive, then start scan?
Tuesday, May 22, 2012 5:56 AMModerator
Thank you for the post.
Please verify if map network drive with enable "Reconnect at login" and "different user name" options, set different user for task scheduler by clicking the Change User or Group button.
If there are more inquiries on this issue, please feel free to let us know.
TechNet Community Support