Public/MailFlow/Get-TransportRuleReport.ps1
function Get-TransportRuleReport { [CmdletBinding()] param ( ) end { $RuleList = Get-TransportRule foreach ($Rule in $RuleList) { [PSCustomObject]@{ 'Name' = $Rule.Name 'Comments' = $Rule.Comments 'Priority' = $Rule.Priority 'StopRuleProcessing' = $Rule.StopRuleProcessing 'Description' = $Rule.Description 'Guid' = $Rule.Guid 'ApplyOME' = $Rule.ApplyOME 'AttachmentHasExecutableContent' = $Rule.AttachmentHasExecutableContent 'AttachmentIsPasswordProtected' = $Rule.AttachmentIsPasswordProtected 'AttachmentIsUnsupported' = $Rule.AttachmentIsUnsupported 'AttachmentProcessingLimitExceeded' = $Rule.AttachmentProcessingLimitExceeded 'DeleteMessage' = $Rule.DeleteMessage 'Disconnect' = $Rule.Disconnect 'ExceptIfAttachmentHasExecutableContent' = $Rule.ExceptIfAttachmentHasExecutableContent 'ExceptIfAttachmentIsPasswordProtected' = $Rule.ExceptIfAttachmentIsPasswordProtected 'ExceptIfAttachmentIsUnsupported' = $Rule.ExceptIfAttachmentIsUnsupported 'ExceptIfAttachmentProcessingLimitExceeded' = $Rule.ExceptIfAttachmentProcessingLimitExceeded 'ExceptIfHasNoClassification' = $Rule.ExceptIfHasNoClassification 'ExceptIfHasSenderOverride' = $Rule.ExceptIfHasSenderOverride 'HasNoClassification' = $Rule.HasNoClassification 'HasSenderOverride' = $Rule.HasSenderOverride 'IsValid' = $Rule.IsValid 'ManuallyModified' = $Rule.ManuallyModified 'ModerateMessageByManager' = $Rule.ModerateMessageByManager 'Quarantine' = $Rule.Quarantine 'RemoveOME' = $Rule.RemoveOME 'RemoveOMEv2' = $Rule.RemoveOMEv2 'RouteMessageOutboundRequireTls' = $Rule.RouteMessageOutboundRequireTls 'UseLegacyRegex' = $Rule.UseLegacyRegex 'WhenChanged' = $Rule.WhenChanged 'DlpPolicyId' = $Rule.DlpPolicyId 'ImmutableId' = $Rule.ImmutableId 'FromScope' = $Rule.FromScope 'Identity' = $Rule.Identity 'Mode' = $Rule.Mode 'RouteMessageOutboundConnector' = $Rule.RouteMessageOutboundConnector 'RuleErrorAction' = $Rule.RuleErrorAction 'RuleSubType' = $Rule.RuleSubType 'SenderAddressLocation' = $Rule.SenderAddressLocation 'SentToScope' = $Rule.SentToScope 'SetAuditSeverity' = $Rule.SetAuditSeverity 'State' = $Rule.State 'RuleVersion' = $Rule.RuleVersion 'Actions' = @($Rule.Actions) -ne '' -join '|' 'Conditions' = @($Rule.Conditions) -ne '' -join '|' 'ExceptIfRecipientDomainIs' = @($Rule.ExceptIfRecipientDomainIs) -ne '' -join '|' 'Exceptions' = @($Rule.Exceptions) -ne '' -join '|' 'ActivationDate' = @($Rule.ActivationDate) -ne '' -join '|' 'ADComparisonAttribute' = @($Rule.ADComparisonAttribute) -ne '' -join '|' 'ADComparisonOperator' = @($Rule.ADComparisonOperator) -ne '' -join '|' 'AddManagerAsRecipientType' = @($Rule.AddManagerAsRecipientType) -ne '' -join '|' 'AddToRecipients' = @($Rule.AddToRecipients) -ne '' -join '|' 'AnyOfCcHeader' = @($Rule.AnyOfCcHeader) -ne '' -join '|' 'AnyOfCcHeaderMemberOf' = @($Rule.AnyOfCcHeaderMemberOf) -ne '' -join '|' 'AnyOfRecipientAddressContainsWords' = @($Rule.AnyOfRecipientAddressContainsWords) -ne '' -join '|' 'AnyOfRecipientAddressMatchesPatterns' = @($Rule.AnyOfRecipientAddressMatchesPatterns) -ne '' -join '|' 'AnyOfToCcHeader' = @($Rule.AnyOfToCcHeader) -ne '' -join '|' 'AnyOfToCcHeaderMemberOf' = @($Rule.AnyOfToCcHeaderMemberOf) -ne '' -join '|' 'AnyOfToHeader' = @($Rule.AnyOfToHeader) -ne '' -join '|' 'AnyOfToHeaderMemberOf' = @($Rule.AnyOfToHeaderMemberOf) -ne '' -join '|' 'ApplyClassification' = @($Rule.ApplyClassification) -ne '' -join '|' 'ApplyHtmlDisclaimerFallbackAction' = @($Rule.ApplyHtmlDisclaimerFallbackAction) -ne '' -join '|' 'ApplyHtmlDisclaimerLocation' = @($Rule.ApplyHtmlDisclaimerLocation) -ne '' -join '|' 'ApplyHtmlDisclaimerText' = @($Rule.ApplyHtmlDisclaimerText) -ne '' -join '|' 'ApplyRightsProtectionCustomizationTemplate' = @($Rule.ApplyRightsProtectionCustomizationTemplate) -ne '' -join '|' 'ApplyRightsProtectionTemplate' = @($Rule.ApplyRightsProtectionTemplate) -ne '' -join '|' 'AttachmentContainsWords' = @($Rule.AttachmentContainsWords) -ne '' -join '|' 'AttachmentExtensionMatchesWords' = @($Rule.AttachmentExtensionMatchesWords) -ne '' -join '|' 'AttachmentMatchesPatterns' = @($Rule.AttachmentMatchesPatterns) -ne '' -join '|' 'AttachmentNameMatchesPatterns' = @($Rule.AttachmentNameMatchesPatterns) -ne '' -join '|' 'AttachmentPropertyContainsWords' = @($Rule.AttachmentPropertyContainsWords) -ne '' -join '|' 'AttachmentSizeOver' = @($Rule.AttachmentSizeOver) -ne '' -join '|' 'BetweenMemberOf1' = @($Rule.BetweenMemberOf1) -ne '' -join '|' 'BetweenMemberOf2' = @($Rule.BetweenMemberOf2) -ne '' -join '|' 'BlindCopyTo' = @($Rule.BlindCopyTo) -ne '' -join '|' 'ContentCharacterSetContainsWords' = @($Rule.ContentCharacterSetContainsWords) -ne '' -join '|' 'CopyTo' = @($Rule.CopyTo) -ne '' -join '|' 'DlpPolicy' = @($Rule.DlpPolicy) -ne '' -join '|' 'ExceptIfADComparisonAttribute' = @($Rule.ExceptIfADComparisonAttribute) -ne '' -join '|' 'ExceptIfADComparisonOperator' = @($Rule.ExceptIfADComparisonOperator) -ne '' -join '|' 'ExceptIfAnyOfCcHeader' = @($Rule.ExceptIfAnyOfCcHeader) -ne '' -join '|' 'ExceptIfAnyOfCcHeaderMemberOf' = @($Rule.ExceptIfAnyOfCcHeaderMemberOf) -ne '' -join '|' 'ExceptIfAnyOfRecipientAddressContainsWords' = @($Rule.ExceptIfAnyOfRecipientAddressContainsWords) -ne '' -join '|' 'ExceptIfAnyOfRecipientAddressMatchesPatterns' = @($Rule.ExceptIfAnyOfRecipientAddressMatchesPatterns) -ne '' -join '|' 'ExceptIfAnyOfToCcHeader' = @($Rule.ExceptIfAnyOfToCcHeader) -ne '' -join '|' 'ExceptIfAnyOfToCcHeaderMemberOf' = @($Rule.ExceptIfAnyOfToCcHeaderMemberOf) -ne '' -join '|' 'ExceptIfAnyOfToHeader' = @($Rule.ExceptIfAnyOfToHeader) -ne '' -join '|' 'ExceptIfAnyOfToHeaderMemberOf' = @($Rule.ExceptIfAnyOfToHeaderMemberOf) -ne '' -join '|' 'ExceptIfAttachmentContainsWords' = @($Rule.ExceptIfAttachmentContainsWords) -ne '' -join '|' 'ExceptIfAttachmentExtensionMatchesWords' = @($Rule.ExceptIfAttachmentExtensionMatchesWords) -ne '' -join '|' 'ExceptIfAttachmentMatchesPatterns' = @($Rule.ExceptIfAttachmentMatchesPatterns) -ne '' -join '|' 'ExceptIfAttachmentNameMatchesPatterns' = @($Rule.ExceptIfAttachmentNameMatchesPatterns) -ne '' -join '|' 'ExceptIfAttachmentPropertyContainsWords' = @($Rule.ExceptIfAttachmentPropertyContainsWords) -ne '' -join '|' 'ExceptIfAttachmentSizeOver' = @($Rule.ExceptIfAttachmentSizeOver) -ne '' -join '|' 'ExceptIfBetweenMemberOf1' = @($Rule.ExceptIfBetweenMemberOf1) -ne '' -join '|' 'ExceptIfBetweenMemberOf2' = @($Rule.ExceptIfBetweenMemberOf2) -ne '' -join '|' 'ExceptIfContentCharacterSetContainsWords' = @($Rule.ExceptIfContentCharacterSetContainsWords) -ne '' -join '|' 'ExceptIfFrom' = @($Rule.ExceptIfFrom) -ne '' -join '|' 'ExceptIfFromAddressContainsWords' = @($Rule.ExceptIfFromAddressContainsWords) -ne '' -join '|' 'ExceptIfFromAddressMatchesPatterns' = @($Rule.ExceptIfFromAddressMatchesPatterns) -ne '' -join '|' 'ExceptIfFromMemberOf' = @($Rule.ExceptIfFromMemberOf) -ne '' -join '|' 'ExceptIfFromScope' = @($Rule.ExceptIfFromScope) -ne '' -join '|' 'ExceptIfHasClassification' = @($Rule.ExceptIfHasClassification) -ne '' -join '|' 'ExceptIfHeaderContainsMessageHeader' = @($Rule.ExceptIfHeaderContainsMessageHeader) -ne '' -join '|' 'ExceptIfHeaderContainsWords' = @($Rule.ExceptIfHeaderContainsWords) -ne '' -join '|' 'ExceptIfHeaderMatchesMessageHeader' = @($Rule.ExceptIfHeaderMatchesMessageHeader) -ne '' -join '|' 'ExceptIfHeaderMatchesPatterns' = @($Rule.ExceptIfHeaderMatchesPatterns) -ne '' -join '|' 'ExceptIfManagerAddresses' = @($Rule.ExceptIfManagerAddresses) -ne '' -join '|' 'ExceptIfManagerForEvaluatedUser' = @($Rule.ExceptIfManagerForEvaluatedUser) -ne '' -join '|' 'ExceptIfMessageContainsAllDataClassifications' = @($Rule.ExceptIfMessageContainsAllDataClassifications) -ne '' -join '|' 'ExceptIfMessageContainsDataClassifications' = @($Rule.ExceptIfMessageContainsDataClassifications) -ne '' -join '|' 'ExceptIfMessageSizeOver' = @($Rule.ExceptIfMessageSizeOver) -ne '' -join '|' 'ExceptIfMessageTypeMatches' = @($Rule.ExceptIfMessageTypeMatches) -ne '' -join '|' 'ExceptIfRecipientADAttributeContainsWords' = @($Rule.ExceptIfRecipientADAttributeContainsWords) -ne '' -join '|' 'ExceptIfRecipientADAttributeMatchesPatterns' = @($Rule.ExceptIfRecipientADAttributeMatchesPatterns) -ne '' -join '|' 'ExceptIfRecipientAddressContainsWords' = @($Rule.ExceptIfRecipientAddressContainsWords) -ne '' -join '|' 'ExceptIfRecipientAddressMatchesPatterns' = @($Rule.ExceptIfRecipientAddressMatchesPatterns) -ne '' -join '|' 'ExceptIfRecipientInSenderList' = @($Rule.ExceptIfRecipientInSenderList) -ne '' -join '|' 'ExceptIfSCLOver' = @($Rule.ExceptIfSCLOver) -ne '' -join '|' 'ExceptIfSenderADAttributeContainsWords' = @($Rule.ExceptIfSenderADAttributeContainsWords) -ne '' -join '|' 'ExceptIfSenderADAttributeMatchesPatterns' = @($Rule.ExceptIfSenderADAttributeMatchesPatterns) -ne '' -join '|' 'ExceptIfSenderDomainIs' = @($Rule.ExceptIfSenderDomainIs) -ne '' -join '|' 'ExceptIfSenderInRecipientList' = @($Rule.ExceptIfSenderInRecipientList) -ne '' -join '|' 'ExceptIfSenderIpRanges' = @($Rule.ExceptIfSenderIpRanges) -ne '' -join '|' 'ExceptIfSenderManagementRelationship' = @($Rule.ExceptIfSenderManagementRelationship) -ne '' -join '|' 'ExceptIfSentTo' = @($Rule.ExceptIfSentTo) -ne '' -join '|' 'ExceptIfSentToMemberOf' = @($Rule.ExceptIfSentToMemberOf) -ne '' -join '|' 'ExceptIfSentToScope' = @($Rule.ExceptIfSentToScope) -ne '' -join '|' 'ExceptIfSubjectContainsWords' = @($Rule.ExceptIfSubjectContainsWords) -ne '' -join '|' 'ExceptIfSubjectMatchesPatterns' = @($Rule.ExceptIfSubjectMatchesPatterns) -ne '' -join '|' 'ExceptIfSubjectOrBodyContainsWords' = @($Rule.ExceptIfSubjectOrBodyContainsWords) -ne '' -join '|' 'ExceptIfSubjectOrBodyMatchesPatterns' = @($Rule.ExceptIfSubjectOrBodyMatchesPatterns) -ne '' -join '|' 'ExceptIfWithImportance' = @($Rule.ExceptIfWithImportance) -ne '' -join '|' 'ExpiryDate' = @($Rule.ExpiryDate) -ne '' -join '|' 'From' = @($Rule.From) -ne '' -join '|' 'FromAddressContainsWords' = @($Rule.FromAddressContainsWords) -ne '' -join '|' 'FromAddressMatchesPatterns' = @($Rule.FromAddressMatchesPatterns) -ne '' -join '|' 'FromMemberOf' = @($Rule.FromMemberOf) -ne '' -join '|' 'GenerateIncidentReport' = @($Rule.GenerateIncidentReport) -ne '' -join '|' 'GenerateNotification' = @($Rule.GenerateNotification) -ne '' -join '|' 'HasClassification' = @($Rule.HasClassification) -ne '' -join '|' 'HeaderContainsMessageHeader' = @($Rule.HeaderContainsMessageHeader) -ne '' -join '|' 'HeaderContainsWords' = @($Rule.HeaderContainsWords) -ne '' -join '|' 'HeaderMatchesMessageHeader' = @($Rule.HeaderMatchesMessageHeader) -ne '' -join '|' 'HeaderMatchesPatterns' = @($Rule.HeaderMatchesPatterns) -ne '' -join '|' 'IncidentReportContent' = @($Rule.IncidentReportContent) -ne '' -join '|' 'LogEventText' = @($Rule.LogEventText) -ne '' -join '|' 'ManagerAddresses' = @($Rule.ManagerAddresses) -ne '' -join '|' 'ManagerForEvaluatedUser' = @($Rule.ManagerForEvaluatedUser) -ne '' -join '|' 'MessageContainsAllDataClassifications' = @($Rule.MessageContainsAllDataClassifications) -ne '' -join '|' 'MessageContainsDataClassifications' = @($Rule.MessageContainsDataClassifications) -ne '' -join '|' 'MessageSizeOver' = @($Rule.MessageSizeOver) -ne '' -join '|' 'MessageTypeMatches' = @($Rule.MessageTypeMatches) -ne '' -join '|' 'ModerateMessageByUser' = @($Rule.ModerateMessageByUser) -ne '' -join '|' 'ObjectState' = @($Rule.ObjectState) -ne '' -join '|' 'PrependSubject' = @($Rule.PrependSubject) -ne '' -join '|' 'RecipientADAttributeContainsWords' = @($Rule.RecipientADAttributeContainsWords) -ne '' -join '|' 'RecipientADAttributeMatchesPatterns' = @($Rule.RecipientADAttributeMatchesPatterns) -ne '' -join '|' 'RecipientAddressContainsWords' = @($Rule.RecipientAddressContainsWords) -ne '' -join '|' 'RecipientAddressMatchesPatterns' = @($Rule.RecipientAddressMatchesPatterns) -ne '' -join '|' 'RecipientDomainIs' = @($Rule.RecipientDomainIs) -ne '' -join '|' 'RecipientInSenderList' = @($Rule.RecipientInSenderList) -ne '' -join '|' 'RedirectMessageTo' = @($Rule.RedirectMessageTo) -ne '' -join '|' 'RejectMessageEnhancedStatusCode' = @($Rule.RejectMessageEnhancedStatusCode) -ne '' -join '|' 'RejectMessageReasonText' = @($Rule.RejectMessageReasonText) -ne '' -join '|' 'RemoveHeader' = @($Rule.RemoveHeader) -ne '' -join '|' 'SCLOver' = @($Rule.SCLOver) -ne '' -join '|' 'SenderADAttributeContainsWords' = @($Rule.SenderADAttributeContainsWords) -ne '' -join '|' 'SenderADAttributeMatchesPatterns' = @($Rule.SenderADAttributeMatchesPatterns) -ne '' -join '|' 'SenderDomainIs' = @($Rule.SenderDomainIs) -ne '' -join '|' 'SenderInRecipientList' = @($Rule.SenderInRecipientList) -ne '' -join '|' 'SenderIpRanges' = @($Rule.SenderIpRanges) -ne '' -join '|' 'SenderManagementRelationship' = @($Rule.SenderManagementRelationship) -ne '' -join '|' 'SenderNotificationType' = @($Rule.SenderNotificationType) -ne '' -join '|' 'SentTo' = @($Rule.SentTo) -ne '' -join '|' 'SentToMemberOf' = @($Rule.SentToMemberOf) -ne '' -join '|' 'SetHeaderName' = @($Rule.SetHeaderName) -ne '' -join '|' 'SetHeaderValue' = @($Rule.SetHeaderValue) -ne '' -join '|' 'SetSCL' = @($Rule.SetSCL) -ne '' -join '|' 'SmtpRejectMessageRejectStatusCode' = @($Rule.SmtpRejectMessageRejectStatusCode) -ne '' -join '|' 'SmtpRejectMessageRejectText' = @($Rule.SmtpRejectMessageRejectText) -ne '' -join '|' 'SubjectContainsWords' = @($Rule.SubjectContainsWords) -ne '' -join '|' 'SubjectMatchesPatterns' = @($Rule.SubjectMatchesPatterns) -ne '' -join '|' 'SubjectOrBodyContainsWords' = @($Rule.SubjectOrBodyContainsWords) -ne '' -join '|' 'SubjectOrBodyMatchesPatterns' = @($Rule.SubjectOrBodyMatchesPatterns) -ne '' -join '|' 'WithImportance' = @($Rule.WithImportance) -ne '' -join '|' } } } } |