Error: Move-Item: Access is denied (UnauthorizedAccess Exception)

Aus Wiki-WebPerfect
Version vom 20. Oktober 2017, 13:52 Uhr von Admin (Diskussion | Beiträge)

(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Wechseln zu: Navigation, Suche

Fehlermeldung

Move-Item:_Access_is_denied_(PermissionDenied:_[Move-Item]_UnauthorizedAccess_Exception)

Ursache

Providing the fully qualified name is required for any remote call. In other words, if your location starts with \\ then you need to add Microsoft.PowerShell.Core\FileSystem:: as a prefix. If you reference a local drive, you shouldn’t prefix the local drive. This worked perfectly, even remoting to both computers.


Lösung

  • Add fully qualified for a share (Microsoft.PowerShell.Core\FileSystem::)

Example

 Move-Item -Path "Microsoft.PowerShell.Core\FileSystem::\\<Hostname>\C$\temp\testfile.txt" -Destination "Microsoft.PowerShell.Core\FileSystem::\\<Destination-Hostname>\C$\temp\testfile.txt"