{"id":495,"date":"2022-04-08T19:07:45","date_gmt":"2022-04-08T19:07:45","guid":{"rendered":"https:\/\/www.torontohelpdesk.ca\/blog\/?p=495"},"modified":"2022-04-08T19:07:47","modified_gmt":"2022-04-08T19:07:47","slug":"office-365-creating-new-retention-tags-and-policies-via-powershell","status":"publish","type":"post","link":"https:\/\/www.torontohelpdesk.ca\/blog\/office-365-creating-new-retention-tags-and-policies-via-powershell\/","title":{"rendered":"Office 365 &#8211; Creating new retention tags and policies via PowerShell"},"content":{"rendered":"\n<p><strong>Problem:<\/strong><\/p>\n\n\n\n<p>Microsoft&#8217;s classic ECM is acting all funky and you can&#8217;t create retention tags or policies without an error.<\/p>\n\n\n\n<p><strong>Solution:<\/strong><\/p>\n\n\n\n<p>(h\/t <a href=\"https:\/\/www.thatlazyadmin.com\/2017\/05\/17\/creating-retention-tags-and-policies-office-365\/\">That Lazy Admin<\/a>)<\/p>\n\n\n\n<p><strong>How to create Retention Tags and Policies using Powershell<\/strong><\/p>\n\n\n\n<p>Connect to Exchange Powershell using the Quick Connect script Here: <a href=\"https:\/\/gallery.technet.microsoft.com\/Connect-To-Office-365-9b235018?redir=0\">https:\/\/gallery.technet.microsoft.com\/Connect-To-Office-365-9b235018?redir=0<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.thatlazyadmin.com\/wp-content\/uploads\/2017\/05\/reten-06-744x159.png\" alt=\"\" class=\"wp-image-750\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.thatlazyadmin.com\/wp-content\/uploads\/2017\/05\/reten-07-744x152.png\" alt=\"\" class=\"wp-image-751\"\/><\/figure>\n\n\n\n<p>Run the following command to get the current Retention Tags and Policies Get-RetentionPolicy<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<\/td><td>Get-RetentionPolicy<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.thatlazyadmin.com\/wp-content\/uploads\/2017\/05\/reten-08-744x125.png\" alt=\"\" class=\"wp-image-752\"\/><\/figure>\n\n\n\n<p>And Then Get-RetentionPolicyTag<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<\/td><td>Get-RetentionPolicyTag<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.thatlazyadmin.com\/wp-content\/uploads\/2017\/05\/reten-09-744x250.png\" alt=\"\" class=\"wp-image-753\"\/><\/figure>\n\n\n\n<p><strong>Now let\u2019s continue and create the following Retention Tag<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\" type=\"1\"><li>Name: Managers Deleted Items<\/li><li>Delete and Allow Recovery set to 180 days<\/li><\/ol>\n\n\n\n<p>New-RetentionPolicyTag -Name Managers-Deleted-Items -RetentionAction DeleteAndAllowRecovery&nbsp; -AgeLimitForRetention 180 -Type DeletedItems<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>12<\/td><td>New-RetentionPolicyTag -Name Managers-Deleted-Items -RetentionAction DeleteAndAllowRecovery&nbsp; -AgeLimitForRetention 180 -Type DeletedItems<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.thatlazyadmin.com\/wp-content\/uploads\/2017\/05\/reten-10-744x61.png\" alt=\"\" class=\"wp-image-754\"\/><\/figure>\n\n\n\n<p>New-RetentionPolicy -Name Keep-Deleted-Items-Management -RetentionPolicyTagLinks Managers-Deleted-Items<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>12<\/td><td>New-RetentionPolicy -Name Keep-Deleted-Items-Management -RetentionPolicyTagLinks Managers-Deleted-Items<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.thatlazyadmin.com\/wp-content\/uploads\/2017\/05\/reten-11-744x81.png\" alt=\"\" class=\"wp-image-755\"\/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Problem: Microsoft&#8217;s classic ECM is acting all funky and you can&#8217;t create retention tags or policies without an error. Solution: (h\/t That Lazy Admin) How to create Retention Tags and Policies using Powershell Connect to Exchange Powershell using the Quick <a class=\"more-link\" href=\"https:\/\/www.torontohelpdesk.ca\/blog\/office-365-creating-new-retention-tags-and-policies-via-powershell\/\">Continue reading <span class=\"screen-reader-text\">  Office 365 &#8211; Creating new retention tags and policies via PowerShell<\/span><span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-495","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.torontohelpdesk.ca\/blog\/wp-json\/wp\/v2\/posts\/495","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.torontohelpdesk.ca\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.torontohelpdesk.ca\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.torontohelpdesk.ca\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.torontohelpdesk.ca\/blog\/wp-json\/wp\/v2\/comments?post=495"}],"version-history":[{"count":1,"href":"https:\/\/www.torontohelpdesk.ca\/blog\/wp-json\/wp\/v2\/posts\/495\/revisions"}],"predecessor-version":[{"id":496,"href":"https:\/\/www.torontohelpdesk.ca\/blog\/wp-json\/wp\/v2\/posts\/495\/revisions\/496"}],"wp:attachment":[{"href":"https:\/\/www.torontohelpdesk.ca\/blog\/wp-json\/wp\/v2\/media?parent=495"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.torontohelpdesk.ca\/blog\/wp-json\/wp\/v2\/categories?post=495"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.torontohelpdesk.ca\/blog\/wp-json\/wp\/v2\/tags?post=495"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}