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
- 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
- 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 该方法。