Script to get all the security patch /CU/hot fixes that have been installed to the servers.
You can check the patch levels through central administration:
Central Administration --> Upgrade and Migration --> Check product and patch installation
You will get patch levels for all servers in your farm.
You can use PowerShell script to get the details.
For SharePoint 2010:
$SPUpdates =Get-WmiObject -Class Win32_Product | Where {$_.IdentifyingNumber -like "*90140000-*"}
$SPUpdates | Export-csv "C:\SPUpdates.csv"
For SharePoint 2013:
$SPUpdates =Get-WmiObject -Class Win32_Product | Where {$_.IdentifyingNumber -like "*90150000-*"}
$SPUpdates | Export-csv "C:\SPUpdates.csv"
For other versions and details you use can name as the filtering criteria if in case the above didn't give exact result but the above script will give close to what the patches are installed for SharePoint.
Get-WmiObject -Class Win32_Product | Where {$_.Name -like "Microsoft SharePoint*"}