kimo pryvt
kimo pryvt

Reputation: 503

Powershell remoting out-file to share credentials

I am trying to create a script that recolects information using remote powershel and saves the info to a share. I am having trouble to write the output to the file share because y am getting access denied error even though that I have granted full control to everyone and anonymous logon over de share.

enter image description here

  Invoke-Command -ComputerName coboap31 -ScriptBlock {hostname| Out-File -FilePath  $("\\coboap31\Info\" + $env:COMPUTERNAME +".log") -Append}

Any ideas about how I must authenticate to the share?

Upvotes: 1

Views: 283

Answers (1)

restless1987
restless1987

Reputation: 1598

From my understanding, you get a error of not authenticating against the network target.

This is by design.

You can go several ways to fix this issue. See this link for examples, to see what matches best for your requirements.

Upvotes: 1

Related Questions