public static void GetSDOPostAction(DataRow input, DataTable dataTable, DataObjectStore store)
        {
            DataRow dataRow = dataTable.Rows[0];

            dataRow["DisplayedManagedBy"]   = DistributionGroupHelper.ResolveRecipientDisplayNamesForSDO(dataRow["ManagedBy"]);
            dataRow["DisplayedModeratedBy"] = DistributionGroupHelper.ResolveRecipientDisplayNamesForSDO(dataRow["ModeratedBy"]);
        }
 public static void GetFFOGroupList(DataRow inputRow, DataTable table, DataObjectStore store)
 {
     try
     {
         table.BeginLoadData();
         GetRecipientCmdlet getRecipientCmdlet = new GetRecipientCmdlet
         {
             Filter     = inputRow["SearchText"].ToString().ToRecipeintFilterString("((RecipientTypeDetails -eq 'MailUniversalDistributionGroup') -or (RecipientTypeDetails -eq 'MailUniversalSecurityGroup'))"),
             Properties = "Identity,DisplayName,PrimarySmtpAddress,RecipientTypeDetails"
         };
         getRecipientCmdlet.Authenticator  = PswsAuthenticator.Create();
         getRecipientCmdlet.HostServerName = AppConfigLoader.GetConfigStringValue("PswsHostName", null);
         foreach (Recipient recipient in getRecipientCmdlet.Run())
         {
             DataRow dataRow = table.NewRow();
             dataRow["Identity"]             = new Identity(recipient.Guid.ToString());
             dataRow["DisplayName"]          = recipient.DisplayName;
             dataRow["PrimarySmtpAddress"]   = recipient.PrimarySmtpAddress;
             dataRow["RecipientTypeDetails"] = DistributionGroupHelper.GenerateGroupTypeText(Enum.Parse(typeof(RecipientTypeDetails), recipient.RecipientTypeDetails, true));
             dataRow["GroupType"]            = recipient.RecipientTypeDetails;
             table.Rows.Add(dataRow);
         }
     }
     finally
     {
         table.EndLoadData();
     }
 }
        public static void GetFFOSDOItem(DataRow inputRow, DataTable table, DataObjectStore store)
        {
            GetDistributionGroupCmdlet getDistributionGroupCmdlet = new GetDistributionGroupCmdlet
            {
                Identity = ((Identity)inputRow["Identity"]).RawIdentity
            };

            getDistributionGroupCmdlet.Authenticator  = PswsAuthenticator.Create();
            getDistributionGroupCmdlet.HostServerName = AppConfigLoader.GetConfigStringValue("PswsHostName", null);
            DistributionGroup[] array = getDistributionGroupCmdlet.Run();
            if (array == null || array.Length == 0)
            {
                throw new ExArgumentOutOfRangeException();
            }
            DistributionGroup distributionGroup = array.First <DistributionGroup>();
            DataRow           dataRow           = table.Rows[0];

            dataRow["Identity"]             = new Identity(distributionGroup.Guid.ToString());
            dataRow["DisplayName"]          = distributionGroup.DisplayName;
            dataRow["PrimarySmtpAddress"]   = distributionGroup.PrimarySmtpAddress;
            dataRow["RecipientTypeDetails"] = DistributionGroupHelper.GenerateGroupTypeText(Enum.Parse(typeof(RecipientTypeDetails), distributionGroup.RecipientTypeDetails, true));
            dataRow["GroupType"]            = DistributionGroupHelper.GenerateGroupTypeText(Enum.Parse(typeof(RecipientTypeDetails), distributionGroup.RecipientTypeDetails, true));
            dataRow["Notes"] = distributionGroup.Notes;
            if (distributionGroup.ManagedBy == null || distributionGroup.ManagedBy.Length == 0)
            {
                dataRow["DisplayedManagedBy"] = null;
            }
            else
            {
                string[] value = (from o in distributionGroup.ManagedBy
                                  select o.Name).ToArray <string>();
                dataRow["DisplayedManagedBy"] = value;
            }
            GetGroupCmdlet getGroupCmdlet = new GetGroupCmdlet
            {
                Identity = ((Identity)inputRow["Identity"]).RawIdentity
            };

            getGroupCmdlet.Authenticator  = PswsAuthenticator.Create();
            getGroupCmdlet.HostServerName = AppConfigLoader.GetConfigStringValue("PswsHostName", null);
            Group[] array2 = getGroupCmdlet.Run();
            if (array2 == null || array2.Length == 0)
            {
                throw new ExArgumentOutOfRangeException();
            }
            Group group = array2.First <Group>();

            if (group.Members == null || group.Members.Length == 0)
            {
                dataRow["MemberCount"] = 0;
            }
            else
            {
                dataRow["MemberCount"] = group.Members.Length;
            }
            dataRow["Notes"] = group.Notes;
        }