IADsDomain Method: IsValid

IsValid
(
 ClassName  As String,
 RelativeName As String
) As VariantBool;

Parameters

[in] String ClassName
Class that can be the name of an object, e.g., User, Group or Computer.

[in] String RelativeName
Name of the actual object in the namespace, e.g., John is the RelativeName with ClassName User.

Description
Returns TRUE if RelativeName is a valid Name of the given ClassName type.

Remarks
Valid values for ClassName are User or Group.

Example

Dim DomainObject As IADsDomain
Set DomainObject = GetObject("NTDS://YourDomainName")
Debug.Print DomainObject.IsValid("User", "UserName")

 

See Also