I have a problem with Task Scheduler it will not do what I want it to do! Here’s the story. I’m using Powershell ISE to export a list of all Services on a pc using the following script and it works just fine.
$DateToday = get-date -format "yyyy_MM_dd HH_mm_ss"
Get-Service | Export-Csv -path "C:\ServicesList\Services $($dateToday).csv" -NoTypeInformation
I then move the .csv file into an Access table (365) with date and time in the table name using the following script and it works fine.
$Access = New-Object -ComObject Access.Application
I then create a Task Scheduler task to automate creating a csv file and the move it into an Access table. And run it at start up. This does not work even if I run it manually. I do not get any error feedback from Task Scheduler. I then checked thro each and every tab in Task Scheduler running it after each change. No luck! I then changed the Execution Policy settings from Undefined to RemoteSigned to Bypass for LocalMachine, CurrentUser and Process. I used the following script with variations to accommodate the different Scopes.
set-executionpolicy -scope LocalMachine -executionPolicy RemoteSigned -force
I have also changed the Registry setting at
SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell for both 32bit and 64bit.
I’m getting to a point where the problem is probably obvious, but I can’t see it.
Assistance greatly needed