Freigeben über


IProfileService2::DeleteProfile Method

Use this method to delete the ProfileObject object specified by a primary key value and schema type. All properties associated with the profile are purged from the system.

HRESULT IProfileService::DeleteProfile(
  VARIANT sValue,
  BSTR bstrType
);
Sub DeleteProfile(
    sValue As Variant,
    strType As String
)

Parameters

  • sValue
    [C++]

    [in] A VARIANT that contains the primary key value.

    [Visual Basic]

    A Variant that contains the primary key value.

  • bstrType
    [C++]

    [in] A BSTR that contains the profile schema type.

    [Visual Basic]

    A String that contains the profile schema type.

Return Value

[C++]

This method returns an HRESULT indicating whether it completed successfully. See the Error Values section for more details.

[Visual Basic]

None.

Error Values

The Errors property stores the collection of errors encountered in the last Profiles resource operation. For more information, see IProfileService::get_Errors.

Remarks

If the DeleteProfile method is called because of an error in creating a new ProfileObject object, any error message produced should be ignored.

Use the DeleteProfileByKey method to delete a profile specified by a key member/value pair and schema type.

Call the Initialize method before you use this ProfileService method.

Warning

Care must be taken when deleting ProfileObject objects due to possible expression dependencies. See the ExpressionStore and ExpressionEval objects for details on expressions.

Example

' oProfileService is a Server ProfileService object.

oProfileService.DeleteProfile("Joeuser@microsoft.com", "UserObject")

See Also

Other Resources

ProfileService Object

IProfileService2::CreateProfile Method

IProfileService2::DeleteProfileByKey Method

ExpressionEval Object

ExpressionStore Object