• 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#: SPML Creating an user
  • 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

You are currently reviewing an older revision of this page.

  • History View current version

C#: SPML Creating an user

Back to SPML provider

Steps to reproduce the sample.

1. Install SPML provider (ARS-CD:\Solutions\Free Tools\ADSI Provider) to a computer with IIS.

2. Ensure it works. Open url "http://<computer_host>/ARServerSPML/SPMLProvider.asmx". It looks like

3. Create a C# console project.

4. "Add Service Reference...", put url from point 2, and rename the reference to "ArsSPML".

5. Open a file "Program.cs" and put this code.

6. Run the project.

DESCRIPTION

This C# sample code demonstrates how to create a user account by ARS SPML provider.


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 MERCHANTBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.

//

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

// PLEASE CONTACT QUEST PROFESSIONAL SERVICES.

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

//

// This code is published on the ActiveRoles Script Center:

// http://communities.quest.com/docs/DOC-9991

//

// This code may use interfaces from ActiveRoles Server ADSI Provider Type Library

//

// Please, follow the link to obtain instructions and code for those functions.

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

using System;

using System.Collections.Generic;

using SampleAppl.ArsSPML;

namespace SampleAppl

{

class Program

{

static void Main(string[] args)

{

//-- Create request object

CAddRequest addRequest = new CAddRequest();

CPSOID containerForUser = new CPSOID();

containerForUser.ID = "OU=Baggins,DC=shire,DC=middle-earth,DC=com";

addRequest.containerID = containerForUser;

addRequest.returnData = "everything";

addRequest.targetID = "";

CPSOID ID = new CPSOID();

ID.ID = "";

addRequest.psoID = ID;

List<attr> attributes = new List<attr>();

attributes.Add(CreateAttribute("cn", new object[] { "Frodo Baggins" }));

attributes.Add(CreateAttribute("description", new object[] { "He has a quest." }));

attributes.Add(CreateAttribute("sAMAccountName", new object[] { "fbaggins" }));

attributes.Add(CreateAttribute("objectClass", new object[] { "user" }));

attributes.Add(CreateAttribute("edsaPassword", new object[] { "SauronMustDie!" }));

addRequest.data = attributes.ToArray();

//-- Create web service instance

ActiveRolesSPMLProviderSoapClient webService = new ActiveRolesSPMLProviderSoapClient();

//-- Send request and get response

CAddResponse myresponse = webService.add(addRequest);

//-- Show error info

if (!String.IsNullOrEmpty(myresponse.errorMessage))

Console.WriteLine(myresponse.errorMessage);

}

static attr CreateAttribute(string name, object[] values)

{

attr attribute = new attr();

attribute.name = name;

attribute.value = values;

return attribute;

}

}

}

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

COMPATIBILITY

Code compatible with the following version(s): ARS 6.5.0

Back to SPML provider

  • 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