Get Current Licence type for SharePoint Farm using C#?
-
03-10-2020 - |
Pergunta
As the question says, I want to fetch the license type for my current SharePoint farm in my C# code
i.e. current license
SharePoint Server with Enterprise Client Access License
I want to get the same value by c# code.
Solução
You can loop Farm products:
using Microsoft.SharePoint.Administration;
// .... class...
SPFarm farm = SPFarm.Local;
foreach (Guid prd in farm.Products)
{
if (prd == new Guid("B7D84C2B-0754-49E4-B7BE-7EE321DCE0A9"))
{
Console.WriteLine("SharePoint Server 2013 Enterprise");
}
}
Licenciado em: CC-BY-SA com atribuição
Não afiliado a sharepoint.stackexchange