protected PowerShellResults <T> GetDistributionGroup <T>(Identity identity) where T : DistributionGroup { PowerShellResults <T> @object = base.GetObject <T>("Get-DistributionGroup", identity); if (@object.SucceededWithValue) { PowerShellResults <WindowsGroup> powerShellResults = @object.MergeErrors <WindowsGroup>(base.GetObject <WindowsGroup>("Get-Group", identity)); if (powerShellResults.SucceededWithValue) { T value = @object.Value; value.WindowsGroup = powerShellResults.Value; } if (RbacPrincipal.Current.IsInRole("Enterprise+Get-ADPermission?Identity")) { PowerShellResults <ADAcePresentationObject> powerShellResults2 = @object.MergeErrors <ADAcePresentationObject>(base.GetObject <ADAcePresentationObject>(new PSCommand().AddCommand("Get-ADPermission").AddParameter("Identity", identity))); if (powerShellResults2.Output.Length > 0) { T value2 = @object.Value; value2.SendAsPermissionsEnterprise = MailboxPropertiesHelper.FindRecipientsWithSendAsPermissionEnt(powerShellResults2.Output, null); } } else if (RbacPrincipal.Current.IsInRole("MultiTenant+Get-RecipientPermission?Identity")) { PowerShellResults <RecipientPermission> powerShellResults3 = @object.MergeErrors <RecipientPermission>(base.GetObject <RecipientPermission>(new PSCommand().AddCommand("Get-RecipientPermission").AddParameter("Identity", identity))); if (powerShellResults3.Output.Length > 0) { T value3 = @object.Value; value3.SendAsPermissionsCloud = MailboxPropertiesHelper.FindRecipientsWithSendAsPermissionCloud(powerShellResults3.Output); } } } return(@object); }
public static void FilterCloudSendAsPermission(DataRow inputRow, DataTable dataTable, DataObjectStore store) { dataTable.Rows[0]["SendAsPermissions"] = MailboxPropertiesHelper.FindRecipientsWithSendAsPermissionCloud(store.GetDataObject("RecipientPermission") as IEnumerable <object>); }