Monday, July 31, 2023

Using powershell to get the status a a machine using Faronics Deep Freeze




I work with a few organizations that use Steady State software and most of them use Faronics Deep Freeze.  Deep freeze works pretty well for the use case which is securing publicly available computers. So not keeping any passwords, resetting software etc.  However one problem hat has come up with using the software is when doing updates you have "un-freeze" the computer, and even with deepfreeze cloud (at least my experience has been) there is a delay in the system updating if a machine is frozen or thawed.  In some cases taking up to 30 minutes; however that was some time ago and Faronics may have improved that.  However due budget cuts at a few of the organizations I work with they are just using Deep Freeze on Prem with no cloud service.  The only notification you get as to the status of deep freeze is a little bear head on the task bar.


The Bear head with out the X means the system is Frozen (steady stated)  The bear with the X means the system is unfrozen and changes can be made to the system.

There has been more then one occasion that a system has been worked on and left in a un-frozen state after the work has been updated.  So to remedy this problem I created this powershell script 

Freezestatus.ps1

#Get the latest deep freeze log

$event = Get-WinEvent -LogName Application | Where-Object {$_.ProviderName -Match 'Deep Freeze'} | select -first 1

#write the status to an xml file

$event.ToXML() | Out-File -FilePath C:\comptools\status.xml

#wait 3 seconds before you get the item status

Start-Sleep -s 3

#Load the XML file

[XML]$xmlfile = Get-Content C:\comptools\status.xml

#Check the value of the XML file see if it is "Thawed"  If it is send an alert to the IT Department

if ($xmlfile.Event.EventData.Data -eq 'Thawed'){

#Put any alert/code you want to use here in this example I have a window popup; I would recommend sending an email or updating some sort of dashboard with the system status.

Add-Type -AssemblyName PresentationFramework

[System.Windows.MessageBox]::Show('Thawed')

}

How to fix CURL call imporitng an RSS feed on a site blocking CURL calls

There is a 3rd party service provider that my organization uses called bibliocommons.  They have these nice book carousels.  However the car...