Copy Account using Cognos SDk in C#

Hi Team,

We are creating a C# program using Cognos SDK which will Copy Account from one domain (domain A) to another domain (domain B). We can copy the account from one domain to another using SDK.

We are mainly focusing on three things while copying the user,

My Folder
Schedules
Roles
Out of which only My Folder got copied in to the domain B.

No Schedules has been copied.

With respect to Roles, if we visit the user profile in domain B, within his permission tab we can see the roles associated, but if you go to the capabilities that role doesn’t contain that user associated.

Example: user in domain A has “Cognos Consumer” role associated, if we copy this user from domain A to domain B then the user gets copied to the domain B. Then go to the user profile in domain B. Then go to permissions tab, here we can see the “Cognos Consumer” role present. But with in the Cognos Consumer, the user which we copied to the domain B will not appear.

Hi Prabha,
Thanks for your post and for the detail on what you have tried and the example of what you are seeing. Let’s run through your example and make sure I understand what you’re saying and what you are observing. You are trying to duplicate a user profile, including My Folders, schedules, and roles from one Cognos environment to another (e.g. Dev to Prod). You called these domains, but I am thinking this is what you mean (please correct me if I am wrong).

I think the key to this issue is that you are trying to copy the user’s role membership from one environment to another, but I don’t think you have that part quite right. The “Permissions” tab on a user profile does not list the user’s role membership. The “Permissions” tab on an account object lists who has permissions to view/modify/traverse the account object itself (which acts as a container in this case). What it sounds like is that you set the permissions for the user account in environment A to include the Consumers role and then duplicated the account object, including its permissions, to environment B. This won’t accomplish what you’re looking to accomplish, I think.

Let me demonstrate what I mean. Here, I have a simple user account whose permissions include access by the “Directory Administrators” role.

This seems to meet what you described as seeing a role on the user’s “Permissions” tab. Now, I go to the Directory Administrators role and click its “Members” tab.

The role in this environment is empty, or more particularly, it does not include the user account I showed earlier.

What you probably want to do has nothing to do with the permissions on the account object itself. Instead, you likely want to give the user in environment B the same role membership he had in environment A. That will require acting on the role objects in the target environment and not the account object itself. In short, what you want to do is query for the role using the SDK, including the role’s members property, modify the list of members to include the searchPath for your account object, and then save the role object back to Cognos.

That explanation is admittedly a bit high-level, but once you read this hopefully you’ll have a better understanding of how to proceed. Let me know whether or not this works for you!