ComputerPrincipal Constructor (PrincipalContext, String, String, Boolean)

 

Initializes a new instance of the ComputerPrincipal class by using the specified context, SAM account name, password, and enabled value.

Namespace:   System.DirectoryServices.AccountManagement
Assembly:  System.DirectoryServices.AccountManagement (in System.DirectoryServices.AccountManagement.dll)

public ComputerPrincipal(
	PrincipalContext context,
	string samAccountName,
	string password,
	bool enabled
)

Parameters

context
Type: System.DirectoryServices.AccountManagement.PrincipalContext

The T:System.DirectoryService.AccountManagement.PrincipalContext that specifies the server or domain against which operations are performed.

samAccountName
Type: System.String

The SAM account name for this computer principal.

password
Type: System.String

The password for this account.

enabled
Type: System.Boolean

A Boolean value that specifies whether the account is enabled.

The computer principal account is not persisted when it is created. To persist the account, call the Save method.

.NET Framework
Available since 3.5
Return to top
Show: