|
UserInfoDefinePrivilegedAccount Method
|
Defines the credentials of a privileged domain account that can be used for impersonation prior to the
retrieval of user information from the Active Directory.
Namespace: GSF.IdentityAssembly: GSF.Core (in GSF.Core.dll) Version: 2.4.218-beta+101eee949414e414795e55a6e73d88938f0177b8
Syntax Public Sub DefinePrivilegedAccount (
domain As String,
username As String,
password As String
)
public:
void DefinePrivilegedAccount(
String^ domain,
String^ username,
String^ password
)
member DefinePrivilegedAccount :
domain : string *
username : string *
password : string -> unit
function DefinePrivilegedAccount(domain, username, password);
View SourceParameters
- domain String
- Domain of privileged domain user account.
- username String
- Username of privileged domain user account.
- password String
- Password of privileged domain user account.
Example
This example shows how to define the identity of the user to be used for retrieving information from Active Directory:
using System;
using GSF.Identity;
class Program
{
static void Main(string[] args)
{
using (UserInfo user = new UserInfo("XYZCorp\\johndoe"))
{
user.PersistSettings = true;
user.DefinePrivilegedAccount("XYZCorp", "admin", "Passw0rd");
Console.WriteLine(string.Format("First Name: {0}", user.FirstName));
Console.WriteLine(string.Format("Last Name: {0}", user.LastName));
Console.WriteLine(string.Format("Middle Initial: {0}", user.MiddleInitial));
Console.WriteLine(string.Format("Email Address: {0}", user.Email));
Console.WriteLine(string.Format("Telephone Number: {0}", user.Telephone));
}
Console.ReadLine();
}
}
See Also