C# Class Org.IdentityConnectors.ActiveDirectory.ActiveDirectoryUtils

Collection of Active directory utilities. Some are static methods, other require configuration, so they are instance methods.
ファイルを表示 Open project: Evolveum/openicf Class Usage Examples

Public Methods

Method Description
ActiveDirectoryUtils ( ActiveDirectoryConfiguration configuration ) : System

Constructor

ComToIcfException ( System.DirectoryServices.DirectoryServicesCOMException originalException, String message ) : Exception

Converts a DirectoryServicesCOMException into more meaningful ICF exception (e.g. AlreadyExistsException).

ConvertADGUIDtoObjectGUID ( string uid ) : string
ConvertUIDBytesToSearchString ( Byte guidBytes ) : String

Converts a guid in byte array form to a string suitable for ldap search.

ConvertUIDToSearchString ( Uid uid ) : String
GetCnValueUnescaped ( String nameValue ) : String
GetDomainControllerName ( ActiveDirectoryConfiguration configuration ) : string
GetNameAsCN ( String nameValue ) : String

Returns the leaf value of a distinguished name

GetRelativeName ( Name name ) : String
GetSecureString ( String stringToSecure ) : SecureString
NormalizeLdapString ( String ldapString ) : String

Puts an ldap string into a normalilzed format

OtherComToIcfException ( System originalException, String message ) : Exception

Converts a System.Runtime.InteropServices.COMException into more meaningful ICF exception (e.g. AlreadyExistsException).

RandomStr ( ) : string

Private Methods

Method Description
AddConnectorAttributeToADProperties ( ObjectClass oclass, System.DirectoryServices.DirectoryEntry directoryEntry, ConnectorAttribute attribute, UpdateType type ) : void
ConvertBytesToADSpecialString ( string attribute, Byte bytes ) : String
ConvertSIDBytesToGUIDString ( Byte sidBytes ) : String
ConvertUIDBytesToGUIDString ( Byte guidBytes ) : String

Converts a guid in byte array form to a string with the format >GUID = xxxxxxxxxxxxxxxxxxxxxxxxxxxxx< where the x's represent uppercase hexadecimal digits

GetADObjectClass ( ObjectClass oclass ) : String

Returns the AD ObjectClass associated with a particular Connector ObjectClass

GetADSchema ( ) : System.DirectoryServices.ActiveDirectory.ActiveDirectorySchema
GetConnectorAttributeFromADEntry ( ObjectClass oclass, String attributeName, System.DirectoryServices searchResult, System.DirectoryServices.DirectoryEntry entry ) : ConnectorAttribute
GetDirectoryEntryFromUid ( String serverName, Uid uid, string adminUserName, string adminPassword ) : System.DirectoryServices.DirectoryEntry

Finds a DirectoryEntry by it's uid

GetDnFromPath ( string fullPath ) : string
GetDomainController ( ActiveDirectoryConfiguration configuration ) : System.DirectoryServices.ActiveDirectory.DomainController
GetFullPath ( string provider, string serverName, string path ) : String

Returns a path string in the format: provider://servernameIfSpecified/path

GetGCPath ( string serverName, string path ) : String

Returns a path string in the format: GC://servernameIfSpecified/path

GetLDAPPath ( string serverName, string path ) : String

Returns an ldap path in the form of: LDAP://servernameIfSpecified/path

GetLargeIntegerFromLong ( System.Int64 int64Value ) : LargeInteger
GetLongFromLargeInteger ( LargeInteger largeInteger ) : ulong
GetParentDn ( string childDn ) : string

Gets the dn of the parent object of the object specified by childDn

GetSingleValue ( System.DirectoryServices.PropertyValueCollection pvc ) : Object

Gets a single value from a propertyvaluecollection for a particular property name. Its an error if the property contains multiple values.

HandleNameAndContainerChange ( UpdateType type, System.DirectoryServices.DirectoryEntry directoryEntry, ICollection attributes, ActiveDirectoryConfiguration config ) : void

IsValidDn ( string dn ) : bool

Determines whether dn is a valid distinguished name.

A DN is valid if it can be processed by the AD API. This method does not test RFC 2253 compliance, but only basic syntactical check.

UpdateADObject ( ObjectClass oclass, System.DirectoryServices.DirectoryEntry directoryEntry, ICollection attributes, UpdateType type, ActiveDirectoryConfiguration config ) : void

Updates an AD object (also called by create after object is created)

getADSPathname ( string provider, string serverName, string path ) : IADsPathname

uses iadspathname to create paths in a standard way

Method Details

ActiveDirectoryUtils() public method

Constructor
public ActiveDirectoryUtils ( ActiveDirectoryConfiguration configuration ) : System
configuration ActiveDirectoryConfiguration /// Configuration object for the connector. ///
return System

ComToIcfException() public static method

Converts a DirectoryServicesCOMException into more meaningful ICF exception (e.g. AlreadyExistsException).
public static ComToIcfException ( System.DirectoryServices.DirectoryServicesCOMException originalException, String message ) : Exception
originalException System.DirectoryServices.DirectoryServicesCOMException
message String
return System.Exception

ConvertADGUIDtoObjectGUID() public static method

public static ConvertADGUIDtoObjectGUID ( string uid ) : string
uid string
return string

ConvertUIDBytesToSearchString() public static method

Converts a guid in byte array form to a string suitable for ldap search.
public static ConvertUIDBytesToSearchString ( Byte guidBytes ) : String
guidBytes Byte
return String

ConvertUIDToSearchString() public static method

public static ConvertUIDToSearchString ( Uid uid ) : String
uid Org.IdentityConnectors.Framework.Common.Objects.Uid
return String

GetCnValueUnescaped() public static method

public static GetCnValueUnescaped ( String nameValue ) : String
nameValue String
return String

GetDomainControllerName() public static method

public static GetDomainControllerName ( ActiveDirectoryConfiguration configuration ) : string
configuration ActiveDirectoryConfiguration
return string

GetNameAsCN() public static method

Returns the leaf value of a distinguished name
public static GetNameAsCN ( String nameValue ) : String
nameValue String
return String

GetRelativeName() public static method

public static GetRelativeName ( Name name ) : String
name Org.IdentityConnectors.Framework.Common.Objects.Name
return String

GetSecureString() public static method

public static GetSecureString ( String stringToSecure ) : SecureString
stringToSecure String
return System.Security.SecureString

NormalizeLdapString() public static method

Puts an ldap string into a normalilzed format
public static NormalizeLdapString ( String ldapString ) : String
ldapString String
return String

OtherComToIcfException() public static method

Converts a System.Runtime.InteropServices.COMException into more meaningful ICF exception (e.g. AlreadyExistsException).
public static OtherComToIcfException ( System originalException, String message ) : Exception
originalException System
message String
return System.Exception

RandomStr() public static method

public static RandomStr ( ) : string
return string