ComputerPrincipal 建構函式
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
初始化 ComputerPrincipal 類別的新執行個體。 Context 屬性必須在呼叫 Save()之前設定在物件上。
多載
| 名稱 | Description |
|---|---|
| ComputerPrincipal(PrincipalContext) |
初始化 ComputerPrincipal 類別的新實例,並將它指派給指定的內容。 |
| ComputerPrincipal(PrincipalContext, String, String, Boolean) |
使用指定的內容、SAM 帳戶名稱、密碼和啟用值,初始化 ComputerPrincipal 類別的新實例。 |
備註
電腦主帳戶在建立時不會被永久保存。 要持續保存帳號,請呼叫該 Save 方法。
ComputerPrincipal(PrincipalContext)
- 來源:
- Computer.cs
- 來源:
- Computer.cs
- 來源:
- Computer.cs
- 來源:
- 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)
- 來源:
- Computer.cs
- 來源:
- Computer.cs
- 來源:
- Computer.cs
- 來源:
- 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 方法。