I am trying to create adaptive scope for specific users with their email adresses in microsoft purview, but i am getting this error “Client Error: Object reference not set to an instance of an object” error you're seeing while creating an adaptive scope

Aishwarya Ganesh 0 Reputation points
2025-05-22T08:41:15.6566667+00:00

I am trying to create adaptive scope for specific users with their email addresses in Microsoft purview, but i am getting this error “Client Error: Object reference not set to an instance of an object”. can you provide me steps to create adaptive scope.Screenshot 2025-05-22 135906.png

Microsoft Purview
Microsoft Purview
A Microsoft data governance service that helps manage and govern on-premises, multicloud, and software-as-a-service data. Previously known as Azure Purview.
1,629 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Venkat Reddy Navari 2,470 Reputation points Microsoft External Staff Moderator
    2025-05-22T09:43:35.7666667+00:00

    Hi @Aishwarya Ganesh You're encountering the error:

    "Client Error: Object reference not set to an instance of an object" while trying to create an adaptive scope for specific users based on email addresses in Microsoft Purview.

    This type of error usually points to issues with the attributes being used in the query or how the scope is being constructed. Below are clear steps to help you successfully create the adaptive scope and avoid this error.

    Steps to Create an Adaptive Scope for Specific Users

    Access the Microsoft Purview Compliance Portal

    Navigate to Adaptive Scopes: Select Data lifecycle management > Microsoft 365 > Adaptive scopes, Click Create scope

    Define Scope Details: Choose User scope, Enter a Name (e.g., “Specific Users Scope”) and an optional Description

    Build the Query: Click Advanced query builder (recommended to avoid UI-based issues),

    Use PrimarySmtpAddress for more accurate results (recommended over EmailAddresses, which is multi-valued and prone to errors)

    Examples:

    • Single User:
        
        PrimarySmtpAddress -eq "******@mobileaspects.com"
      
    • Multiple Users:
        
        PrimarySmtpAddress -eq "******@mobileaspects.com" -or PrimarySmtpAddress -eq "******@mobileaspects.com"
      
    • You may also use:
        
        UserPrincipalName -eq "******@mobileaspects.com"
      
    • Validate the Query: Click Preview results to confirm the correct users are being returned.
    • Save the adaptive scope. It may take up to a few hours to become available.
    • Apply it under: Data lifecycle management > Retention policies > Choose locations > Adaptive

    Troubleshooting the Error

    If you still see the error:

    1. Verify Email Addresses in Azure AD Use PowerShell to confirm the user’s primary email:
         
         Connect-AzureAD
         Get-AzureADUser -Filter "mail eq '******@mobileaspects.com'"
      
      If no results are returned, verify this is the user’s primary SMTP address.
    2. Test with a Single User
      • Delete the current draft and recreate the scope with just one user.
      • Add additional users one at a time.
    3. Use the Advanced Query Builder: This bypasses some known issues with the standard UI-based builder.
    4. Check for Backend/Browser Issues
      • Try using an incognito/private browser session.
      • Check for any known service issues in the Microsoft 365 admin center under Service Health.

    I hope this information helps. Please do let us know if you have any further queries.

    Kindly consider upvoting the comment if the information provided is helpful. This can assist other community members in resolving similar issues.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.