Soenneker.Graph.Users 4.0.787

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Soenneker.Graph.Users --version 4.0.787
                    
NuGet\Install-Package Soenneker.Graph.Users -Version 4.0.787
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Soenneker.Graph.Users" Version="4.0.787" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Graph.Users" Version="4.0.787" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Graph.Users" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Soenneker.Graph.Users --version 4.0.787
                    
#r "nuget: Soenneker.Graph.Users, 4.0.787"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Soenneker.Graph.Users@4.0.787
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Soenneker.Graph.Users&version=4.0.787
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Graph.Users&version=4.0.787
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

Soenneker.Graph.Users

Creates, updates, queries, pages through, and queues deletion of Microsoft Graph users using an application-authenticated client.

Install

dotnet add package Soenneker.Graph.Users

Configuration

{
  "Azure": {
    "AzureAd": {
      "TenantId": "<tenant ID>",
      "ClientId": "<application client ID>",
      "ClientSecret": "<client secret>",
      "NonCustomDomain": "contoso.onmicrosoft.com"
    }
  }
}

The app registration must have application permissions that allow the user operations your application calls.

Register

using Soenneker.Graph.Users.Registrars;
using Microsoft.Extensions.DependencyInjection;

services.AddGraphUsersUtilAsScoped();

This deliberately makes IGraphUsersUtil scoped while keeping IGraphClientUtil and the background queue singleton. A utility scope can be destroyed without tearing down the authenticated Graph client or queued work.

AddGraphUsersUtilAsSingleton() is available when the user-operation wrapper should also be application-wide.

Create and query users

User created = await graphUsers.Create(
    firstName: "Ada",
    lastName: "Lovelace",
    role: "Engineer",
    email: "ada@example.com",
    password: initialPassword,
    forceChangePassword: true,
    cancellationToken);

User? byEmail = await graphUsers.GetByEmail(
    "ada@example.com",
    cancellationToken);

List<User> allUsers = await graphUsers.GetAll(cancellationToken);

Created users receive an emailAddress identity issued by Azure:AzureAd:NonCustomDomain, and password expiration is disabled on the created account. GetAll() follows every Graph page rather than returning only the first page.

Update and delete

created.JobTitle = "Principal Engineer";
User? updated = await graphUsers.Update(created, cancellationToken);

await graphUsers.Delete(created.Id!, cancellationToken: cancellationToken);

Update() requires User.Id; Graph errors propagate. A null update result means Graph returned no response body, not that an error was swallowed.

Delete() validates that the user exists by default and then enqueues the deletion. It returns after the work is accepted by the background queue, not after Graph confirms deletion. Set skipValidation: true to omit the preliminary lookup.

API at a glance

API What it does Result / important behavior
Create(...) Creates an enabled local account. Returns the Graph representation or throws when Graph supplies none.
Update(user) Patches the user identified by user.Id. Returns Graph's response body, which may be null.
Get(id) Retrieves one user with the common identity fields selected. null only for a not-found response; other failures propagate.
GetAll() Retrieves all users and follows pagination. Returns an empty list when Graph supplies no collection.
GetFirst() Requests one user. Graph ordering is not defined by this package.
GetByEmail(email) Filters mail, user principal name, and identity issuer-assigned ID. Returns the first match or null.
Delete(id, skipValidation) Optionally validates, then queues deletion. Completion means queued, not deleted.

Cancellation is forwarded to Graph requests and queue submission. It does not recall deletion work that has already begun in the background queue.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.789 46 10/23/2026
4.0.788 246 10/15/2026
4.0.787 89 10/15/2026
4.0.786 85 10/15/2026
4.0.785 89 10/15/2026
4.0.784 80 10/14/2026
4.0.780 79 10/14/2026
4.0.779 88 10/14/2026
4.0.770 83 10/13/2026
4.0.769 85 10/13/2026
4.0.765 88 10/12/2026
4.0.763 89 10/12/2026
4.0.762 98 10/11/2026
4.0.761 91 10/11/2026
4.0.760 95 10/11/2026
4.0.759 138 10/7/2026
4.0.758 200 10/1/2026
4.0.757 102 9/30/2026
4.0.756 104 9/29/2026
4.0.755 96 9/29/2026
Loading failed

Update dependency Soenneker.Extensions.String to 4.0.799 (#1318)