How to Get SharePoint Farm ID using PowerShell?

Requirement: Get SharePoint Farm ID to apply a third-party product license to our SharePoint 2016 environment.

How to Get SharePoint Farm ID?

SharePoint farm ID is a GUID that uniquely identifies each farm. To get the Farm ID in SharePoint, use this handy PowerShell code.

(Get-SPFarm).Id

Just open SharePoint 2016 Management Shell and paste this cmdlet in it to find the farm id of the SharePoint Farm. This gets you the SharePoint farm id:

How to Get SharePoint Farm ID using PowerShell

You’ll get a GUID similar to the above screenshot. Although you can query the SharePoint Farm config database to get this information, it’s strongly recommended to use PowerShell instead of accessing the SharePoint database.

To get the GUID of SharePoint Web Application, Site Collection, Site, List or Library,  Fields, View – Refer: How to Find the GUIDs of SharePoint Web Application, Site Collection, Site, List, View, and Columns?

Salaudeen Rajack

Salaudeen Rajack - Information Technology Expert with Two-decades of hands-on experience, specializing in SharePoint, PowerShell, Microsoft 365, and related products. He has held various positions including SharePoint Architect, Administrator, Developer and consultant, has helped many organizations to implement and optimize SharePoint solutions. Known for his deep technical expertise, He's passionate about sharing the knowledge and insights to help others, through the real-world articles!

2 thoughts on “How to Get SharePoint Farm ID using PowerShell?

  • My SharePoint Farm is down! Can I get it from anywhere else?

    Reply
    • Use this Query on SharePoint Farm config Database: SELECT * From Objects where ClassId = ‘674DA553-EA77-44A3-B9F8-3F70D786DE6A’

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *