GetObject
(
Class As String,
RelativeName As String
) As IADs;
Parameters
[in] String Class
Class that is the name of an object in DirectScript, e.g., "User",
"Group" or "Computer". Possible values for the respective
containers are specified below.
Computer Container |
"User", "Group", "PrintQueue" and "Service" |
Domain Container |
"User", "Group", "Computer" and "PrintQueue" |
File Container |
"File" and "Directory" |
RegistryKey Container |
"RegKey" and "RegValue" |
[in] String RelativeName
Name of an actual object in the namespace, e.g., John is the
RelativeName with Class "User".
Description
Returns the object in the container identified by the object's
Class and RelativeName (this is the value of the object's
IADs::Name property).
Return Values
Requested ADs object:
Computer Container |
IADsComputer |
Domain Container |
IADsDomain |
File Container |
IFile |
RegistryKey Container |
IRegistryKey |
Example
Dim ContainerObject As IADsContainer
Dim UserObject As IADsUser
Set ContainerObject = GetObject("NTDS://YourDomainName")
Set UserObject = ContainerObject.GetObject("User", "UserName")
Debug.Print UserObject.AdsPath
See Also