What is COM/API support you ask?
Per Wiki: An application programming interface (API) is a set of functions, procedures, methods or classes that an operating system, library or service provides to support requests made by computer programs.
So what does this mean to you? This means you can now call UMRA scripts remotely through the COM, via a VB Script, Command line etc. However, I will show you some example of how I can use the UMRA COM library to access my projects and scripts.
If you haven’t already download the free trail version of User Management Resource Administrator here à Download
To view all the methods start UMRA and go to help, within the help menu type in COM. You will see tons of options on how to use the COM, however we will focus on a few of the UMRA COM methods. Below is an example of how to connect to a UMRA project via the “connect” method, and run a UMRA Script. For now we will not send any data to UMRA or get any data back.
*NOTE*
There is an example project in the UMRA default install folder, so look in your default install directory : C:\Program Files\Tools4ever\User Management Resource Administrator\Example Projects\Automation\ASP\CreateAccount
Here is the snippet of code with some comments to better understand what is going on.You can copy/paste this into a blank .asp page.
*VB SCRIPT*
'Create/Set Variables
Dim RetVal
Dim UMRA_Server
Dim UMRA_ Port
UMRA_Server = "MyServerName"
UMRA_Port = 56814
'End Create/Set Vairbales
Set Umra = Server.CreateObject("UMRAcom.Umra") ' Creates a new reference to the UMRACom DLL
RetVal=Umra.Connect(UMRA_Server,UMRA_Port) ' Use the "Connect" Method, it will take 2 paramaters UMRA_Server and UMRA_Port
RetVal=Umra.ExecuteProjectScript(UMRA_Project) ' Use the "ExecuteProjectScript Method, takes 1 paramater UMRA_Project.
Response.write "If the Return Value = 0 You are connected If the Return Value is not 0 you didn't connect
"
Response.write "Your Return Value is = " & RetVal
When you run this script, you will see a “Return Value” if the value = 0 You were able to connect to the UMRA Server, and Run the Project you created, if you get a number other then 0, there was an error along the way.
For now, this is the basics of how I connected to UMRA through the COM object.
I will post in a bit to show more advanced techniques.
0 comments:
Post a Comment