To find Farm ID the following SharePoint Management shell (or PowerShell) command could be used:
Farm ID could be also found in Configuration database by running the following SQL query:
SELECT * From Objects where ClassId = ’674DA553-EA77-44A3-B9F8-3F70D786DE6A’
The '674DA553-EA77-44A3-B9F8-3F70D786DE6A' GUID is always a ClassID for Farm object.
More information here