Hi @jpcapone ,
I Got you.
My test environment also has MFA enabled. You can try my steps:
- Run PowerShell 7.x as an administrator.
- Register an App for PnP PowerShell and get the Client Id:
Register-PnPEntraIDAppForInteractiveLogin -ApplicationName "PnP PowerShell" -SharePointDelegatePermissions "AllSites.FullControl" -Tenant domain.onmicrosoft.com -Interactive
For more details, please see:
Non-official, just for reference.
- Use the Client Id to connect to SharePoint Online:
# Parameter
$TenantAdminUrl = "https://domain-admin.sharepoint.com"
$ClientID = "clientidstring"
# Connect to Admin Center
Connect-PnPOnline -Url $TenantAdminUrl -Interactive -ClientId $ClientID
#Get All Site collections - Exclude: Seach Center, Redirect site, Mysite Host, App Catalog, Content Type Hub, eDiscovery and Bot Sites
$SiteCollections = Get-PnPTenantSite | Where -Property Template -NotIn ("SRCHCEN#0", "REDIRECTSITE#0", "SPSMSITEHOST#0", "APPCATALOG#0", "POINTPUBLISHINGHUB#0", "EDISC#0", "STS#-1")
#Loop through each site collection
ForEach($Site in $SiteCollections)
{
# Connect to SharePoint
Connect-PnPOnline -Url $Site.URL -Interactive -ClientId $ClientID
# Get all document libraries and lists
$lists = Get-PnPList
# Check IRM settings
foreach ($list in $lists) {
if ($list.IrmEnabled) {
Write-Host "IRM is enabled in $($Site.Url) for list: $($list.Title)"
}
}
}
Hope this helps.
If the answer is helpful, please click "Accept as Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.