craigegross
Member
- Messages
- 9
- Reaction score
- 0
- Points
- 1
I am trying to set up a scheduled task to clear a collection and set that task to run as a scheduled task kicked off by either Windows Task Scheduler or SQL Server Agent.
I have a script that will create the connection to the CM instance and removes the machines from the collection when I run it through an elevated PowerShell script, but when I set it up to run as a scheduled task, the task completes successfully, but the machines do not get removed.
I am running this in the task "PowerShell.exe -NoProfile -ExecutionPolicy Bypass -File "\Share\CM_Scripts_DND\CM_Machine_Dupe_Cleanup.ps1""
The task is set to run as a service account that has permissions to CM.
I am unsure if the issue is permissions or what.
Any ideas would be helpful.
I have a script that will create the connection to the CM instance and removes the machines from the collection when I run it through an elevated PowerShell script, but when I set it up to run as a scheduled task, the task completes successfully, but the machines do not get removed.
I am running this in the task "PowerShell.exe -NoProfile -ExecutionPolicy Bypass -File "\Share\CM_Scripts_DND\CM_Machine_Dupe_Cleanup.ps1""
The task is set to run as a service account that has permissions to CM.
I am unsure if the issue is permissions or what.
Any ideas would be helpful.