Hello. Im running a script to capture all BSOD from a list of devices that is located in a txt file. I can enter one computername and outputs correct data which is folder and any file within if any. If I add two computernames, the script adds a folder with both computer names combine only. (since no computer name exist with two computernames, no data is within)<\/p>\n
$computerName = Get-Content \"c:\\MiniDumpStorage<\/p>\n
\\Device_Worklist.txt\"<\/p>\n
$destination = New-Item -ItemType Directory -Path C:\\<\/p>\n
$computerName -Force<\/p>\n
$source = “C$\\Windows\\minidump*.*”<\/p>\n
foreach ($computer in $computername)<\/p>\n
{<\/p>\n
$remoteFile = “\\$computerName$source”<\/p>\n
Write-Verbose “Copy $remoteFile to $($destination.fullname)”<\/p>\n
Copy-Item $remoteFile -Destination $($destination.fullname)<\/p>","upvoteCount":2,"answerCount":6,"datePublished":"2019-03-26T16:58:07.000Z","author":{"@type":"Person","name":"spiceuser-kmqhq","url":"https://community.spiceworks.com/u/spiceuser-kmqhq"},"suggestedAnswer":[{"@type":"Answer","text":"
Hello. Im running a script to capture all BSOD from a list of devices that is located in a txt file. I can enter one computername and outputs correct data which is folder and any file within if any. If I add two computernames, the script adds a folder with both computer names combine only. (since no computer name exist with two computernames, no data is within)<\/p>\n
$computerName = Get-Content \"c:\\MiniDumpStorage<\/p>\n
\\Device_Worklist.txt\"<\/p>\n
$destination = New-Item -ItemType Directory -Path C:\\<\/p>\n
$computerName -Force<\/p>\n
$source = “C$\\Windows\\minidump*.*”<\/p>\n
foreach ($computer in $computername)<\/p>\n
{<\/p>\n
$remoteFile = “\\$computerName$source”<\/p>\n
Write-Verbose “Copy $remoteFile to $($destination.fullname)”<\/p>\n
Copy-Item $remoteFile -Destination $($destination.fullname)<\/p>","upvoteCount":2,"datePublished":"2019-03-26T16:58:07.000Z","url":"https://community.spiceworks.com/t/powershell-script-for-bsod-collection/704227/1","author":{"@type":"Person","name":"spiceuser-kmqhq","url":"https://community.spiceworks.com/u/spiceuser-kmqhq"}},{"@type":"Answer","text":"
Welcome<\/p>\n
If you post code, please use the ‘Insert Code’ button. Please and thank you!<\/p>\n