我从前 50 台计算机收集日志来分析一个名为 Dragon 的应用程序的用户信息,该应用程序用于听写文本。我用来收集这些日志的脚本我认为可能会好得多。有人愿意分享改进建议吗?为我指明正确的方向,剩下的事情我来做。请在下面找到粘贴的代码。
#copying ALL directories from c:\User\ recursively, and as many of the log files #as it finds. Copies perhaps 100-1000 empty directories for every log file it finds.
$server_names = Get-Content "C:\powershell\Dragonlog\Log Grab\sept915920.txt"
Foreach ($server in $server_names){
Copy-Item \\$server\c$\Users C:\dgnlogs\top50915920\$Server -filter dragon.log -Recurse
}
#robocopy to remove redundant empty directories.
robocopy C:\dgnlogs\top50915920 C:\splunkdragonlogs\top50915920 /s /move