NobleMan
NobleMan

Reputation: 515

putting the results file on a remote server not working

Editor's note: The OP believes to have encountered a case where Out-File -Append, against expected behavior, does not create the target file on demand.
If this is indeed the case, it would be a bug.
There is no known reproducible case at this point.

The script runs fine but the file never shows up. I have a share with the proper rights but nothing is showing up. Please advise.

$machinename = Get-WmiObject -Class Win32_ComputerSystem
$MachineFinalName = $machinename.Caption
$wsus = Get-Service -name wuauserv
    if ($wsus.Status -eq 'Stopped')
    {
         $MachineFinalName | Out-File -FilePath \\192.168.1.200\Service_Results\serviceoff.txt -Append

    }

Upvotes: 0

Views: 45

Answers (1)

NobleMan
NobleMan

Reputation: 515

I figured it out. I had to create the file in the server share and it works perfectly.

Upvotes: 1

Related Questions