Author Posts

January 31, 2017 at 6:58 pm

Hi guys

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.

Thanks

January 31, 2017 at 7:06 pm

Hi

Running test and task with same account or rights?

Jake

January 31, 2017 at 7:10 pm

Hi Jake

I login to the server with my normal user, but start Powershell ISE as administrator and it works just fine.
I'll try tomorrow to login in with local admin and test, just be make sure.

January 31, 2017 at 7:54 pm

Running as local admin could be the issue – that account won't have rights to a share on another machine

February 1, 2017 at 8:16 am

ah yes that seemed to do the trick. Used my own user in the admin group and can now run it with highest privileges.

thanks 🙂