modify user's objectClass

Visual Studio244
I have a script that I want to use to modify a custom class and some

custom attributes.



Before modifying anything I check the user's objectClass for the

existance of the custom class. I then present an option to add the

class or remove it.



The functions are:

'=============================================

'Add an objectClass to an object

'=============================================

'

Function addClass(oUsr,strClass)

oUsr.PutEx ADS_PROPERTY_APPEND,"objectClass",Array(strClass)

oUsr.SetInfo

End Function



'=============================================

'Remove an objectClass from an object

'=============================================

'

Function removeClass(oUsr,strClass)

oUsr.PutEx ADS_PROPERTY_DELETE,"objectClass",Array("tmxCashier")

oUsr.SetInfo

End Function



Adding the class works fine, but when trying to delete it I get an

error: The specified directory service attribute or value does not

exist. Code 8007200A. Source (null). This same type of process works

great when applied to groups.



Any ideas? Thanks.


-