Public Member Functions | Static Public Member Functions | List of all members
AppSecInc::LSA::Account Class Reference

A user account. More...

#include <Account.h>

Public Member Functions

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

Static Public Member Functions

static std::wstring GetCurrentUserName ()
 get the current username More...
 
static std::wstring GetCurrentUserName (EXTENDED_NAME_FORMAT format)
 get the current username with extended format More...
 
static void Create (USER_INFO_1 ui, const std::wstring &servername=L"")
 create a local user More...
 
static void Create (const std::wstring &username, const std::wstring &password, const std::wstring &servername=L"")
 create a local user More...
 
static void Delete (const std::wstring &username, const std::wstring &servername=L"")
 delete a local user More...
 
static bool Exists (const std::wstring &username, const std::wstring &servername=L"")
 check whether the user exists More...
 
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 More...
 

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 ( USER_INFO_1  ui,
const std::wstring &  servername = L"" 
)
static

create a local user

void Account::Create ( const std::wstring &  username,
const std::wstring &  password,
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