Error: Move-Item: Access is denied (UnauthorizedAccess Exception): Unterschied zwischen den Versionen

Aus Wiki-WebPerfect
Wechseln zu: Navigation, Suche
(Die Seite wurde neu angelegt: „== Fehlermeldung == '''Move-Item:_Access_is_denied_(PermissionDenied:_[Move-Item]_UnauthorizedAccess_Exception)''' == Ursache == Providing the fully qualified…“)
 
K
 
Zeile 1: Zeile 1:
== Fehlermeldung ==
+
== Error ==
 
'''Move-Item:_Access_is_denied_(PermissionDenied:_[Move-Item]_UnauthorizedAccess_Exception)'''
 
'''Move-Item:_Access_is_denied_(PermissionDenied:_[Move-Item]_UnauthorizedAccess_Exception)'''
  
== Ursache ==
+
== Cause ==
 
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.
 
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 ==
+
== Solution ==
 
*Add fully qualified for a share ('''Microsoft.PowerShell.Core\FileSystem::''')
 
*Add fully qualified for a share ('''Microsoft.PowerShell.Core\FileSystem::''')
  
 
=== Example ===
 
=== Example ===
 
<source lang="powershell"> Move-Item -Path "Microsoft.PowerShell.Core\FileSystem::\\<Hostname>\C$\temp\testfile.txt" -Destination "Microsoft.PowerShell.Core\FileSystem::\\<Destination-Hostname>\C$\temp\testfile.txt" </source>
 
<source lang="powershell"> Move-Item -Path "Microsoft.PowerShell.Core\FileSystem::\\<Hostname>\C$\temp\testfile.txt" -Destination "Microsoft.PowerShell.Core\FileSystem::\\<Destination-Hostname>\C$\temp\testfile.txt" </source>
 +
 +
 +
 +
 +
 +
 +
[[Kategorie:PowerShell]]

Aktuelle Version vom 20. Oktober 2017, 13:54 Uhr

Error

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

Cause

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.


Solution

  • 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"