Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
27 lines (16 sloc) 557 Bytes
$outputFile = "usbDeviceSetupManagerLogCollector.xml"
$ErrorActionPreference = "SilentlyContinue"
# Device Setup Manager logs: 100,101,112
$Filter = @{
logname='Microsoft-Windows-DeviceSetupManager/Admin'
id=100,101,112
StartTime = [datetime]::Today.AddDays(-30)
EndTime = [datetime]::Today.AddDays(1)
}
$events = Get-WinEvent -FilterHashtable $Filter
$finalXml = "<Events>"
ForEach ($event in $events){
$finalXml += $event.ToXml()
}
$finalXml += "</Events>"
$finalXml | Out-File $outputFile
You can’t perform that action at this time.