Powershell – Adminstrator receives PermissionDenied when issuing get-childitem in PowerShell

directorypermissionspowershell

I am trying to backup a drive from a laptop that is defunct. This drive was pulled from the machine and mounted in an external enclosure and connected to a desktop via USB.

Laptop that the drive was pulled from is Windows 7 Pro, and the desktop I connected the laptop drive to is Windows 7 Ultimate.

I am running PowerShell on the desktop to copy everything from the laptop drive, prior to reformatting the laptop drive for re-use. The laptop drive appears as e:\ on the desktop.

When I issue "get-childitem 'e:\Documents and Settings' -force -recurse", I get a PermissionDenied exception on that directory.

Anybody know how I can force a listing of the contents of that directory? I am the administrator after all…

Thanks!

Best Answer

Try

Get-ChildItem 'e:\Documents and Settings' -Force -Recurse -ErrorAction SilentlyContinue

and report what you find.