예제 #1
0
        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}");
            }
        }
예제 #2
0
        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}");
            }
        }