WIP…
TBP
WIP…
TBP
This article answers two simple questions:
– how many SharePoint orphaned users do you have in your Microsoft 365 tenant?
– what is the likelihood of having User id Mismatch issue?
Unfortunately, Microsoft 365 does not provide a built-in report that can quickly answer this question across an entire tenant. As a result, administrators often need to estimate the scale of the problem before investing time in tenant-wide scanning and cleanup efforts.
This article provides a simple estimation method based on observations from several real-world Microsoft 365 tenants. The goal is not to produce an exact number, but rather to determine whether your organization is likely dealing with dozens, thousands, or millions of orphaned users.
In SharePoint, an orphaned user is a user record that still exists in a site’s User Information List even though the corresponding account no longer exists in Microsoft Entra ID. Orphaned users are not necessarily a problem by themselves. However, they can contribute to User ID Mismatch issues when a user account is recreated with a previously used User Principal Name (UPN) and SharePoint fails to provide access.
Please take a look at the more detailed “Orphaned Users in SharePoint and Their Connection to User ID Mismatch“
Based on observations from several production tenants, a simple estimation model is to assume that the number of orphan users grows roughly in proportion to tenant age and, a 10-year-old tenant is expected to have approximately the same number of orphan users as enabled Entra ID accounts
Estimated Orphan Users = Enabled Entra ID Users × Tenant Age ÷ 10
The actual number of orphaned identities depends on many factors (see below).
Orphaned users do not directly cause User ID Mismatch issues by themselves. However, User ID Mismatch typically occurs when an orphaned user exists in SharePoint and the same UPN is reused for a new account.
In general, the likelihood of User ID Mismatch issues increases as the number of orphaned users grows. Based on observations from several production tenants, a rough estimate is approximately one User ID Mismatch ticket per month for every 100 enabled user accounts in a 10-year-old tenant. Actual numbers may vary depending on employee turnover, SharePoint adoption, and UPN reuse practices.
Estimated User ID Mismatch Tickets per Month = Enabled Entra ID Users × Tenant Age ÷ 1000
E.g. for a 5 year old tenant with 10,000 users you can have as much as 50 issues related to the User Id Mismatch scenario every month. The actual number of User Id Mismatch related issues depends on many factors.
Note. It is important to understand, that typically a regular user do not have access to one site only. For an organization that uses Microsoft 365 SharePoint an average user can have access to dozens and hundreds sites. And a User Information List (UIL) – where SharePoint caches all user’s data and where the orphan users exist – exists at every site, so the number of orphan user records, and consequently potentially user id mismatch issues is much higher than just a number of orphan users.
I assume (again, based on real-world experience) the average number of sites every user access is ~100.
So this estimation assumes that we fix the User Id Mismatch issue for the affected site upon the ticket from user. So if a reactive clean-up of all affected sites for a specific user is implemented – it’d decrease the number of issues (see Preventing SharePoint User ID Mismatch).
The following factors generally increase the number of orphaned users in a tenant and consequently the risk of User ID Mismatch issues:
The following factors generally decrease the risk of User ID Mismatch issue and the number of orphaned users in a tenant:
The formulas presented in this article is intentionally simple and should be treated as a rough planning estimate, not a precise calculation.
Its purpose is to help administrators quickly assess the possible scale of orphaned users in their environment and determine whether a deeper investigation is justified. If the estimate suggests – it may be worth investing in tenant-wide analysis, cleanup, and User ID Mismatch prevention strategies.
To get exact number of orphan users – you can
===========
When a user leaves an organization, their account is usually deleted from Microsoft Entra ID. However, SharePoint often keeps a record of that user in its own databases. These records are commonly called orphaned users. Most of the time they do not cause any problems. But when the same user principal name (UPN) is later assigned to a new account, these orphaned records can cause the well-known User ID Mismatch issue. In this article, we’ll look at what orphaned users are, why they exist, how they are related to User ID Mismatch, and what SharePoint administrators can do about them.
An orphaned user in SharePoint is generally understood as a user whose record still exists in a SharePoint, even though the corresponding Microsoft Entra ID account no longer exists in directory.
Orphaned user records are not necessarily errors. SharePoint maintains its own databases at every site and caches user’s data so that it can preserve historical context, such as who created or modified a document. However, these records can become operationally significant when an organization creates a new Entra ID account using the same User Principal Name (or UPN), as a previously deleted account.
This can produce a SharePoint user ID mismatch:
This article explains:
SharePoint maintains information about users who have interacted with or received permissions to a site collection. This information is stored in the site collection’s User Information List, commonly referred to as the UIL (it’s a hidden list in every SharePoint site collection). When a person visits a site or is otherwise resolved as a user, SharePoint caches information about that identity in this list. Deleting the corresponding account from Microsoft 365 or Entra ID does not necessarily remove the entry from each SharePoint UIL.
The resulting record is commonly called an “Orphaned user” or “Stale user” or “Legacy user” or “Orphaned SharePoint identity”. “Orphaned user” is a useful administrative term, although Microsoft documentation more frequently uses terms such as legacy user account, outdated user account, or an old entry in the UIL.
The retained record provides continuity for user-related metadata. For example, after an employee leaves the organization, other users may still need to see that the former employee:
From this perspective, the orphaned record appears not harmless but useful. It helps SharePoint preserve the historical identity associated with existing content.
Should administrators treat every orphaned user as something that must immediately be deleted? I see Microsoft position is conflicting/controversial/ambiguous, as generally they say that legacy entry in the UIL is needed to preserve metadata but – at the same time – removal an orphan user from the UIL is OK, though primarily as a troubleshooting action for profile synchronization and mismatched-ID scenarios, rather than as routine indiscriminate cleanup (more: Is It Safe to Remove a User from a SharePoint UIL).
Consider a common employee lifecycle scenario.
john.smith@contoso.com.The new account looks similar to the old account: same display name, same email address, same UPN. However, it is not the same directory object. The recreated account receives a new internal identity value, even though its UPN matches the deleted account. Microsoft documents this as a primary cause of SharePoint and OneDrive user ID mismatch.
The same situation can also occur when the UPN is assigned to a rehired person.
From Entra ID’s perspective, the new account is a new security principal. From the affected SharePoint site’s perspective, however, the UPN may still be associated with the legacy UserInfo entry.
A user ID mismatch occurs when the identity presented by the current user does not match the identity stored in SharePoint with the same UPN.
Conceptually, SharePoint sees something like this:
| Attribute | Legacy account | New account |
|---|---|---|
| Display name | John Smith | John Smith |
| UPN | john.smith@contoso.com | john.smith@contoso.com |
| Entra ID object ID | Unique (Old value) | Unique (New value) |
Although the UPN is the same, the internal identity is different.
Microsoft describes the underlying cause as follows: the recreated account receives a new ID, but the affected SharePoint or OneDrive UIL still contains the old ID. When the user attempts to access the site using the new account, the new identity does not match the identity stored in the site. Access can therefore be denied.
Sometimes a user experiences issues with their personal OneDrive site (User Id Mismatch in OneDrive scenario).
Typical symptoms include:
At first glance, it may appear that SharePoint should automatically connect the new account to the old account because the UPN is identical. But that would create a security risk.
The same UPN does not mean that the new account represents the same person. Even if it is the same person, the individual may have returned in a different position, in another department, under different security requirements. So the new account should not automatically inherit the old account’s SharePoint permissions.
Therefore, SharePoint is correct not to treat the recreated account as the same security principal merely because the UPN matches. The more problematic behavior appears after an authorized site owner intentionally grants the new account access.
Suppose the new John Smith requests access to a site.
The site owner reviews the request and intentionally approves it. Alternatively, the site owner shares a site, library, folder, or document with the new account. From the site owner’s perspective, everything may appear correct:
However, the user may still be unable to access the resource because the site’s UIL contains the legacy identity associated with the same UPN.
SharePoint does not replace the old identity automatically when the new account is granted access. That is the practical limitation behind the user ID mismatch incidents.
Microsoft’s supported starting point is the Site User Mismatch diagnostic in the Microsoft 365 admin center. When a mismatch is found, the diagnostic can offer to remove the old identity from the affected site. After the old entry is removed, the new account must be assigned the appropriate permissions.
For a single user and site, this is usually manageable. At tenant scale, it becomes much more complicated.
A recreated user rarely interacted with only one SharePoint site. During the person’s previous employment, the account may have been present in:
Removing the legacy identity from one affected site fixes only that site. The same user may encounter another issue tomorrow, next week, or several months later when attempting to access a different site.
This creates a recurring support pattern:
The technical fix is site-specific, while the identity lifecycle problem is potentially tenant-wide.
The obvious question is: Which SharePoint sites still contain the old identity?
SharePoint Online does not provide a simple out-of-the-box report listing every site collection whose UIL contains a specific legacy user. An administrator can technically scan SharePoint sites and inspect their users. However, this can be inefficient in a large tenant. For example, imagine a tenant with:
A straightforward tenant scan may need to inspect all 50,000 sites to locate the relevant 100.
The administrator knows the identity being investigated but does not know which site collections contain that identity. SharePoint’s user information is distributed across site collections rather than exposed through a convenient centralized orphan-user inventory.
It is possible to use PowerShell, but even for one affected user, a tenant-wide brute-force scan may consume considerable time and service resources relative to the number of useful results. The other option is to use 3-rd party tools.
Can we be proactive here? Probably yes… There are three general opportunities.
This is a “reactive-proactive” approach… We get tickets (reactively) but fix not one, but all affected sites for a user (proactively)
This approach is minimally proactive, it treats the symptom rather than the tenant-wide identity residue.
The next shift-left opportunity occurs when an account is created. The idea is not to wait when user hits the issue. The organization could determine whether the UPN was previously used and then search for the corresponding legacy SharePoint identity, so the mismatch can be resolved before the user accesses SharePoint.
The challenge is the process must determine whether the UPN is genuinely new or reused. This approach can prevent tickets, but it requires reliable identity history.
Alternatively we can scan all new users to discover potential mismatched id, but this approach is much more expensive.
The earliest intervention point is employee offboarding.
Before deleting the Entra ID account, the organization still has a valid and identifiable user. It is easier to determine the SharePoint sites associated with a current identity than to reconstruct that information months or years later.
The offboarding process could be as follow:
Surely we know that most offboarded users will never return (deleted UPNs may never be reused) and removing every departing user from every site may be unnecessary, but it It addresses the problem at its earliest practical stage and ensures there is no future user ID mismatch incidents.
This is the most proactive approach, but it (as well as option 2) can also be an over-engineered solution if the actual mismatch rate is very low.
Again, as per Microsoft – an organization should not assume that universal deletion is automatically the best practice. Microsoft specifically describes UserInfo removal as a troubleshooting operation that should be performed for synchronization or mismatch scenarios when advised, rather than as a general cleanup requirement.
For established tenants, a single activity not always completely solves the problem. A practical program can be a combination of three separate workstreams.
This workstream addresses the historical backlog already present in the tenant.
Imagine, we implemented remediation Option 3 (Remove Legacy Site Entries During Offboarding). For brand-new tenants that would guarantee no user id mismatch issues. But for mature tenants we already have a lot of legacy users, so we’ll definitely have issues related to mismatched is.
To ensure we do not have user id mismatch tickets – we wood need
– stop bleeding (implement Option 3 Remove Legacy Site Entries During Offboarding)
– clean-up existing orphaned users
Existing orphan users cleanup can require substantial effort in an old or large tenant because orphaned identities may have accumulated for many years, so we could have millions of orphaned users record (which means millions of deleting operations) – see more in “Estimate number of Orphaned Users and User Id Mismatch tickets.”
This workstream focuses on newly created or recreated accounts. Its purpose is to prevent a new employee or returning employee from encountering mismatch errors after receiving a Microsoft 365 account and before SharePoint access.
It does not remove the entire orphan-user backlog, so we’d still have a bunch of orphan users, but it can prevent visible incidents for newly created accounts. Having “Stop tickets” process implemented we guarantee user’s satisfaction, but that’s (imho) the most expensive process.
This workstream is triggered when users are offboarded. Its purpose is to prevent orphaned users, which would guarantee no new legacy identity conflicts. This is a future-state prevention activity.
Implementing “Stop Bleeding” process must be combined with clean-up efforts to achieve “Sop tickets”.
Imho, this is the most logical way to remediate the issue. It might be complicated from the engineering efforts perspective, but would be the less resource-consuming approach after clean-up.
The appropriate combination of these workstreams depends partly on the age of the tenant.
A newly created tenant has little or no legacy identity history.
The primary focus should therefore be:
An old established tenant with many years of account turnover already contain many unresolved legacy (orphan) users entries. We are probably dealing with existing (ongoing) user ID mismatch cases.
The organization may need all three workstreams:
In a small tenant, brute-force scanning may be acceptable. An administrator may be able to:
A simple PowerShell script can be used (like this one from the “Orphan Users in Small Tenants” ). Depending on throttling, number of sites, the process might complete within a practical operational window.
In a large tenant, a simple brute-force approach is impractical. This is not only “this should be done” but “this should be done in a most effective way” otherwise it might take forever. The solution may require:
At this scale, orphan-user management becomes an engineering and data-indexing problem rather than a simple administrative script. A 3-rd party tools might be required, in combination with custom PowerShell-based solutions.
To address an Orphaned Users and User Id Mismatch issue in a medium-sized tenant it may require a combination of approaches methods based on tenant size, age processes maturity, admins qualification and so on.
Tenant size and age are not the only factors. Two organizations with the same number of users may experience very different levels of risk.
An organization with stable staffing and low turnover creates relatively few deleted identities. An organization that frequently hires contractors, seasonal workers, or temporary employees may create and delete a much larger number of accounts.
This deserves its own detailed discussion.
Microsoft documents removal from the UIL as a way to troubleshoot mismatched identity and profile synchronization scenarios. At the same time, Microsoft warns that the removal procedure should be used for those troubleshooting purposes rather than as an unrestricted general cleanup method.
For additional analysis, see: Is It Safe to Remove a User from a SharePoint UIL
So far, we discussed the problem from a SharePoint administrator’s point of view. In that world, the typical solution is to find the legacy user in SharePoint and remove the old user entry from the User Information List.
However, there is another approach. Identity and Access Management (IAM) team can reduce or eliminate many User ID Mismatch issues by ensuring that each person receives a unique UPN that is never reused.
For example, instead of recreating:
john.smith@contoso.com
for a rehired employee, the organization could assign a different UPN, such as:
john_smith@contoso.com
or follow another naming standard that guarantees uniqueness.
With this approach, the new account never collides with the legacy SharePoint user record. As a result, User ID Mismatch issues do not occur.
Of course, this approach comes with its own challenges. Organizations often prefer to reuse the original UPN because it is easier for users, administrators, and business processes. In addition, changing naming standards may affect other systems that depend on predictable user names.
For that reason, UPN management should be viewed as an identity governance decision rather than a SharePoint administration task. SharePoint administrators can fix User ID Mismatch issues when they occur, but Identity and Access Management teams can often prevent those issues from appearing in the first place by implementing policies around account lifecycle management and UPN reuse.
In short, there are two ways to address User ID Mismatch:
The first approach is owned by SharePoint administrators. The second approach is owned by Identity and Access Management teams. In many organizations, the best long-term solution is a combination of both approaches.
Anyway, the best possible resolution could be if Microsoft fix the product: at the moment when a new account is approved with access to the site (or site is shared by site owner with a user) – SharePoint can do clean-up internally – by replacing the old Id with the new Id.
“Orphan User” in SharePoint refers to a user account that no longer exists in Entra ID but is still present in the User Information List (UIL) on SharePoint sites.
Offboarded user accounts are usually deleted from the Entra ID directory sooner or later. However, SharePoint caches user information in its own databases. This information is stored in the so-called UIL (User Information List). Each site has its own User Information List.
Generally, orphan users are pretty harmless, as they are not users, but just ghost entities – records that reflects former accounts, i.e. these users cannot login, even when a new user is created with the same email – access is not possible. Moreover, legacy Microsoft documentation says such records are needed to preserve metadata – like who is the author of the document or documents editing history, etc.
So yes, orphan users are harmless until you hit a User ID Mismatch issue.
In a nutshell, a User ID Mismatch happens when an email address (UPN) is reused and a new user tries to access a SharePoint site where the old user previously had access.
SharePoint does not allow the new user to automatically inherit the same access that the old user had, and this is expected behavior. The issue is that SharePoint may fail to correctly grant access to the new user even after permissions have been assigned.
In such cases, you must first remove the old user ID from the site’s User Information List. This approach is recommended by Microsoft and considered as safe. And guess what? It turns out the old user is no longer needed in the UIL to preserve metadata 🙂
When a user hits a User ID Mismatch issue, it is often difficult to recognize that the problem is not simply missing permissions or a site owner not approving access, but an actual product limitation that prevents access to SharePoint. As a result, users become frustrated, support teams spend time troubleshooting the issue, and it may take a while before the root cause is identified and resolved.
So why not remediate the issue proactively? This way, there are no high-priority support tickets, no angry users, and no urgent troubleshooting when the problem eventually occurs.
The engineering problem behind all approaches to proactively resolving the User ID Mismatch issue is that there is no out-of-the-box (native) SharePoint report that provides a list of sites where a specific orphan user is present. You cannot simply press a button and get a complete list of orphan user/site pairs.
In general, you need to scan the entire tenant, site by site, including personal OneDrive sites, and retrieve all historical site users. Then you need to check whether each user stored in SharePoint still exists in Entra ID.
Multiply the number of sites by the number of users and see how long it might take. An average user typically has access to only ~1% of all sites in a tenant, so you can imagine how inefficient this approach can be.
However, for small tenants, we can still use this so-called brute-force approach. With this approach, we use PowerShell to do the job: identify all orphan users and, optionally, remove them.
Whether this is a viable solution depends on your specific situation: the size of your organization, employee turnover, the amount of data (number of sites), and the age of the tenant.
I may provide some kind of calculator in the future to estimate how long the process might take based on tenant characteristics. But the general idea is simple: in some cases, a brute-force approach is perfectly acceptable because it:
a) is very simple and does not require advanced PowerShell skills, and
b) can be completed in a reasonable amount of time (minutes or hours)
The scripts are here: https://github.com/VladilenK/m365-User-Id-Mismatch
References:
A read-only PowerShell solution that evaluates governance, security, ownership, lifecycle, and operational controls across Microsoft 365 and highlights areas that require attention.
There is no Microsoft Graph API that pulls list of site users. With PnP.PowerShell it’d be easy: Get-PnPUser. Here is the Graph site resource type – there is nothing like that. For group-based sites (e.g. Teams, Viva Engage communities – you get get group members via MS Graph API, but that’s different. So, what do we do to get all SharePoint site users with MS Graph API?
The answer is very simple. Every SharePoint site has a hidden (system) list called User Information List. And that is exactly what you need. So, you’d get list “User Information List” and get all it’s items via graph API:
P.S. using Get-PnPUser against sites with large population could fail with HttpClient.Timeout error, so in such cases we’d use the same approach – get items from User Information List via Get-PnPListItem -List “User Information List” -PageSize 1000. See details in the “Use Get-PnPUser correctly for large sites” KBA.
If you are trying to access somebody’s OneDrive site and it says “The site is archived” – here is what you need to know. Microsoft recently implemented a new feature (process) of mandatory archiving OneDrive sites after 93 days since account becomes unlicensed.

So now it two processes that applied to OneDrive sites of the off-boarding personnal:
This KBA describes how these mechanisms interact, and provides a decision matrix for common offboarding scenarios.
When a user’s Microsoft 365 license is removed, the OneDrive becomes unlicensed. Microsoft’s enforcement (began Jan 27, 2025) introduces these behaviors: [learn.microsoft.com]
Note: Microsoft’s guidance indicates exceptions for certain clouds/segments (e.g., EDU, GCC, DoD). [learn.microsoft.com]
When OneDrive content is being deleted, Microsoft honors retention mechanisms in the following order: [learn.microsoft.com]
After those are satisfied, the account/site is recycled and then permanently deleted. [learn.microsoft.com]
Think of it this way:
So you can have a OneDrive that is:
There are two major branches in Microsoft’s guidance: [learn.microsoft.com]
When the user is deleted in Entra ID, the OneDrive is removed following the standard OneDrive deletion process, honoring retention in this order: OneDrive retention period → retention policies → legal holds. [learn.microsoft.com]
What the 93-day rule changes here:
Microsoft states enforcement does not change retention timelines or the deletion process for this branch. [learn.microsoft.com]
Result patterns
These accounts are archived on their 93rd unlicensed day.
What happens next depends mainly on billing for unlicensed OneDrive accounts: [learn.microsoft.com]
Combine with retention policies / holds:
Retention can still apply for compliance, but in practice this path commonly results in “archived but preserved” behavior. Microsoft also clarifies Purview mechanisms still apply and retention order remains relevant. [learn.microsoft.com]
What this means in practice
Best practice: If business requires access to the files later, plan either (a) content migration/transfer before Day 93, or (b) enable billing and document cost/ownership.
Best practice: If you need long-term preservation, ensure Purview retention/holds are correctly scoped before deletion.
Important operational impact: Retention does not guarantee admin access to content at all times—archival can restrict access even while content is preserved. [learn.microsoft.com]
Microsoft provides admin reporting for unlicensed OneDrive accounts and guidance for identification/monitoring and management actions. [learn.microsoft.com]
Depending on business need:
No. Microsoft states the standard deletion process still honors retention mechanisms (OneDrive retention period → retention policies → legal holds) and enforcement does not change retention timelines. [learn.microsoft.com]
Not necessarily. The OneDrive can be archived and inaccessible until admins take specific actions. Retention can preserve data, while archival can restrict access. [learn.microsoft.com]
Assuming “retention == access.” Retention ensures preservation rules, but enforcement can still move unlicensed OneDrives into an archived state where access is blocked unless admins take action. [learn.microsoft.com]
Microsoft enforces Content Security Policy (CSP) in SharePoint Online.
What does that mean to SharePoint Admins? Should we be concerned? What do we need to undertake? Before? After?
Generally, in web development – the policy (Content Security Policy – CSP) is needed to minimize the risk of security threats by controlling which resources, in particular JavaScript resources, a page/site is allowed to load.
In SharePoint web development is done via SPFx, so the CSP policy affect SPFx solutions. In a nutshell, from now on, for the SPFx solutions to work properly, admins should whitelist external domains. Admins can maintain allowed domains list via GUI in SharePoint admin center or via PowerShell:
# List current sources
Get-SPOContentSecurityPolicy
# Remove a source
Remove-SPOContentSecurityPolicy -Source "https://cdn.host.com/source/"
# Add a source
Add-SPOContentSecurityPolicy -Source "https://cdn.host.com/source/"
The CSP policy was enforced on March 1, 2026, but as per Microsoft, if clients need more time to review and update existing SPFx solutions, we can delay the enforcement by 90 days, until June 1, 2026, via
Set-SPOTenant -DelayContentSecurityPolicyEnforcement $true
# IMPORTANT: List the applied setting again as mandatory step to correctly persist the setting (will be fixed)
(Get-SPOTenant).DelayContentSecurityPolicyEnforcement
Admins can view the Content Security Policy Violations via Purview.
So there are cmdlets:
And for the Set-SPOTenant cmdlet there are options related to CSP:
So the question I ask for myself is what exactly each command does and how are the options correlated to each other and affect SPFx solutions.
It seems like using Set-SPOTenant with a ContentSecurityPolicyEnforcement parameter change nothing. I.e. “Set-SPOTenant -ContentSecurityPolicyEnforcement:$false” does not disable policy and vise versa
“Set-SPOTenant -ContentSecurityPolicyEnforcement:$true” does not enforce the CSP policy.
My guess it’s because this article is written in April 2026. Microsoft started Content Security Policy (CSP) enforcement since March 1, 2026. So probably before March 1, 2026 we could use ContentSecurityPolicyEnforcement to enable the policy, but since March 2026 the policy is enforced anyway and parameter ContentSecurityPolicyEnforcement is not needed (and probably will go away in the next versions of the Microsoft.Online.SharePoint.PowerShell Module).
DelayContentSecurityPolicyEnforcement parameter effectively switches the policy on and off. It takes a few minutes for Microsoft to propagate the change across so you can start seeing the policy enforced or not. But this is true only during 90 days – in Mar, Apr and May 2026. Since June 1, 2026 the Content Security Policy (CSP) will be enforced in SharePoint Online.
How do I know if my site compliant with CSP or not before CSP enforcement?
There are some good findings for developers in the article Preparing for SharePoint Online CSP Enforcement by Nello D’Andrea, MVP. But I will share some more.
Use browser’s dev tools (F12). Select console and filter/search output with “policy”. You can find something like:

“Loading the image ‘<URL>’ violates the following Content Security Policy directive” or
“Loading the script … violates the following Content Security Policy directive” or
“Executing inline script violates the following Content Security Policy directive” or
If the message is just informational (in white) and there is also “The policy is report-only, so the violation has been logged but no further action has been taken.” that means the policy is not enforced yet… and the site functionality should not be affected.
Otherwise – when you see the same “… violates the following Content Security Policy directive” in red – this would be an error message and the policy prevents something on your site due to the CSP policy so functionality will be broken.
Get-PnPUser PowerShell cmdlet is to get the list of site user. For small sites it work OK, but for sites with a large number of site users the cmdlet fails throwing a warning/error “Get-PnPUser: the request was canceled due to the configured HttpClient.Timeout of 100 seconds elapsing.”. Typically suggested fixes like to increase timeout do not work. Here is how to solve the issue.
If you need a list of site users – just get the hidden “User Information List” and get all it’s items:
# Target the hidden list object specifically by its internal title
Get-PnPList -Identity "User Information List"
# Extract the list rows and select the relevant columns
Get-PnPListItem -List "User Information List" -PageSize 1000
Surely you’d get a different object type, but still you’ll be able to find properties you need via something like $user[“Name”] for Get-PnPListItem object versus $user.LoginName for Get-PnPUser object. But if you need a Get-PnPUserObject – you always can do something like
Get-PnPUser -Identity $listItem["Name"]
That is it. You’ll figure out the rest.
P.S. If you need to get all SharePoint site users via Microsoft Graph API – use the same trick – get items from the UIL (as there is no dedicated API entry point to get site users). Here is the “Get SharePoint Site Users via Graph API” KBA.
I’m happy to announce that I’ve got a new Microsoft certification:
Microsoft 365 Certified: Administrator Expert
