Got a minor issue here that is driving me nuts. I have made a script that crawls a lot of XML config files over a UNC path. It works perfectly when running normally, but setting it up as a Task it fails at accessing the UNC share... Any one got a good hint on what to do next. Below is just a test script i wrote to see it happen.
#Creating variables and filling in default data for file crawl
$StartPath="\\ServerName\Customers\" #location of starting directory
#Done creating variables and arrays
$Script:Customers = (Get-ChildItem $StartPath -Directory)
My script is split up into functions. I'm using the $Customers later in the script, so that is why I load it as $Script:Customers so I can use the result in another function.
I have tried running the task as SYSTEM, admin and admin with highest privileges.