Enable and configure IRM for SharePoint online using PowerShell RRS feed

All replies

  • Not with regular PowerShell cmdlets. But you can use CSOM:
    Friday, February 20, 2015 9:31 PM
  • Hi Vasil,

    I tried using the PowerShell commands on the link, however, it's no longer working.  I took a look into the SharePoint Online management shell document but I don't see any parts that relate to changing the document permissions.  Going through the AadrmService cmdlets, I'm not seeing any options at a document level.  

    I can send you screenshots of what I'm seeing.

    Thursday, July 30, 2015 9:13 PM
  • The cmdlets are using CSOM, not the SPO PowerShell module.
    Friday, July 31, 2015 6:25 AM
  • How can i use CSOM in O365 script. Here's my script it executes with out errors but doesnt set IRM settings in SharePoint online library.

    $site = "****"
    $Context = Get-ClientContext $Username $password $site
    $list = $Context.Web.Lists
    Foreach($lists in $list)
     if($lists.BaseType -eq "DocumentLibrary" -and $lists.Hidden -eq $false)
     write-host $lists
     set-SPOList -ListName $lists
    $lists.IrmEnabled =$true
     $lists.InformationRightsManagementSettings.PolicyTitle = "RMSDefaultPolicy"
     $lists.InformationRightsManagementSettings.PolicyDescription = "Default RMS Policy"
     $lists.IrmReject = $true
    write-host "hi i am executing"
    $lists.InformationRightsManagementSettings.AllowPrint = $true
    $lists.InformationRightsManagementSettings.EnableLicenseCacheExpire = $true
    $lists.InformationRightsManagementSettings.LicenseCacheExpireDays = "8" 
    write-Host $lists.Title + "hi"


    Any help is appreciated!

    Saturday, March 18, 2017 2:40 AM
  • Hello,

    You just have to add this line after your "$lists.Update()" :


    Wednesday, June 28, 2017 9:53 AM