public static void ClearPasswordQueue() { ManagementObject mo = SyncServer.GetServerManagementObject(); string result = mo.InvokeMethod("ClearPasswordQueue", new object[] { }) as string; if (result == "access-denied") { throw new UnauthorizedAccessException(); } else if (result != "success") { throw new MiiserverException($"The operation returned {result}"); } }
public static void ClearPasswordHistory(DateTime clearBeforeDate) { string date = clearBeforeDate.ToMmsDateString(); ManagementObject mo = SyncServer.GetServerManagementObject(); string result = mo.InvokeMethod("ClearPasswordHistory", new object[] { date }) as string; if (result == "access-denied") { throw new UnauthorizedAccessException(); } else if (result != "success") { throw new MiiserverException($"The operation returned {result}"); } }