Powershell remote file-out
Posted on 2013-12-05
I have a domain runing Server 2008 R2 and windows 7. I am starting to use powershell more and more. I have configued WinRM and used group policy to Allow Automatic configuration of listeners. I can now start a remote session and execute powershell commands on remote machines from Powershell ISE or Powershell on my machine (logged in as domain admin).
After a few test commands I ran the following:
Get-ChildItem -Path C:\nso | Out-File -FilePath \\mymachine\c$\nso\test.txt
However I ran into the following error:
Access to the path '\\mymachine\c$\nso\test.txt' is denied.
+ CategoryInfo : OpenError: (:) [Out-File], UnauthorizedAccessException
+ FullyQualifiedErrorId : FileOpenFailure,Microsoft.PowerShell.Commands.OutFileCommand
I can't understand why such a simple command fails I am a domain admin, I started the session using domain admin credentials and I can happly read/write to both locations if I browse to them.......what am I missing? thanks in advance