By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,660 Members | 1,593 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,660 IT Pros & Developers. It's quick & easy.

How to Create exchange mailbox with non admin rights

P: 1
I have asp code create AD user and then adding exchange mailbox running with user rights logon. Creating user was OK, but I can not create mailbox for that user with user rights. Here is the code:
Expand|Select|Wrap|Line Numbers
  1. <% 
  2. strOU ="LDAP:// ou=IT,dc=MyDomain,dc=com "
  3. Set objNamespace = GetObject("LDAP: ")
  4. Set objOU= objNamespace.OpenDSObject(strOU,"administrator", "Password",1)
  5. Set objUser = objOU.Create("User" , "cn=MyName" )
  6. objUser.sAMAccountName = "myusername"
  7. objUser.givenName = "FirstName”
  8. objUser.sn = "Lastname”
  9. objuser.displayname="My DisplayName”
  10. objuser.UserPrincipalName="myusername@MyDomain.com"
  11.  
  12. strUSR ="LDAP:// ou=IT,dc=MyDomain,dc=com "
  13. Set objUSR=GetObject(strUSR)
  14. strServer = "Servername" 
  15. strExchangeOrg = "First Organization" 
  16. strDomain = "dc=MyDomain,dc=com " 
  17. strAdminGroup = "First Administrative Group"
  18. strStorageGroup = "First Storage Group"
  19. strStoreName = "Mailbox Store (" & strServer & ")"
  20. strMailbox = strMailbox & "CN=" & strStoreName
  21. strMailbox = strMailbox & ",CN=" & strStorageGroup
  22. strMailbox = strMailbox & ",CN=InformationStore"
  23. strMailbox = strMailbox & ",CN=" & strServer
  24. strMailbox = strMailbox & ",CN=Servers"
  25. strMailbox = strMailbox & ",CN=" & strAdminGroup
  26. strMailbox = strMailbox & ",CN=Administrative Groups"
  27. strMailbox = strMailbox & ",CN=" & strExchangeOrg
  28. strMailbox = strMailbox & ",CN=Microsoft Exchange"
  29. strMailbox = strMailbox & ",CN=Services"
  30. strMailbox = strMailbox & ",CN=Configuration"
  31. strMailbox = strMailbox & "," & strDomain
  32. objUSR.CreateMailbox strMailbox
  33. objUSR.SetInfo
  34. %>
I need your help. Thank you!
Apr 19 '11 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.