Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Retrieve minidump from remote Computers

$
0
0

I try to retrieve the logs from remote computers and copy them to my local drive, when i try to do this with one computer it works but not for a group of Workstations. something is wrong with my for loop , i don't know yet if i can add a test ping before trying to do the copy 

the code is below :

 

$computerName = Get-Content "d:\Workstations_list.txt"

$destination = New-Item -ItemType Directory -Path C:\Temp\$computerName -Force

$source = "C$\Windows\minidump"

 

foreach ($computer in $computername)

{

    $remoteFile = "\\$computerName\$source"

    Write-Verbose "Copy $remoteFile to $destination"

    Copy-Item $remoteFile -Destination $destination

}


Viewing all articles
Browse latest Browse all 6937

Trending Articles