cancel
Showing results for 
Search instead for 
Did you mean: 

EV Content Management API 2007, enumerating archives user is allowed to access

dean_kavicki
Not applicable
Hi, I'm having a weird problem when using Content Management API 2007 to enumerate vaults particular user is allowed to search. My code works if I run it from command line app or using ASP.NET Development Server but it does not in the real scenario when running under IIS.
Nothing crashes, I'm just always getting zero archives (although archives I am allowed to access exist in my server).
My app is a simple ASP.NET C# app. I'm impersonating a user using LogonUser() and DuplicateToken() and Impersonate() calls. I thought this may be the problem so I tried the other way using <identity impersonate="true"/> in my web.config, but I got the same results.
Here is my code snippet:
-----------------
        IContentManagementAPI2 CMAPI = (IContentManagementAPI2)new ContentManagementAPIClass();
        IArchives archives1 = (IArchives)CMAPI.Archives;
        archives1.Computer = sevServer;
        archives1.Permissions = EV_STG_API_PERMISSIONS_TYPE.PERMISSIONS_SEARCH;
        archives1.ArchiveTypes = (int)(EV_STG_API_ARCHIVE_TYPE.ARCHIVE_TYPE_MAILBOX |
                                EV_STG_API_ARCHIVE_TYPE.ARCHIVE_TYPE_SHARED |
                                EV_STG_API_ARCHIVE_TYPE.ARCHIVE_TYPE_FILE_SYSTEM |
                                EV_STG_API_ARCHIVE_TYPE.ARCHIVE_TYPE_PUBLIC_FOLDER);
        archives1.Get();
        int lCount = archives1.Count;
-------------------
and my lCount is always zero.
If I remove the line: archives1.Permissions = EV_STG_API_PERMISSIONS_TYPE.PERMISSIONS_SEARCH;
or set it to archives1.Permissions = EV_STG_API_PERMISSIONS_TYPE.PERMISSIONS_UNSPECIFIED;

then I get all the archives that exist on my server. So this leads me to the conclusion that SEV API is not, for some reason picking up the right credentials, however I have checked in the code and confirmed that my impersonation code works and that the user executing the enumeration code is the right one.

If anyone there has a clue what might be wrong, I'd really appreciate. This problem is giving me quite a bit of headache :)
Just one more thing regarding the impersonation. I also have an old Sev 6 server and the same impersonation code is working alright with an old SEV 6 Content Management API method EnumVaultsByMe

Thanks


2 REPLIES 2

SL_THOMAS
Level 2

What does your impersonation code look like?

 

Have you defined the account you are using the Content Management API with the correct EV permissions, i.e. using the EV authoriziation manager?

Steve_C_Blair
Level 4
Employee

Hi Dean,

 

I am guessing (!?!?) that you are a partner trying to integrate to EV your application based on what you are doing. If so you should probably ask this type of question into the EV STEP (Symantec Technology Partner Programme) suport channel for assistance. They specialise and are included in the API / SDK costs to do support for things such as this.

 

You may well have missed a step, but they should be able to help you out.