Scheduled PowerShell Task Not Renaming File
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2025 10:33 PM
Hi everyone,
I have a PowerShell script scheduled to run via **Task Scheduler**. Its job is simple:
It renames (or copies) the latest file from the following folder using a standard name:
```
C:\Program Files\ServiceNow Midserver Common\Oracle\All Oracle databases end of support\
```
The script runs perfectly when I execute it manually, but when triggered by Task Scheduler:
It fails with this message:
**“Administrator has refused the request ”**
“Launch request ignored, instance already running”
What the script does:
* Gets the latest modified file in the folder
* Copies/renames it with a fixed name (`All Oracle databases end of support - SN.xls`)
Task Scheduler Configuration:
Trigger: Daily at a fixed time
“Run with highest privileges”: Not enabled
“Run whether user is logged on or not”: Enabled
Other PowerShell-based tasks are working fine
I suspect the issue is related to permissions or folder location
I’d prefer not to enable “Run with highest privileges” unless necessary
Any insights or best practices would be appreciated. Thanks!