Skip to content

Instantly share code, notes, and snippets.

@rileyz
Created October 2, 2018 14:08
Show Gist options
  • Save rileyz/22e964757032ecbd6b8dc9161ef8d8ba to your computer and use it in GitHub Desktop.
Save rileyz/22e964757032ecbd6b8dc9161ef8d8ba to your computer and use it in GitHub Desktop.
$verbosePreference = 'Continue'
$Computers = Import-Csv C:\LocalWhereEver\List_0x87d01290.txt
$GatherLogsHere = "C:\LocalWhereEver\0x87d01290_RemoteLogs"
Foreach ($Computer in $Computers)
{Write-Verbose "Working on $($Computer.Computers)"
If (((Test-NetConnection -ComputerName $Computer.Computers -Port 3389).TcpTestSucceeded))
{Write-Verbose ' Computer is awake.'
If (Test-Path \\$($Computer.Computers)\C$\Windows\Temp\Fix-ConfigMgrClientError0x87d01290.log)
{Copy-Item -Path "\\$($Computer.Computers)\C$\Windows\Temp\Fix-ConfigMgrClientError0x87d01290.log" -Destination "$GatherLogsHere\$($Computer.Computers)_Fix-ConfigMgrClientError0x87d01290.log"}}
Else{Write-Verbose ' Unable to contact computer.'}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment