Soenneker.Graph.Users
4.0.785
Prefix Reserved
See the version list below for details.
dotnet add package Soenneker.Graph.Users --version 4.0.785
NuGet\Install-Package Soenneker.Graph.Users -Version 4.0.785
<PackageReference Include="Soenneker.Graph.Users" Version="4.0.785" />
<PackageVersion Include="Soenneker.Graph.Users" Version="4.0.785" />
<PackageReference Include="Soenneker.Graph.Users" />
paket add Soenneker.Graph.Users --version 4.0.785
#r "nuget: Soenneker.Graph.Users, 4.0.785"
#:package Soenneker.Graph.Users@4.0.785
#addin nuget:?package=Soenneker.Graph.Users&version=4.0.785
#tool nuget:?package=Soenneker.Graph.Users&version=4.0.785
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 | Versions 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. |
-
net10.0
- Kevlar (>= 1.3.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.13)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.13)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.13)
- Soenneker.Exceptions.Suite (>= 4.0.703)
- Soenneker.Extensions.Enumerable (>= 4.0.686)
- Soenneker.Extensions.String (>= 4.0.794)
- Soenneker.Graph.Client (>= 4.0.1800)
- Soenneker.Utils.BackgroundQueue (>= 4.0.2539)
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 |
Updated Multiple NuGet packages