I know that C:\Windows\System32\WDI exists and has contents. We need to copy these contents from hundreds of machines for security analysis. We tried:
Copy-Item 'C:\Windows\System32\WDI' -Destination .\my_output_dir\wdi -recurse
This works on my personal computer (I think I have myself permissions for system32 though the gui), but not for my colleague on other machines.
On other machines, we get an error:
Copy-Item : Cannot find path 'C:\Windows\System32\WDI' because it does not exist.
At line:1 char:1
+ Copy-Item 'C:\Windows\System32\WDI' -Destination .\my_output_dir\wdi ...
+ ~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (C:\Windows\System32\WDI:String) [Copy-Item], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.CopyItemCommand
It's not feasible to go into the GUI on every machine to give myself the necessary permissions. How can this be achieved purely through powershell? We have administrative credentials.