I have another question please.
Got the non credential thing to work - so thanks
I have tried adding some extra event codes to the application log read section
specifically 18270 - to show sql differential backup changes and 18264 to show sql full backups.
After adding though - these are still not being added to the generated csv file
Im thought as you specify AND (type!='Information') and both the new event id's show as information they would ?
Is there something im doing wrong?
# Get the Application Log and export to CSV
Get-WmiObject -ComputerName $computer `
-Query "SELECT ComputerName,Logfile,Type,TimeWritten,SourceName,Message,Category,EventCode,User `
FROM Win32_NTLogEvent WHERE (logfile='Application') AND (type!='Information') AND (EventCode!='1062') `
AND (EventCode!='9001') AND (EventCode!='1517') AND (EventCode!='18270') AND (EventCode!='18264') AND (EventCode!='16434') AND (EventCode!='16435') `
AND (EventCode!='30969') AND (EventCode!='1202') AND (EventCode!='1517') AND (EventCode!='257') `
AND (TimeWritten > '$BeginDate')" | `
SELECT ComputerName,Logfile,Type,@{name='TimeWritten';Expression={$_.ConvertToDateTime($_.TimeWritten)}},SourceName,Message,Category,EventCode,User | `
Export-Csv "$store\$computer-Application.csv"