Creating base lines
Aug 15, 2023
Base line for newly imaged machine:-
Get-Service * | Where {$_.status -eq “Running”} | Export-Clixml fileName.xml
Comparing the baseline to the current state:-
Compare-Object (Import-Clixml fileName.xml)(Get-Service * | Where {$_.status -eq “Running”}) -Property DisplayName | Where-Object{$_.sideindicator -eq “<=”}
Another way to create base line for newly imaged machine:-
Get-Process | Export-Clixml fileName.xml
Comparing the baseline to the current state:-
Compare-Object (Import-Clixml fileName.xml)(Get-Process) -Property Name | Where-Object{$_.sideindicator -eq “<=”}
Creating baseline commands:-
- Get-WmiObject Win32_UserAccount | Export-Clixml fileName.xml
- Get-WmiObject Win32_OperatingSystem | Export-Clixml fileName.xml
- Get-WmiObject Win32_SystemUsers | Export-Clixml fileName.xml