ComputerPrincipal 构造函数 
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
初始化 ComputerPrincipal 类的新实例。 调用 Save() 之前,必须在对象上设置 Context 属性。
重载
| ComputerPrincipal(PrincipalContext) | 
						 初始化 ComputerPrincipal 类的新实例,并将其分配到指定上下文。  | 
        	
| ComputerPrincipal(PrincipalContext, String, String, Boolean) | 
						 使用指定的上下文、SAM 帐户名、密码和启用的值初始化 ComputerPrincipal 类的新实例。  | 
        	
注解
创建计算机主体帐户时,不会保留该帐户。 若要保留帐户,请调用 Save 方法。
ComputerPrincipal(PrincipalContext)
- Source:
 - Computer.cs
 
- Source:
 - Computer.cs
 
- Source:
 - Computer.cs
 
初始化 ComputerPrincipal 类的新实例,并将其分配到指定上下文。
public:
 ComputerPrincipal(System::DirectoryServices::AccountManagement::PrincipalContext ^ context);
	public ComputerPrincipal (System.DirectoryServices.AccountManagement.PrincipalContext context);
	new System.DirectoryServices.AccountManagement.ComputerPrincipal : System.DirectoryServices.AccountManagement.PrincipalContext -> System.DirectoryServices.AccountManagement.ComputerPrincipal
	Public Sub New (context As PrincipalContext)
	参数
- context
 - PrincipalContext
 
PrincipalContext,用于指定要对其执行操作的服务器或域。
注解
创建计算机主体帐户时,不会保留该帐户。 若要保存帐户,请调用 Save 方法。
适用于
ComputerPrincipal(PrincipalContext, String, String, Boolean)
- Source:
 - Computer.cs
 
- Source:
 - Computer.cs
 
- Source:
 - Computer.cs
 
使用指定的上下文、SAM 帐户名、密码和启用的值初始化 ComputerPrincipal 类的新实例。
public:
 ComputerPrincipal(System::DirectoryServices::AccountManagement::PrincipalContext ^ context, System::String ^ samAccountName, System::String ^ password, bool enabled);
	public ComputerPrincipal (System.DirectoryServices.AccountManagement.PrincipalContext context, string samAccountName, string password, bool enabled);
	new System.DirectoryServices.AccountManagement.ComputerPrincipal : System.DirectoryServices.AccountManagement.PrincipalContext * string * string * bool -> System.DirectoryServices.AccountManagement.ComputerPrincipal
	Public Sub New (context As PrincipalContext, samAccountName As String, password As String, enabled As Boolean)
	参数
- context
 - PrincipalContext
 
PrincipalContext,用于指定要对其执行操作的服务器或域。
- samAccountName
 - String
 
此计算机主体的 SAM 帐户名。
- password
 - String
 
此帐户的密码。
- enabled
 - Boolean
 
一个布尔值,指定是否启用帐户。
注解
创建计算机主体帐户时,不会保留该帐户。 若要保留帐户,请调用 Save 方法。