Property | Type | Description | |
---|---|---|---|
Dispose | void | ||
GetNameElements | string[] | ||
ValidateGroupName | string |
Method | Description | |
---|---|---|
AddUserToLocalGroup ( string groupName, string userName ) : bool |
Adds an existing user to the specified local groupName. This function will handle Windows service virtual accounts by specifying the complete virtual account name, such as |
|
AuthenticateUser ( string domain, string userName, string password ) : IPrincipal |
Authenticates the specified user credentials. This method always returns |
|
AuthenticateUser ( string domain, string userName, string password, string &errorMessage ) : IPrincipal |
Authenticates the specified user credentials. This method always returns |
|
ChangePassword ( string oldPassword, string newPassword ) : void |
Attempts to change the user's password.
|
|
CreateLocalGroup ( string groupName, string groupDescription = null ) : bool |
Creates a new local group if it does not exist already.
|
|
CreateLocalUser ( string userName, string password, string userDescription = null ) : bool |
Creates a new local user if it does not exist already.
|
|
DefinePrivilegedAccount ( string domain, string username, string password ) : void |
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.
|
|
Dispose ( ) : void |
Releases all the resources used by the UserInfo object.
|
|
EndImpersonation ( System.Security.Principal.WindowsImpersonationContext impersonatedUser ) : void |
Ends the impersonation of the specified user.
|
|
GetBuiltInLocalGroups ( ) : string[] |
Returns a sorted list of the common built-in local groups. On Windows these groups have a domain name of BUILTIN. Names in this list will not have a "BUILTIN\" prefix. |
|
GetLocalGroupUserList ( string groupName ) : string[] |
Gets a list of users that exist in the specified local groupName.
|
|
GetUserPropertyValue ( string propertyName ) : string |
Returns the value for specified active directory property.
|
|
GroupNameToSID ( string groupName ) : string |
Converts the given group name to the SID corresponding to that name. If the groupName cannot be converted to a SID, groupName will be the return value. |
|
ImpersonatePrivilegedAccount ( ) : System.Security.Principal.WindowsImpersonationContext |
Impersonates the defined privileged domain account. This method always returns |
|
ImpersonateUser ( string domain, string userName, string password ) : System.Security.Principal.WindowsImpersonationContext |
Impersonates the specified user. After impersonating a user the code executes under the impersonated user's identity. This method always returns |
|
Initialize ( ) : void |
Initializes the UserInfo object.
|
|
IsGroupSID ( string sid ) : bool |
Determines whether the given security identifier identifies a group.
|
|
IsLocalDomain ( string domain ) : bool |
Determines if specified domain is the local domain (i.e., local machine).
|
|
IsUserSID ( string sid ) : bool |
Determines whether the given security identifier identifies a user account.
|
|
LoadSettings ( ) : void |
Loads saved settings for the UserInfo object from the config file if the PersistSettings property is set to true.
|
|
LocalGroupExists ( string groupName ) : bool |
Determines if local group exists.
|
|
LocalUserExists ( string userName ) : bool |
Determines if local user exists.
|
|
RemoveLocalGroup ( string groupName ) : bool |
Removes local group if it exists.
|
|
RemoveLocalUser ( string userName ) : bool |
Removes local user if it exists.
|
|
RemoveUserFromLocalGroup ( string groupName, string userName ) : bool |
Removes an existing user from the specified local groupName. This function will handle Windows service virtual accounts by specifying the complete virtual account name, such as |
|
SIDToAccountName ( string sid ) : string |
Converts the given SID to the corresponding account name. If the sid cannot be converted to an account name, sid will be the return value. |
|
SaveSettings ( ) : void |
Saves settings for the UserInfo object to the config file if the PersistSettings property is set to true.
|
|
SetLocalUserPassword ( string userName, string password ) : void |
Sets local user's password.
|
|
UserInfo ( string loginID ) : System |
Initializes a new instance of the UserInfo class.
|
|
UserInfo ( string loginID, string ldapPath ) : System |
Initializes a new instance of the UserInfo class.
|
|
UserIsInLocalGroup ( string groupName, string userName ) : bool |
Determines if user is in the specified local groupName. This function will handle Windows service virtual accounts by specifying the complete virtual account name, such as |
|
UserNameToSID ( string userName ) : string |
Converts the given user name to the SID corresponding to that name. If the userName cannot be converted to a SID, userName will be the return value. |
Method | Description | |
---|---|---|
Dispose ( bool disposing ) : void |
Releases the unmanaged resources used by the UserInfo object and optionally releases the managed resources.
|
|
GetNameElements ( string displayName ) : string[] | ||
ValidateGroupName ( string groupName ) : string |
public static AddUserToLocalGroup ( string groupName, string userName ) : bool | ||
groupName | string | Group name to add local user to. |
userName | string | Existing local user name. |
return | bool |
public static AuthenticateUser ( string domain, string userName, string password ) : IPrincipal | ||
domain | string | Domain of user to authenticate. |
userName | string | Username of user to authenticate. |
password | string | Password of user to authenticate. |
return | IPrincipal |
public static AuthenticateUser ( string domain, string userName, string password, string &errorMessage ) : IPrincipal | ||
domain | string | Domain of user to authenticate. |
userName | string | Username of user to authenticate. |
password | string | Password of user to authenticate. |
errorMessage | string | Error message returned, if authentication fails. |
return | IPrincipal |
public ChangePassword ( string oldPassword, string newPassword ) : void | ||
oldPassword | string | Old password. |
newPassword | string | New password. |
return | void |
public static CreateLocalGroup ( string groupName, string groupDescription = null ) : bool | ||
groupName | string | Group name to create if it doesn't exist. |
groupDescription | string | Optional group description. |
return | bool |
public static CreateLocalUser ( string userName, string password, string userDescription = null ) : bool | ||
userName | string | User name to create if it doesn't exist. |
password | string | Password to user for new user. |
userDescription | string | Optional user description. |
return | bool |
public DefinePrivilegedAccount ( string domain, string username, string password ) : void | ||
domain | string | Domain of privileged domain user account. |
username | string | Username of privileged domain user account. |
password | string | Password of privileged domain user account. |
return | void |
public static EndImpersonation ( System.Security.Principal.WindowsImpersonationContext impersonatedUser ) : void | ||
impersonatedUser | System.Security.Principal.WindowsImpersonationContext | |
return | void |
public static GetBuiltInLocalGroups ( ) : string[] | ||
return | string[] |
public static GetLocalGroupUserList ( string groupName ) : string[] | ||
groupName | string | Group name to remove local user from. |
return | string[] |
public GetUserPropertyValue ( string propertyName ) : string | ||
propertyName | string | Name of the active directory property whose value is to be retrieved. |
return | string |
public static GroupNameToSID ( string groupName ) : string | ||
groupName | string | The group name for which to look up the SID. |
return | string |
public ImpersonatePrivilegedAccount ( ) : System.Security.Principal.WindowsImpersonationContext | ||
return | System.Security.Principal.WindowsImpersonationContext |
public static ImpersonateUser ( string domain, string userName, string password ) : System.Security.Principal.WindowsImpersonationContext | ||
domain | string | Domain of user to impersonate. |
userName | string | Username of user to impersonate. |
password | string | Password of user to impersonate. |
return | System.Security.Principal.WindowsImpersonationContext |
public static IsGroupSID ( string sid ) : bool | ||
sid | string | The security identifier. |
return | bool |
public static IsLocalDomain ( string domain ) : bool | ||
domain | string | Domain name to check. |
return | bool |
public static IsUserSID ( string sid ) : bool | ||
sid | string | The security identifier. |
return | bool |
public static LocalGroupExists ( string groupName ) : bool | ||
groupName | string | Group name to test for existence. |
return | bool |
public static LocalUserExists ( string userName ) : bool | ||
userName | string | User name to test for existence. |
return | bool |
public static RemoveLocalGroup ( string groupName ) : bool | ||
groupName | string | Group name to remove if it exists. |
return | bool |
public static RemoveLocalUser ( string userName ) : bool | ||
userName | string | User name to remove if it exists. |
return | bool |
public static RemoveUserFromLocalGroup ( string groupName, string userName ) : bool | ||
groupName | string | Group name to remove local user from. |
userName | string | Existing local user name. |
return | bool |
public static SIDToAccountName ( string sid ) : string | ||
sid | string | The SID for which to look up the account name. |
return | string |
public static SetLocalUserPassword ( string userName, string password ) : void | ||
userName | string | User name to change password for. |
password | string | New password fro user. |
return | void |
public UserInfo ( string loginID ) : System | ||
loginID | string | /// Login ID in 'domain\username' format of the user's account whose information is to be retrieved. Login ID /// can also be specified in 'username' format without the domain name, in which case the domain name will be /// approximated based on the privileged user domain if specified, default logon domain of the host machine /// if available, or the domain of the identity that owns the host process. /// |
return | System |
public UserInfo ( string loginID, string ldapPath ) : System | ||
loginID | string | /// Login ID in 'domain\username' format of the user's account whose information is to be retrieved. Login ID /// can also be specified in 'username' format without the domain name, in which case the domain name will be /// approximated based on the privileged user domain if specified, default logon domain of the host machine /// if available, or the domain of the identity that owns the host process. /// |
ldapPath | string | /// String in 'LDAP://' format that specifies the Active Directory node where search for the user starts. /// |
return | System |
public static UserIsInLocalGroup ( string groupName, string userName ) : bool | ||
groupName | string | Group name to test. |
userName | string | User name to test. |
return | bool |
public static UserNameToSID ( string userName ) : string | ||
userName | string | The user name for which to look up the SID. |
return | string |