Hello all, I have been on a quest to setup email accounts through the code behind on one of my asp.net pages. I am using the process class to call the command line that creates the user:
"c:\windows\sys tem32\winpop.ex e add user@domain.com /CREATEUSER password"
I do not get an error on screen, but the account is never created and i get an error in my event viewer:
"Applicatio n popup: winpop.exe - Application Error : The application failed to initialize properly (0xc0000142). Click on OK to terminate the application."
This is the code I am using right now: - Process proc = new Process();
-
System.Security.SecureString ss = new System.Security.SecureString();
-
ss.AppendChar('P');
-
ss.AppendChar('A');
-
ss.AppendChar('S');
-
ss.AppendChar('S');
-
ss.AppendChar('W');
-
ss.AppendChar('O');
-
ss.AppendChar('R');
-
ss.AppendChar('D');
-
proc.StartInfo.FileName = @"C:\windows\system32\winpop.exe";
-
proc.StartInfo.Arguments = "add user@domain.com /CREATEUSER password";
-
proc.StartInfo.UserName = "USERNAME";
-
proc.StartInfo.Password = ss;
-
proc.StartInfo.UseShellExecute = false;
-
proc.StartInfo.RedirectStandardOutput = true;
-
proc.Start();
When I attempt to read the output it just hangs my script.. I would appreciate any pointers anyone might have!
Jason
4 3557
Please, if somebody has any insight, please help!
I think my issue might have soemthing to do with passing the user name and password into the process..it only seems to lock if i do that. Of course if I dont pass it, I get access denied.
I have tried running a dir with the process which works great with no auth, but when I add the user/pass it crashes.
I would appreciate some help!
Thanks in advance,
Jason
OK, using this VB code: - Dim oConfig, oUsers
-
oConfig = System.Web.HttpContext.Current.Server.CreateObject("P3Admin.P3Config")
-
oUsers = oConfig.Domains.Item(domain).Users
-
Call oUsers.AddEx(user, password)
It adds the user as expected, however I cannot get the c# equivelent of the code to function. And when i compile this into a vb class dll and use it in my c# I get a parameter error....this is very frustrating!
Bump....
....
....
.....
....
Hello! I've started to use P3AdminLib now, and I only can list users, I couldn't create and delete mailboxes yet, keeps giving me "access denied". My C# code is the following:
public static DataTable getMailboxes()
{
DataTable dt = new DataTable("Mail boxes");
DataRow dr;
dt.Columns.Add( "Mailbox");
dt.Columns.Add( "DiskUsage" );
dt.Columns.Add( "Messages") ;
int plFactor = 0;
double usage = 0.0;
try
{
P3ADMINLib.P3Co nfig P3 = new P3ADMINLib.P3Co nfig();
P3ADMINLib.P3Do main domain = P3.Domains.get_ Item(0);
P3ADMINLib.P3Us ers users = domain.Users;
foreach (P3ADMINLib.P3U ser user in users)
{
dr = dt.NewRow();
dr["Mailbox"] = user.EmailName;
usage = Math.Round((dou ble)(user.get_M essageDiskUsage (out plFactor)) / 1024.0);
dr["DiskUsage"] = usage.ToString( )+"KB";
dr["Messages"] = user.MessageCou nt;
dt.Rows.Add(dr) ;
}
}
catch (Exception exc)
{
LogRegister.Log Register log = new LogRegister.Log Register("Utils .cs", exc.Message, new StackTrace(0, true).GetFrame( 0).GetMethod(). Name, "System", true);
return dt;
}
return dt;
}
public static bool createMailbox(s tring Mailbox)
{
bool created = false;
try
{
P3ADMINLib.P3Co nfig P3 = new P3ADMINLib.P3Co nfig();
P3ADMINLib.P3Do main domain = P3.Domains.get_ Item(0);
domain.Users.Ad d(Mailbox);
created = true;
}
catch (Exception exc)
{
LogRegister.Log Register log = new LogRegister.Log Register("Utils .cs", exc.Message, new StackTrace(0, true).GetFrame( 0).GetMethod(). Name, "System", true);
}
return created;
}
public static bool deleteMailbox(s tring Mailbox)
{
bool deleted = false;
try
{
P3ADMINLib.P3Co nfig P3 = new P3ADMINLib.P3Co nfig();
P3ADMINLib.P3Do main domain = P3.Domains.get_ Item(0);
P3ADMINLib.P3Us ers users = domain.Users;
foreach (P3ADMINLib.P3U ser user in users)
{
if (user.EmailName == Mailbox)
{
domain.Users.Re move(user.Name) ;
break;
}
}
deleted = true;
}
catch (Exception exc)
{
LogRegister.Log Register log = new LogRegister.Log Register("Utils .cs", exc.Message, new StackTrace(0, true).GetFrame( 0).GetMethod(). Name, "System", true);
}
return deleted;
}
Can anyone tell me how to pass the "access denied" problem? If not, hope you enjoy C# for P3AdminLib.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Lev Altshuler |
last post by:
Hi,
I am trying to count email messages in the mailbox and read their headers.
In case that there are some messages on the POP3 server and
they haven't yet got to the Inbox, I get a number of messages.
As soon as they have been in the Inbox, I get '0E0' as a number of messages.
Does anyone know what feature of Net::POP3 I am not aware of, or
where did I screw up in the code?
use Net::POP3;
|
by: Eric McDaniel |
last post by:
This may be a question for ActiveState support, but just in case anyone out
there knows what the problem is...
My call to Net::POP3->new() works fine when run through the perl
interpreter, but fails when I compile the script with PerlApp and run it. My
system is Windows 2000, ActiveState Perl 5.8.0 build 806, PerlApp 5.2.0
build 520.
Here is the script:
|
by: Chad Myers |
last post by:
I'm looking for an app that would allow me to
download mails from various POP3 accounts and
put them into my Exchange inbox on the server
side (rather than having to have outlook open
to do it all the time).
There are many products that do this, but
they're very expensive considering it's just
for me and just for tinkering.
|
by: Kevin Beyers |
last post by:
Hello Everyone. I am in the process of writing an Internet connection wizard
program for the company I am working for. At present, I have all the pieces
together beside the part of setting the email account password for outlook.
If anyone have any ideas that could help. Please let me know
Currently I have found the following info
HKEY_CURRENT_USER\Software\Microsoft\Internet Account
Manager\Accounts\00000007
|
by: Carlos Lozano |
last post by:
Hi,
I know I can create e-mails and send them using System.Web.Mail, but I was
wondering how can I do it using the POP3 settings on Office Outlook or
Outlook Express.
The problem I have is some users are being denied access to relying directly
to the smtp server, but they can send using outlook's POP3 settings.
Thanks,
| |
by: Mike Brearley |
last post by:
I need to write a script that will check a catch-all mailbox (pop3) and send
a non delivery report back to the sender of the email.
Background info:
I have a domain hosted on a site that offers unlimited email accounts... the
problem is, emails sent to an invalid address on the domain aren't
automatically returned as non-deliverable. I am, however, able to set up a
catch-all address and able to pick up those emails. Id like to set up a...
|
by: Mads Westen |
last post by:
Hi,
I got my code to work on exchange accounts.
Is it possible to write some code that add's appointments in the account on
pop3 accounts in Outlook?
Best regards
Mads
|
by: =?Utf-8?B?Q2hhcmxlcw==?= |
last post by:
Like many people, I normally use Yahoo! Mail via the web and like to keep all
my emails stored on the Yahoo! server. However sometimes I can’t get access
to a PC/the web and I download my emails to a PDA/palmtop via POP3. The PDA
uses Windows Mobile software. Since using the PDA, I have had the problem of
emails disappearing from the Yahoo! server. However I think I now understand
how to avoid this.
It seems that Windows Mobile is...
|
by: Craig Buchanan |
last post by:
I would like to monitor a POP3 mailbox with multiple clients. However, I want
to ensure that each message is processed by only one client. In essence, I
would like to treat a POP3 mailbox like a queue.
From what I've read thus far, atomic message access (if this is the right term)
isn't a native feature of the POP3 protocol. Am I mistaken?
My approach thus far, is to have one thread connect to the mailbox periodically,
look for new...
|
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,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
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...
|
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...
|
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();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |