<PackageReference Include="System.Security.Principal.Windows" Version="5.0.0-preview.4.20251.6" />

NTAccount

public sealed class NTAccount : IdentityReference
Represents a user or group account.
public NTAccount(string name)

Initializes a new instance of the NTAccount class by using the specified name.

public NTAccount(string domainName, string accountName)

Initializes a new instance of the NTAccount class by using the specified domain name and account name.

public static bool op_Equality(NTAccount left, NTAccount right)

Compares two NTAccount objects to determine whether they are equal. They are considered equal if they have the same canonical name representation as the one returned by the Value property or if they are both null.

public static bool op_Inequality(NTAccount left, NTAccount right)

Compares two NTAccount objects to determine whether they are not equal. They are considered not equal if they have different canonical name representations than the one returned by the Value property or if one of the objects is null and the other is not.