GetDirectoryEntry

Returns the directory entry for the computer object.

Syntax

DirectoryEntry GetDirectoryEntry ()

Return value

The DirectoryEntry attribute of the computer object.

Discussion

This method can only be used in .NET programs because DirectoryEntry is a .NET-specific class for directory objects. This method cannot be used in COM-based programs.

Example

The following code sample illustrates using GetDirectoryEntry for a computer object in a script:

...  
'Identify the computer account  
IComputer computer = cims.GetComputerByPath("LDAP://CN=sage,
CN=Computers,DC=arcade,DC=com");   
'Get the directory entry for the computer account  
DirectoryEntry computerEntry = computer.GetDirectoryEntry();   
'Rename the computer account  
computerEntry.Rename("CN=sagebrush");   
...