{"id":1297,"date":"2016-11-16T13:26:45","date_gmt":"2016-11-16T12:26:45","guid":{"rendered":"https:\/\/www.lieben.nu\/liebensraum\/?p=1297"},"modified":"2016-11-16T13:26:45","modified_gmt":"2016-11-16T12:26:45","slug":"new-dlpcompliancerule-usage-example","status":"publish","type":"post","link":"https:\/\/lieben.nu\/liebensraum\/2016\/11\/new-dlpcompliancerule-usage-example\/","title":{"rendered":"New-DlpComplianceRule usage \/ example"},"content":{"rendered":"<p>I was messing around a little with Office 365 Compliance settings using Powershell, as I&#8217;d like to configure a large number of tenants with certain Data Loss Prevention (DLP) rules based on sensitive data in Sharepoint Online, Onedrive for Business and \u00a0Exchange Online.<\/p>\n<p>I then noticed that it wasn&#8217;t possible to use New-DlpComplianceRule in conjunction with predefined or custom sensitive data types, my code + error:<\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">New-DlpComplianceRule -Name &quot;SocialSecurityRule&quot; -Policy &quot;JosLTest&quot; -ContentContainsSensitiveInformatio\nn @{Name=&quot;Credit Card Number&quot;; minCount=&quot;2&quot;} -BlockAccess $True\nThe value specified in sensitive information is invalid.\n+ CategoryInfo : NotSpecified: (:) &#x5B;New-DlpComplianceRule], InvalidContentC...mationException\n+ FullyQualifiedErrorId : &#x5B;Server=DB5EUR01WS007,RequestId=4a19a0bd-abea-4e06-9dc1-47fc35be9d63,TimeStamp=16-11-201\n6 12:02:24] &#x5B;FailureCategory=Cmdlet-InvalidContentContainsSensitiveInformationException] D7D004DA,Microsoft.Office\n.CompliancePolicy.Tasks.NewDlpComplianceRule\n+ PSComputerName : eur01b.ps.compliance.protection.outlook.com<\/pre>\n<p>Fun thing is, this is actually exactly as <a href=\"https:\/\/technet.microsoft.com\/EN-US\/library\/mt627838(v=exchg.160).aspx\">Technet shows how it should be done.<\/a><\/p>\n<p>So I called support, apparently this is a bug. So, for now, if you want to create a DLP compliance policy and rule, follow this example:<!--more--><\/p>\n<p>Create the policy:<\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">New-DlpCompliancePolicy -Name &quot;Test Policy by Jos&quot; -Comment &quot;TestPolicy&quot; -SharePointLocation All\u00a0-OneDriveLocation All\u00a0-ExchangeLocation All -Mode Enable<\/pre>\n<p>Get all DLP rule sensitive data types:<\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">Get-DlpSensitiveInformationType<\/pre>\n<p>Use the GUID of the information type when you create your rule:<\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">New-DlpComplianceRule -Name &quot;Test Rule\u00a0by Jos&quot; -Policy &quot;Test Policy by Jos&quot; -ContentContainsSensitiveInformatio\nn @{Name=&quot;50842eb7-edc8-4019-85dd-5a5c1f2bb085&quot;; minCount=&quot;2&quot;} -BlockAccess $True<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was messing around a little with Office 365 Compliance settings using Powershell, as I&#8217;d like to configure a large number of tenants with certain Data Loss Prevention (DLP) rules based on sensitive data in Sharepoint Online, Onedrive for Business and \u00a0Exchange Online. I then noticed that it wasn&#8217;t possible to use New-DlpComplianceRule in conjunction &hellip; <a href=\"https:\/\/lieben.nu\/liebensraum\/2016\/11\/new-dlpcompliancerule-usage-example\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">New-DlpComplianceRule usage \/ example<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[32,39],"tags":[],"class_list":["post-1297","post","type-post","status-publish","format-standard","hentry","category-office-365","category-powershell"],"_links":{"self":[{"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/posts\/1297","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/comments?post=1297"}],"version-history":[{"count":0,"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/posts\/1297\/revisions"}],"wp:attachment":[{"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/media?parent=1297"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/categories?post=1297"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/tags?post=1297"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}