Powershell - DLP - Add Rules to the DLP Policy

Sokoban 996 Reputation points
2024-06-26T06:26:27.2933333+00:00

Hi Im trying to making Add Rules to DLP Policy with PowerShell

# Add Rules to the DLP Policy
$RuleName = "DlpRule"
$ContentContainsSensitiveInformation = @(
New-DlpSensitiveInformationTypeRuleCondition `
 -SensitiveInformationType @{Name="Credit Card Number" ; MinCount=1} )


the error message is:

New-DlpSensitiveInformationTypeRuleCondition : The term 'New-DlpSensitiveInformationTypeRuleCondition' is not
recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if
a path was included, verify that the path is correct and try again.
At line:3 char:1
+ New-DlpSensitiveInformationTypeRuleCondition `
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (New-DlpSensitiv...peRuleCondition:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

-SensitiveInformationType : The term '-SensitiveInformationType' is not recognized as the name of a cmdlet, function,
script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is
correct and try again.
At line:5 char:2
+  -SensitiveInformationType @{Name="Credit Card Number" ; MinCount=1}  ...
+  ~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (-SensitiveInformationType:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

What can I do ?

Sokoban

Microsoft Purview
Microsoft Purview
A Microsoft data governance service that helps manage and govern on-premises, multicloud, and software-as-a-service data. Previously known as Azure Purview.
1,020 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,445 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Ian Xue (Shanghai Wicresoft Co., Ltd.) 32,741 Reputation points Microsoft Vendor
    2024-06-27T01:00:10.67+00:00

    Hi Sokoban,

    I didn't find anything about the PowerShell cmdlet New-DlpSensitiveInformationTypeRuleCondition. It does not seem to be a cmdlet of Exchange PowerShell. If you are using some third-party module, try import it manually using Import-Module.

    Best Regards,

    Ian Xue


    If the Answer is helpful, please click "Accept Answer" and upvote it.

    0 comments No comments