/// <summary>
 /// VerifyADFSAdministrationRights method implementation
 /// </summary>
 internal static void VerifyADFSAdministrationRights(PSHost host = null)
 {
     try
     {
         ClientSIDsProxy.Initialize();
         if (!((ClientSIDsProxy.ADFSLocalAdminServiceAdministrationAllowed && ADFSManagementRights.IsAdministrator()) ||
               (ClientSIDsProxy.ADFSSystemServiceAdministrationAllowed && ADFSManagementRights.IsSystem()) ||
               (ClientSIDsProxy.ADFSDelegateServiceAdministrationAllowed && ADFSManagementRights.AllowedGroup(ClientSIDsProxy.ADFSAdminGroupName))
               ))
         {
             throw new SecurityException("Access Denied !");
         }
     }
     catch (Exception)
     {
         if (host == null)
         {
             throw new InvalidOperationException("Must be executed with ADFS Administration rights granted for the current user !");
         }
         else
         {
             throw new InvalidOperationException("PS0033: This Cmdlet must be executed with ADFS Administration rights granted for the current user !");
         }
     }
 }
 /// <summary>
 /// VerifyADFSAdministrationRights method implementation
 /// </summary>
 internal static void VerifyADFSAdministrationRights()
 {
     ClientSIDsProxy.Initialize();
     if (!((ClientSIDsProxy.ADFSLocalAdminServiceAdministrationAllowed && ADFSManagementRights.IsAdministrator()) ||
           (ClientSIDsProxy.ADFSSystemServiceAdministrationAllowed && ADFSManagementRights.IsSystem()) ||
           (ClientSIDsProxy.ADFSDelegateServiceAdministrationAllowed && ADFSManagementRights.AllowedGroup(ClientSIDsProxy.ADFSAdminGroupName))))
     {
         throw new InvalidOperationException("PS0033: This Cmdlet must be executed with ADFS Administration rights granted for the current user !");
     }
 }
 /// <summary>
 /// VerifyMFAConfigurationRights method implementation
 /// </summary>
 internal static void VerifyMFAConfigurationRights(PSHost host = null)
 {
     if (!(ADFSManagementRights.IsAdministrator()) || ADFSManagementRights.IsSystem())
     {
         if (host == null)
         {
             throw new InvalidOperationException("Must be executed with System Administration rights granted for the current user !");
         }
         else
         {
             throw new InvalidOperationException("PS0033: This Cmdlet must be executed with System Administration rights granted for the current user !");
         }
     }
 }