Remote network location using invoke command on remote computer does not work

Running the following powershell command

invoke-computer -computer computer -scriptblock{remove-item -force \\otherpc\backup_dump\TEST\*}

I get an error

The object at the specified path \ otherpc \ backup_dump \ TEST \ does not exist.

But when I run it locally, it works, I suspect there is something to do with the area, but I'm not sure about that, any help would be great.

+3
source share
4 answers

This is a classic CredSSP issue. Check this out: Mutli-Hop authentication using CredSSP

+3
source

Is it possible to use the local path (C: \ n \ npp \ backup_dump \ TEST *) instead of the UNC path?

0
source

, , , () \otherpc... ? :

... remove-item -force "\\otherpc\backup_dump..."

0
source

Prepare the file system :: for the UNC path.

invoke-computer -computer computer -scriptblock{remove-item -force filesystem::\\otherpc\backup_dump\TEST\*}

See http://www.powershellmagazine.com/2012/11/05/pstip-using-unc-paths-when-working-with-powershell-providers/

0
source

Source: https://habr.com/ru/post/1760430/


All Articles