• bwperrin (8/20/2012)


    Yes, I did the following from a SQL Agent PowerShell job step:

    $src = "\\serverpath\filename"

    $dst = "e:\path\filename"

    Copy-item $src -destination $dst

    and still get the SQL Agent error:

    The error information returned by PowerShell is: 'Invalid Path: '\\serverpath\filename'. '. Process Exit Code -1. The step failed.

    The following from PowerShell on the server box succeeds:

    Copy-item "\\serverpath\filename" -destination "e:\path\filename"

    Must be some permission issue, but I'm not smart enough to figure it out. Thx

    When running it via SQL Agent it will be running as the SQL Agent service account, i.e. whatever account the service is running as. If your SQL Agent is running as a built-in account such as NetworkService, LocalSystem or LocalService you may have trouble since those accounts likely do not have rights to access the network share you're looking to access, whereas when you rin the same PowerShell locally under your own security context you will have access.

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato