Public Member Functions | Static Public Member Functions

AppSecInc::LSA::Account Class Reference

A user account. More...

#include <Account.h>

List of all members.

Public Member Functions

 Account ()
Accountoperator= (const Account &)
 copy
void LookupAccount (const std::wstring &account_name, const std::wstring &computer_name=L"")
 lookup an account by name
void LookupSid (PSID psid, const std::wstring &computer_name=L"")
 lookup an account by SID
const SidGetSid () const
 SID.
void SetSID (const Sid &sid)
 set SID
void SetFQN (const std::wstring &fqn)
 set FQN (username, domain\username or username@domain)
std::wstring GetFQN () const
 fully qualified name
const std::wstring & GetUserName () const
 username
const std::wstring & GetDomain () const
 computer or domain name
void GetUserRights (std::vector< std::wstring > &rights, const std::wstring &computername=L"") const
 get a list of user rights
void AddUserRight (const std::wstring &right, const std::wstring &computername=L"")
 add a user right
void RemoveUserRight (const std::wstring &right, const std::wstring &computername=L"")
 revoke a user right

Static Public Member Functions

static std::wstring GetCurrentUserName ()
 get the current username
static std::wstring GetCurrentUserName (EXTENDED_NAME_FORMAT format)
 get the current username with extended format
static void Create (USER_INFO_1 ui, const std::wstring &servername=L"")
 create a local user
static void Create (const std::wstring &username, const std::wstring &password, const std::wstring &servername=L"")
 create a local user
static void Delete (const std::wstring &username, const std::wstring &servername=L"")
 delete a local user
static bool Exists (const std::wstring &username, const std::wstring &servername=L"")
 check whether the user exists
static std::wstring Translate (const std::wstring &name, EXTENDED_NAME_FORMAT from, EXTENDED_NAME_FORMAT to)
 converts a directory service object name from one format to another

Detailed Description

A user account.


Constructor & Destructor Documentation

Account::Account ( )

Member Function Documentation

void Account::AddUserRight ( const std::wstring &  right,
const std::wstring &  computername = L"" 
)

add a user right

void Account::Create ( const std::wstring &  username,
const std::wstring &  password,
const std::wstring &  servername = L"" 
) [static]

create a local user

void Account::Create ( USER_INFO_1  ui,
const std::wstring &  servername = L"" 
) [static]

create a local user

void Account::Delete ( const std::wstring &  username,
const std::wstring &  servername = L"" 
) [static]

delete a local user

bool Account::Exists ( const std::wstring &  username,
const std::wstring &  servername = L"" 
) [static]

check whether the user exists

std::wstring Account::GetCurrentUserName ( ) [static]

get the current username

std::wstring Account::GetCurrentUserName ( EXTENDED_NAME_FORMAT  format) [static]

get the current username with extended format

const std::wstring& AppSecInc::LSA::Account::GetDomain ( ) const [inline]

computer or domain name

std::wstring AppSecInc::LSA::Account::GetFQN ( ) const [inline]

fully qualified name

const Sid& AppSecInc::LSA::Account::GetSid ( ) const [inline]

SID.

const std::wstring& AppSecInc::LSA::Account::GetUserName ( ) const [inline]

username

void Account::GetUserRights ( std::vector< std::wstring > &  rights,
const std::wstring &  computername = L"" 
) const

get a list of user rights

void Account::LookupAccount ( const std::wstring &  account_name,
const std::wstring &  computer_name = L"" 
)

lookup an account by name

void Account::LookupSid ( PSID  psid,
const std::wstring &  computer_name = L"" 
)

lookup an account by SID

Account & Account::operator= ( const Account rhs)

copy

void Account::RemoveUserRight ( const std::wstring &  right,
const std::wstring &  computername = L"" 
)

revoke a user right

void Account::SetFQN ( const std::wstring &  fqn)

set FQN (username, domain\username or username@domain)

void AppSecInc::LSA::Account::SetSID ( const Sid sid) [inline]

set SID

std::wstring Account::Translate ( const std::wstring &  name,
EXTENDED_NAME_FORMAT  from,
EXTENDED_NAME_FORMAT  to 
) [static]

converts a directory service object name from one format to another


The documentation for this class was generated from the following files:


© Application Security Inc. - All Rights Reserved http://msiext.codeplex.com