• Products
    • View all products
    • Free trials
  • Solutions
    • All Solutions
    • All Integrations
  • Resources
    • All Resources
    • Learning Hub
  • Trials
  • Support
    • Support Home
    • By Product
      • All Products
      • Active Roles
      • Authentication Services
      • Cloud Access Manager
      • Defender
      • Identity Manager
      • Password Manager
      • Safeguard
      • Starling Identity Analytics & Risk Intelligence
      • Starling Two-Factor Authentication
      • TPAM Appliance
    • Contact Support
      • Overview
      • Customer Service
      • Licensing Assistance
      • Renewal Assistance
      • Technical Support
    • Download Software
    • Knowledge Base
    • My Account
      • My Products
      • My Service Requests
      • My Licenses
      • My Groups
      • My Profile
    • Policies & Procedures
    • Professional Services
    • Technical Documentation
    • One Identity University
    • User Forums
    • Video Tutorials
  • Partners
    • Overview
    • Partner Circle Log In
    • Become a Partner
    • Find a Partner
    • Partner Community
  • Communities
    • Home
    • Blogs
      • Blogs A to Z
      • One Identity Community
      • AD Account Lifecycle Management
      • Cloud
      • Identity Governance & Administration
      • Privileged Access Management
      • syslog-ng Community
    • Forums
      • All Product Forums
      • Active Roles
      • Identity Manager
      • Password Manager
      • Safeguard
      • Unix Access Management
    • Social Networks
      • Facebook
      • LinkedIn
      • Twitter
      • YouTube
One Identity Community
One Identity Community
  • Site
  • User
  • Site
  • Search
  • User
Active Roles Community
Active Roles Community
Wiki C#: Approval-aware modify operation
  • Forum
  • Ideas
  • Wiki
  • More
  • Cancel
  • New
  • -Active Roles Script Center
    • +Active Roles Script Policy Best Practices
    • Active Roles SDK
    • -C#
      • -C# samples
        • C#: Approval-aware modify operation
        • C#: SPML Creating an user
        • C#: SPML Search example
    • +JavaScript
    • +PowerShell
    • +VBScript

C#: Approval-aware modify operation

DESCRIPTION

This C# sample code demonstrates how to issue an approval-aware modify operation.


Note This code may use interfaces from ActiveRoles Server ADSI Provider Type Library (EDMLib). Please, add a reference to to the ActiveRoles Server ADSI Provider Type Library (EDMLib) to your C# project.


CODE

//*********************************************************************************

//THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,

//EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED

//WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.

//IF YOU WANT THIS FUNCTIONALITY TO BE CONDITIONALLY SUPPORTED,

//PLEASE CONTACT ONE IDENTITY PROFESSIONAL SERVICES.

//*********************************************************************************

 

//----- bind to AD object -----

DirectoryEntry deUser = new DirectoryEntry("EDMS://CN=John Smith,OU=Sales,DC=foocompany,DC=com");

deUser.Properties["description"].Value = "senior manager";

//----- set the control AllowApproval to check if an approval is required -----

(deUser.NativeObject as IEDM).set_Control("AllowApproval", true, "Check");

//----- try to perform ------

deUser.CommitChanges();

//----- verify if this operation requires an approval -----

if ("Pending" == ((deUser.NativeObject as IEDM).get_Control("OperationStatus", true) as string))

{

//----- set the control AllowApproval to send the operation for approval -----

(deUser.NativeObject as IEDM).set_Control("AllowApproval", true, "Confirm");

//----- set the control OperationReason with details about the approval request -----

(deUser.NativeObject as IEDM).set_Control("OperationReason", true, "some reason that will be shown approver");

//----- try to perform AGAIN ------

deUser.CommitChanges();

}

//***** END OF CODE **************************************************************

  • Script Center: C#
  • Script Center
  • Share
  • History
  • More
  • Cancel
Related
Recommended
  • Company
    • About Us
    • Buy
    • Careers
    • Contact Us
    • News
  • Resources
    • Blogs
    • Customer Stories
    • Documents
    • Events
    • Videos
  • Support
    • Professional Services
    • Renew Support
    • Technical Support
    • One Identity University
    • Support Service
  • Social Networks
    • Facebook
    • Instagram
    • LinkedIn
    • Twitter
    • YouTube
  • © 2025 One Identity LLC. ALL RIGHTS RESERVED.
  • Legal
  • Terms of Use
  • Privacy
  • Community Feedback & Support
  • Cookie Preference Center