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