UMRA - How To Connect To UMRA With ASP.NET
October 6th, 2010 / Send feedback » / by admin
(UMRA) - User Management Resource Administrator: Download || More Information
(ESSOM) - Enterprise Single Sign-On Manager: Download || More Information
(SSRPM) - Self Service Reset Password Management: Download || More Information
Other Solutions
Recently I've been getting a few question on how to connect to UMRA via ASP.NET. Now I did a post about a year back on this same topic, however, it was a copy/paste from my old blog and all the formatting some how got erased, so it's a bit hard to read. So... I've decided to walk you through how to get a basic connection to UMRA setup via ASP.NET.
UMRA Version: 10.5
OS Version: Server 2008 R2
IIS Version: IIS 7.0
Now, if you are reading this for the first time, and might be wondering "Why would i want to connect to UMRA with ASP.NET", then here goes..... We all know UMRA is great for Automation Synchronization project, and MASS Imports etc. However, have you ever wanted to delegate out some type of action to a user, or set of users, but not give the user base any type of elevated rights to Active Directory or other Systems? Well, if you answered yes, then this is exactly what you want to be doing. When you use UMRA as your "data layer" to both get and set data, you now have a way to connect to these other systems, without giving a user special rights to the system. For example, if you want to delegate out password resets to managers, or teachers, how will you do this? You know you don't want to give them rights to Active Directory, or other system tools. So now you can create a simple web page, that uses UMRA to search Active Directory, display some users, and give them the option to reset the password. Now, that example is the most simplest approach, but this can balloon out to many different delegated actions such as, group management, roster management, user management, you name it you can delegate it.
Ok so lets get down to it, below is a quick function to connect to UMRA and pull back a variable that was set within the UMRA project. Now before we start, you will need some web page editing software such as visual studio, or visual studio express. Once you have your editing software, create a new project, and then create a new reference to the UMRACom.dll. If you haven't already, you will also need to install UMRA on the machine you are developing on, or deploying your application to. Once UMRA is deployed create a simple Automation project, and setup the security on it to "everyone" (right click on project and go to properties)
Ok so lets go over this connection function above, so know exactly what is going on.
First think you will need to do is fill in the "my_domain", "my_domain_controller", and "umra_server_name" session options. Now, you can do these also in your web.config as application keys, but for this demo I've decided to keep it simple.
On the line that says Umra.Connect(Session.Contents("umra_server",55555) you will need to change 55555 to the default port you setup when UMRA.
Now with that out of the way, we can dig a bit deeper into the code. You will see after we do the Umra.Connect, we kick out a response to see what happened when we tried to connect to the UMRA Service. Here are a few RetVal codes that will come in handy.
0 = Everything Ok
1 = Something Wrong (Sometimes could be Cant Find Server Etc.)
5 = Access denied
The next line Umra.ExecuteProjectScript, you will need to change "your_umra_project_name" to your UMRA Automation Project you created above. You will also see the next line, also give you a kick out of what happened when we tried to connect to this project, this should also give you one of the codes above.
You will now see a few lines down Umra.GetVariableText, you will need to switch %your_test_umra_bvariable% to a variable you put in your project above, this way you can test to see if your function is pulling data out of UMRA. Next we have another kick out that will give you your RetVal.
And there you have it, a simple way to connect to UMRA via ASP.NET. Now this is a connection method at the most bare basic level, however this should get you started on your project, or functions your making. In later posts, I will show you how to connect to UMRA with ASP.NET and loop through a table of data.
As always if you have any questions or comments free free to post thanks!
Feedback awaiting moderation
This post has 26 feedbacks awaiting moderation...

