473,698 Members | 2,343 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

asp create mailbox question

Hello,

I've created an ASP web page where users in our organization can create
Active Directory computer accounts.

The web page is running on a Server 2003 SP1 IIS 6 installation. The
Exchange System Manager is running on the web server and Exchange SP2 has
been installed. The IIS site is configured with Basic Authentication and
users are prompted to enter their Active Directory credentials when
connecting to the site.

The web page uses ADSI code to create a user, and then CDO code to create
the mailbox e.g.

set oOU=GetObject(< LDAP string for OU>)
set oUser=oOU.Creat eUser("user",<C N for user>)
' set a bunch of attributes
' now create mailbox
set oMailbox=oUser
oMailbox.Create Mailbox <string representing MTA>

Now, when I connect to this site using my domain admin credentials, it
works. However, if a user connects to this site, after being prompted by
IIS' basic authentication for AD credentials, the user account is
successfully created in AD but upon reaching the "CreateMail box" line, I get

Microsoft VBScript runtime error '800a01b6'
Object doesn't support this property or method

Thinking that this was most likely a permissions issue, I took the .asp page
containing the code and converted it to a .vbs file. Then, I logged in as the
user account and used cscript to execute the .vbs file. Both the user account
and the mailbox were created succesfully.

I don't understand why the code runs under the context of a user account as
a vbs script, but doesn't run as an ASP page unless the user is a domain
admin. It's not permissions on AD or Exchange or the code wouldn't have run
as a vbs script. What is different about running it as an ASP page?

Thanks for any help you can provide me!

Michael Gibbons
Bellevue, WA

Jul 19 '06 #1
5 4868

"Michael" <Mi*****@discus sions.microsoft .comwrote in message
news:4C******** *************** ***********@mic rosoft.com...
Hello,

I've created an ASP web page where users in our organization can create
Active Directory computer accounts.

The web page is running on a Server 2003 SP1 IIS 6 installation. The
Exchange System Manager is running on the web server and Exchange SP2 has
been installed. The IIS site is configured with Basic Authentication and
users are prompted to enter their Active Directory credentials when
connecting to the site.

The web page uses ADSI code to create a user, and then CDO code to create
the mailbox e.g.

set oOU=GetObject(< LDAP string for OU>)
set oUser=oOU.Creat eUser("user",<C N for user>)
' set a bunch of attributes
' now create mailbox
set oMailbox=oUser
oMailbox.Create Mailbox <string representing MTA>

Now, when I connect to this site using my domain admin credentials, it
works. However, if a user connects to this site, after being prompted by
IIS' basic authentication for AD credentials, the user account is
successfully created in AD but upon reaching the "CreateMail box" line, I
get

Microsoft VBScript runtime error '800a01b6'
Object doesn't support this property or method

Thinking that this was most likely a permissions issue, I took the .asp
page
containing the code and converted it to a .vbs file. Then, I logged in as
the
user account and used cscript to execute the .vbs file. Both the user
account
and the mailbox were created succesfully.

I don't understand why the code runs under the context of a user account
as
a vbs script, but doesn't run as an ASP page unless the user is a domain
admin. It's not permissions on AD or Exchange or the code wouldn't have
run
as a vbs script. What is different about running it as an ASP page?
If you run it under IIS 6 the script is ran under the context of
NetworkService account, this is an account with very limited rights, for
instance, it is not allowed for this account, to utilize network resources.
Since Exchange is 'a network resource' the Network Service account is
'halted' as soon as you want to go over the borders of the Web Server!

It would be best to configure IIS, the application pool to run under an
account that has sufficient rights, or just to disable anonymous access.

--
compatible web farm Session replacement for Asp and Asp.Net
http://www.nieropwebconsult.nl/asp_session_manager.htm
Thanks for any help you can provide me!

Michael Gibbons
Bellevue, WA
Jul 20 '06 #2
I'm going to answer my own question, because I contacted MS-Premier for
support and got an answer.

The answer was, that although .vbs scripts can contain CDOEXM calls like
CreateMailbox, such a call in an ASP script is unsupported.

I was advised to create a COM+ object that included the create mailbox
functionality and call it from the ASP page.

Instead, what I will probably do is have two separate scripts, one which is
the existing ASP script that does everything but create the mailbox, and then
run a scheduled task on the web server that is a VBS script that looks for
accounts without mailboxes in a certain OU, creates the mailbox, and puts the
account in a "Finished Account" OU.

- Michael Gibbons

"Egbert Nierop (MVP for IIS)" wrote:
>
"Michael" <Mi*****@discus sions.microsoft .comwrote in message
news:4C******** *************** ***********@mic rosoft.com...
Hello,

I've created an ASP web page where users in our organization can create
Active Directory computer accounts.

The web page is running on a Server 2003 SP1 IIS 6 installation. The
Exchange System Manager is running on the web server and Exchange SP2 has
been installed. The IIS site is configured with Basic Authentication and
users are prompted to enter their Active Directory credentials when
connecting to the site.

The web page uses ADSI code to create a user, and then CDO code to create
the mailbox e.g.

set oOU=GetObject(< LDAP string for OU>)
set oUser=oOU.Creat eUser("user",<C N for user>)
' set a bunch of attributes
' now create mailbox
set oMailbox=oUser
oMailbox.Create Mailbox <string representing MTA>

Now, when I connect to this site using my domain admin credentials, it
works. However, if a user connects to this site, after being prompted by
IIS' basic authentication for AD credentials, the user account is
successfully created in AD but upon reaching the "CreateMail box" line, I
get

Microsoft VBScript runtime error '800a01b6'
Object doesn't support this property or method

Thinking that this was most likely a permissions issue, I took the .asp
page
containing the code and converted it to a .vbs file. Then, I logged in as
the
user account and used cscript to execute the .vbs file. Both the user
account
and the mailbox were created succesfully.

I don't understand why the code runs under the context of a user account
as
a vbs script, but doesn't run as an ASP page unless the user is a domain
admin. It's not permissions on AD or Exchange or the code wouldn't have
run
as a vbs script. What is different about running it as an ASP page?

If you run it under IIS 6 the script is ran under the context of
NetworkService account, this is an account with very limited rights, for
instance, it is not allowed for this account, to utilize network resources.
Since Exchange is 'a network resource' the Network Service account is
'halted' as soon as you want to go over the borders of the Web Server!

It would be best to configure IIS, the application pool to run under an
account that has sufficient rights, or just to disable anonymous access.

--
compatible web farm Session replacement for Asp and Asp.Net
http://www.nieropwebconsult.nl/asp_session_manager.htm
Thanks for any help you can provide me!

Michael Gibbons
Bellevue, WA

Jul 21 '06 #3

"Michael" <Mi*****@discus sions.microsoft .comwrote in message
news:97******** *************** ***********@mic rosoft.com...
I'm going to answer my own question, because I contacted MS-Premier for
support and got an answer.

The answer was, that although .vbs scripts can contain CDOEXM calls like
CreateMailbox, such a call in an ASP script is unsupported.

I was advised to create a COM+ object that included the create mailbox
functionality and call it from the ASP page.

Instead, what I will probably do is have two separate scripts, one which
is
the existing ASP script that does everything but create the mailbox, and
then
run a scheduled task on the web server that is a VBS script that looks for
accounts without mailboxes in a certain OU, creates the mailbox, and puts
the
account in a "Finished Account" OU.

- Michael Gibbons
That's exactly the same reason, inside COM+, you can create a process that
impersonates 'someone' with sufficient rights to use CDOEXM.

In theory it can be done through ASP, but not on anonymous pages.

Jul 29 '06 #4
Heloo Mr. Egbert Nierop, Mr. Michael Gibbons,

I am relatively new to .NET. I am trying to create a user in AD and a
corresponding email account in the exchange server from an ASP.NET, C#
application.

-----------------------------
I have the exact same problem wherein I am able to create a user but am
unable to create a mailbox for the user. I "WAS" using exchange 2000.

The error that I was getting is a class cast exception when I try to do
this:

DirectoryEntry user1 = new DirectoryEntry( path, username, password);
IMailboxStore mailbox;
//exception caused in the next line
mailbox = (IMailboxStore) (user1.NativeOb ject);

Exception Details: System.InvalidC astException: Specified cast is not
valid.

I have read that CDOEXM does not work in asp.net. Most of the
discussions suggest using a COM object. I do not know how to deal with
COM objects or how they work. I dont know if the above error is well
before the execution needs the CDOEXM specific alteration or if its
just someother error.
-----------------------------

Anyways, now I am at a stage where, I have a seperate domain setup just
to test this application and that runs WIN 2003 and Exchange 2003 SP 2.
I want to not be able to do the same here on the new domain.
1) Create a user in AD and
2) Create a corresponding Mailbox through a asp.net, C# application.

I am able to do the first task. Could any of you provide some code for
creating an email account through an asp.net application and show how
the COM object would be implemented in C# and used from the asp.net
application.

OR
I still have access to the previous environment. If something strikes
you looking at the exception that I was getting in the previous domain
and that can be fixed to create email accounts in the Exchange 2000,
that should be fine too.

I would be really thankful to you for any help provided. I have been
trying to complete this project for a really long time now.

Thanks a lot in advance.
Suman

"I was advised to create a COM+ object that included the create mailbox

functionality and call it from the ASP page. "

Egbert Nierop (MVP for IIS) wrote:
"Michael" <Mi*****@discus sions.microsoft .comwrote in message
news:97******** *************** ***********@mic rosoft.com...
I'm going to answer my own question, because I contacted MS-Premier for
support and got an answer.

The answer was, that although .vbs scripts can contain CDOEXM calls like
CreateMailbox, such a call in an ASP script is unsupported.

I was advised to create a COM+ object that included the create mailbox
functionality and call it from the ASP page.

Instead, what I will probably do is have two separate scripts, one which
is
the existing ASP script that does everything but create the mailbox, and
then
run a scheduled task on the web server that is a VBS script that looks for
accounts without mailboxes in a certain OU, creates the mailbox, and puts
the
account in a "Finished Account" OU.

- Michael Gibbons

That's exactly the same reason, inside COM+, you can create a process that
impersonates 'someone' with sufficient rights to use CDOEXM.

In theory it can be done through ASP, but not on anonymous pages.
Aug 15 '06 #5

Suman wrote:
Heloo Mr. Egbert Nierop, Mr. Michael Gibbons,

I am relatively new to .NET. I am trying to create a user in AD and a
corresponding email account in the exchange server from an ASP.NET, C#
application.
Three things: first, this group covers classic ASP. Dotnet is a
different technology and has it's own group:
microsoft.publi c.dotnetframewo rk.aspnet.

Second, you shouldn't append your question to an existing thread. When
you go to the other group, start a new thread for your question. That
will make it easier for other people with the same issue as you to find
your question and any answers when they search the archives.

Finally, it is always advisable to read some of the threads in a group
the first time you post to it. That way you can identify whether the
group you have chosen really is the right one for your subject matter.

--
Mike Brind

Aug 15 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3926
by: Sam | last post by:
Hi, I integrated the following programs in freebsd 5.4. phpldapadmin openldap 2.2_26 courier-imap courier-authlib courier-authdaemon cyrus-sasl2-saslauthd postfix
0
1283
by: David Stockwell | last post by:
Hi, After looking at http://docs.python.org/lib/module-mailbox.html I am a bit confused. The bottom of the page refers to some shortcut usage for getting a mail box import email import mailbox mbox = mailbox.UnixMailbox(fp, email.message_from_file)
4
2727
by: Ron Vecchi | last post by:
I a runnning w2k3 pop3 mail server that came with iis6. I would like to write an application that progammtically creates the new mailboxes in an already established mail domain. Does anyone know how I would access this funcationality? Thanks, Ron Vecchi
2
5358
by: Michael | last post by:
Hello, I've created an ASP web page where users in our organization can create Active Directory computer accounts. The web page is running on a Server 2003 SP1 IIS 6 installation. The Exchange System Manager is running on the web server and Exchange SP2 has been installed. The web page uses ADSI code to create a user, and then CDO code to create
2
2651
by: Abhi | last post by:
i need to create a user in web mail using dotnet coad by using webmailserver api ex: xxx is my webmail then i want to create to a user in that webmail xxx ex: yyy@xxx.com how i should do in dotnet code plz.... help me
0
2418
by: arjen1984 | last post by:
I want to create a mailbox-enabled mailbox. First i have used the toturial from microsoft: http://support.microsoft.com/kb/313114 Then my homeMDB string was incorrect. I saw an article , link: http://forums.asp.net/thread/952974.aspx This guy has the same problem as me. I still have that problem. Mine server is a local server, so i have nog second domain name, i think. This i my code of my homeMDB: try { CDOEXM.IMailboxStore...
0
1731
by: rage2001 | last post by:
I have a script (ASP) written which creates an account in AD, creates a folder on our file server and sets its permissions, and then creates a mailbox on the exchange server and sets its permissions... This script use to work fine, and it hasnt been used in 2 months (since we have had no new students since the end of the term). I have part of the script below. There is alot of code above this script which gets executed perfectly....
2
2014
by: tinnews | last post by:
I am trying to write a utility to remove empty maildir mailboxes. It sounds like this should be very simple but it's proving really difficult. I'm doing this on a Fedora 7 system with python 2.5. The first question is how to detect whether a directory is a maildir mailbox. The following code snippet *never* says that a directory is not a maildir:-
4
17670
by: pjblecha | last post by:
Hello all: I'm working on a non-web-based (darn it...) application that will be set up as a scheduled task on an Exchange server to run against a mailbox 2-3 times per day. What the app needs to do is read messages in the mailbox, then create appointment items based on filtering the subject line and parsing text from the message body (which will be in HTML format). I have old VBScript that will create the appointment items, set them to a...
0
8604
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9028
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8895
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8861
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7728
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4369
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2330
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.