Application

Gets or sets the PAM application for which this is a right.

Syntax

string Application {get; set;}

Property value

The file path of the application.

Exceptions

Application throws an ArgumentException if you try to set the property and the string is null or empty.

Example

The following code sample illustrates using Application in a script:

...  
string strParent = "CN=zones,CN=Centrify,CN=Program Data";  
if (args.Length != 3)  
{  
    Console.WriteLine("Usage:");  
    Console.WriteLine(" test_add_pam.exe \\"zone-name\\" \\"pam-name\\"
        \\"pam-application\\"");  
    return;  
}  
string strZone = args[0];  
string strName = args[1];  
string strApp = args[2];  
// Need to obtain an active directory container object
DirectoryEntry objRootDSE = new DirectoryEntry("LDAP://rootDSE");  
DirectoryEntry objContainer = new DirectoryEntry("LDAP://" + strParent + "," +  
objRootDSE.Properties["defaultNamingContext"].Value.ToString());  
string strContainerDN = objContainer.Properties["DistinguishedName"].Value as
string;  
// Create a CIMS object to interact with AD 
ICims cims = new Cims();  
// Get the zone object 
IHierarchicalZone objZone =  
cims.GetZoneByPath("cn=" + strZone + "," + strContainerDN) as IHierarchicalZone;

if (objZone == null)  
{  
    Console.WriteLine("Zone " + strZone + " does not exist.");  
}  
else  
{  
    IPam objPam = objZone.GetPamAccess(strName);  
    if (objPam != null)  
    {  
        Console.WriteLine("PAM " + strName + " already exist.");  
    }  
    else  
    {  
        objPam = objZone.CreatePamAccess();  
        objPam.Name = strName;  
        objPam.Application = strApp;  
        objPam.Description = "optional description";  
        objPam.Commit();  
    }  
}  
...