Refresh

Reloads the Computer object data from the data in Active Directory.

Syntax

void Refresh()

Discussion

This method refreshes the computer properties in the cached object to ensure it is synchronized with the latest information in Active Directory.

Exceptions

Refresh may throw one of the following exceptions:

  • InvalidOperationException if the computer profile cannot be found. This usually indicates that the computer is not in a zone.
  • COMException if an LDAP error occurs. LDAP errors can occur if the connection to the LDAP server fails, the connection times out, invalid credentials are presented, or there are other problems communicating with Active Directory.

Example

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

...
set objZone = cims.GetZone("sierra.com/Performix/Zones/HongKong")
'Identify the computer account
Set objComp = cims.GetComputer("sierra.com/Performix/Computers/chu”) 
'Set a property and save the changes to the computer account
Set objComp.WebSphereEnabled = true
objComp.Commit
'Refresh the computer object and display the result
objComp.Refresh
wScript.Echo objComp.WebSphereEnabled
...