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.

Foi útil?

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");
    }
}

SP version Guid

Licenciado em: CC-BY-SA com atribuição
Não afiliado a sharepoint.stackexchange
scroll top