September 18, 2009

Using the AzMan Helper Classes VI

We have seen how to add a store,create an application, add an operation, add tasks, create roles, add application groups, and add users via SID or UPN to groups in AzMan using C#. All of these are available here.

Here is the sixth and final post regarding the usage of these helper classes:
public string[] GetApplicationGroupMemberNames(string storeUrl, string applicationName, string applicationGroupName)
{
IAzApplication app = ApplicationHelper.GetApplication(storeUrl, applicationName);
IAzApplicationGroup applicationGroup = ApplicationGroupHelper.GetApplicationGroup(app, applicationGroupName);
return ApplicationGroupHelper.GetApplicationGroupMemberNames(applicationGroup);
}


public bool IsApplicationGroupMemberNameExists(string storeUrl, string applicationName, string applicationGroupName, string memberName)
{
IAzApplication app = ApplicationHelper.GetApplication(storeUrl, applicationName);
IAzApplicationGroup applicationGroup = ApplicationGroupHelper.GetApplicationGroup(app, applicationGroupName);
return ApplicationGroupHelper.IsApplicationGroupMemberNameExists(applicationGroup, memberName);
}

//Get the SIDs
public string[] GetApplicationGroupMembers(string storeUrl, string applicationName, string applicationGroupName)
{
IAzApplication app = ApplicationHelper.GetApplication(storeUrl, applicationName);
IAzApplicationGroup applicationGroup = ApplicationGroupHelper.GetApplicationGroup(app, applicationGroupName);
return ApplicationGroupHelper.GetApplicationGroupMembers(applicationGroup);
}

public bool IsApplicationGroupMemberExists(string storeUrl, string applicationName, string applicationGroupName, string memberSID)
{
IAzApplication app = ApplicationHelper.GetApplication(storeUrl, applicationName);
IAzApplicationGroup applicationGroup = ApplicationGroupHelper.GetApplicationGroup(app, applicationGroupName);
return ApplicationGroupHelper.IsApplicationGroupMemberExists(applicationGroup, memberSID);
}


This concludes what is basically almost everything in AzMan via C#. In the upcoming weeks, I will move to show some more Active Directory code using C#.

No comments:

Post a Comment