Creating an Application Object in Script

An authorization policy store contains authorization policy information for one or more applications. For each application that uses an authorization policy store, you must create an IAzApplication object and save it to a policy store.

The following example shows how to create an IAzApplication object that represents an application and how to add the IAzApplication object to the authorization policy store the application uses. The example assumes that there is an existing XML policy store named MyStore.xml in the root directory of drive C.

'  Create the AzAuthorizationStore object.
Dim AzManStore
Set AzManStore = CreateObject("AzRoles.AzAuthorizationStore")

'  Initialize the authorization store.
AzManStore.Initialize 2, "msxml://C:\MyStore.xml"

'  Create an application object in the store.
Dim expenseApp
Set expenseApp= AzManStore.CreateApplication("Expense")

'  Save changes to the store.
expenseApp.Submit