Ejemplo n.º 1
0
 private void ProcessAccount()
 {
     foreach (IdentityReference acct in Account)
     {
         WriteVerbose($"Getting current rights for '{acct.Value}'");
         string[] rights = Lsa.EnumerateAccountRights(_lsa, acct).ToArray();
         if (rights.Length > 0)
         {
             WriteVerbose($"Removing all rights for account '{acct.Value}'");
             if (ShouldProcess(acct.Value, "Remove all rights"))
             {
                 Lsa.RemoveAllAccountRights(_lsa, acct);
             }
         }
         else
         {
             WriteVerbose($"Account '{acct.Value} does not have any rights, no action required");
         }
     }
 }