I have powershell script that is copying files from local drive to network mapped drive. Everything works fine when i run this script via powershell but when i run this script with task scheduler it doesnt work. I have created also simple script with one line to create file
New-Item -Path "Z:\DBBackups\" -Name testfile -Value "test123" -ItemType file -force
This script works via powershell with path to mapped network drive, and works with task scheduler when path is in local drive but doesnt work when path is network drive.
Task scheduler settings: Action: Start a program
Program/script: powershell.exe
Add arguments: -ExecutionPolicy Bypass -File "E:\t.ps1"
Account to run task i set to Administrator which have rights to network disk also is set to run script when user is not logged on, dont store password and with highest privilleges
What can i do to use task scheduler with script that is using network drive?
Z:
use the file share \\servername\sharename\