We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

User Account access through Admin account

Hi,
I’m trying to get access to user account through admin account so that i can create folder to user account (on office 365).Is it possible ?: if yes please send some sample code to do so…

thanx in advance

Aditya

@Mannu_rawat,

I have tried understanding your requirements and have not been able to completely understand them. Can you please elaborate and also share which Client you are using on your end. If possible, please provide a test account that we may use to fulfill requirements.

I am trying to achieve impersonation on admin account(using IEWSClient ) so to get access to user account .If you have any sample code regarding impersonation please share…

@Mannu_rawat,

I like to share that you can create folder if admin user has correct rights. The Code sample will be same like usual as given over this documentation link. The question is in user rights, but this question has to be addressed to Microsoft Documentation as it is beyond scope of Aspose.Email. I hope the shared elaboration will be helpful.

Sir,
I have a admin account in office 365 and using below code i have connected to admin account.

IEWSClient client = EWSClient.getEWSClient(“[https://outlook.office365.com/ews/exchange.asmx ](https://outlook.office365.com/ews/exchange.asmx)”, "admin@domain.com", “adminpassword”, “[domain.com](http://domain.com/)”);

In admin account I have created three users account manually and provided license to user account .
Now I want to get access to user account created under admin account using aspose.mail.
Feel free for any inquiry.

IEWSClient client = EWSClient.GetEWSClient(“https://outlook.office365.com/ews/exchange.asmx”, “testUser”, “pwd”, “domain”);

// Get Exchange mailbox info of other email account
ExchangeMailboxInfo mailboxInfo = client.GetMailboxInfo("otherUser@domain.com");

In this line of i am getting exception

Folder Id: ‘MSGFOLDERROOT’; Message: The specified object was not found in the store., The process failed to get the correct properties.
Folder Id: ‘CALENDAR’; Message: The specified folder could not be found in the store.
Folder Id: ‘CONTACTS’; Message: The specified folder could not be found in the store.
Folder Id: ‘DELETEDITEMS’; Message: The specified object was not found in the store., The process failed to get the correct properties.
Folder Id: ‘DRAFTS’; Message: The specified folder could not be found in the store.
Folder Id: ‘INBOX’; Message: The specified object was not found in the store., The process failed to get the correct properties.
Folder Id: ‘JOURNAL’; Message: The specified folder could not be found in the store.
Folder Id: ‘NOTES’; Message: The specified folder could not be found in the store.
Folder Id: ‘OUTBOX’; Message: The specified object was not found in the store., The process failed to get the correct properties.
Folder Id: ‘SENTITEMS’; Message: The specified object was not found in the store., The process failed to get the correct properties.
Folder Id: ‘TASKS’; Message: The specified folder could not be found in the store.
Folder Id: ‘JUNKEMAIL’; Message: The specified folder could not be found in the store.

@Mannu_rawat,

I have observed the details shared by you. In order to proceed further, we need to have account credentials on our end that we may test on our end to help you out. Without provision of requested information, we may not be able to proceed further.

sir,

Using EWS:
using admin login credential I am able to create “Test Folder” in user account (which is created under admin account)

ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010_SP2);
ExchangeCredentials credentials = new WebCredentials("admin@domain.com",“xyxpassword”);
service.setCredentials(credentials);

ImpersonatedUserId imper=new ImpersonatedUserId(ConnectingIdType.SmtpAddress,"user@domain.com");
service.setImpersonatedUserId(imper);
Folder newFolder = new Folder(service);
newFolder.setDisplayName(“Test Folder”);
newFolder.save(WellKnownFolderName.MsgFolderRoot);

using this code a folder is created under user account with name “Test Folder”.
In EWS I am able to set impersonated user through admin credential.

is this possible using aspose.mail jar if so then please provide me sample code using which uses aspose.mail jar 19.10 to do the same.

feel free to ask any question.

@Mannu_rawat,

Thank you for sharing feedback. As I previously shared with you that as far as Aspose.Email API is concerned there is no restriction on doing your desired action and sample code that is used is same as it’s already available in documentation. That’s why our team requested for test admin account credentials that they may use on their end to verify the issue further.

Please provide me email id so that i can provide admin account credentials .

@Mannu_rawat,

You can share the information here in this thread as this is private and only you and Aspose staff has access to it. Otherwise, you can send me via private message. All you need to do is to click my user name in my post and you will find option of Message. Use this option to send me message and share information. Please also share with me here if you share the information via private message.