|
I am trying to create a mailbox from a web applicattion that it is not in a domain controller (a webservice) using CDOEXCH. The code works fine when the web service is in the domain controller but no way out of it. If we put the code in a Windows applicattion then everything work fine even in a non domain controller computer. We have try to impersonate the asp, or even the application pool. The security context was ok but there is something wrong with any permission or something like that though the credentials have domain administrator rights.
I have tried to encapsulate the code in a COM+ object and impersonating with administrator rights but I didn´t success. I copy the general idea from our code and the return error. Any idea wolud be really apreciate
DirectoryEntry container, user;
CDOEXM.IMailboxStore mailbox;
//This creates the new user in the "users" container.
//Set the sAMAccountName and the password
container = new DirectoryEntry("LDAP://cn=users," + defaultNC);
user = container.Children.Add("cn=" + fullName, "user");
user.Properties["sAMAccountName"].Add(alias);
user.CommitChanges();
user.Invoke("SetPassword", new object[]{password});
//This enables the new user.
user.Properties["userAccountControl"].Value = 0x200; //ADS_UF_NORMAL_ACCOUNT
user.CommitChanges();
//Obtain the IMailboxStore interface, create the mailbox, and commit the changes.
mailbox = (IMailboxStore)user.NativeObject;
mailbox.CreateMailbox(homeMDB);
user.CommitChanges();
RETURN ERROR:
Unable to create a mailbox for the specified user. Using homeMDB path: LDAP://PRSRVDCCAM1.redcam.local/CN=Mailbox Store (PRSRVDCCAM1),CN=First Storage Group,CN=InformationStore,CN=PRSRVDCCAM1,CN=Servers,CN=First Administrative Group,CN=Administrative Groups,CN=CAM,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=REDCAM,DC=local. Inner exception attached from: mscorlib. Current user context: REDCAM\AdministratorWith error
Facility: LDAP Provider
ID no: 80072020
Microsoft CDO for Exchange Management
|
|
|
|
|
I don't know if this helps, but according to the article ASP.NET Web Application Security[^] from MSDN, ASP.NET has client impersonation set to false. I don't know if this affects your ASP.NET application (I don't do that kind of thing), but I thought it might be a direction for you to look.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
Hi:
Is it possible for showing when an option has been toggled on/off on a menu? If so, how do I program it?
Thanks, Smurfy
|
|
|
|
|
Well, first you need to set the MenuItem 's Checked property to the appropriate Boolean value.
From here, you have a couple of choices.
1) If the user can only change the state of the application through clicking that MenuItem , then hook up an event handler to the Click event of the MenuItem (which I'm sure you already have) and set the MenuItem 's Checked property equal to the Boolean inverse of its current value. For example: menuItem1.Checked = !menuItem1.Checked; .
2) If the state of the application can change without the use of the MenuItem , then hook up an event handler to the MenuItem 's parent MenuItem 's Popup event. In that event handler, have something like targetMenuItem.Checked = ShouldICheckThisMenuItem(); where ShouldICheckThisMenuItem() is some method that returns a Boolean value determining if the MenuItem should get checked.
Hope that helps.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
I have a window form and I have label with the text "open file" on the form. I want the text "open file" to appear in red (not the defaul black). How can i do it?
THX.
|
|
|
|
|
Set the Label 's ForeColor property to the desired color. You can do this in the form designer in the properties pane (easier), or in the code (easy).
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
I suggest to use MSDN for quick help!! as it is so powerful and quicker
|
|
|
|
|
I hava a situation where I have a class that contains objects os other classes that are to be readonly (the whole thing is initialized in the constructor, and the gris is used only to show the results).
The problem is that the TypeConverters for some of the inner objects are allowing to edit the object:
using System;
using System.ComponentModel;
namespace PropertyTest
{
public class SimpleClass
{
private NestedClass _xy;
private int _z;
public NestedClass XY
{
get { return _xy; }
}
public int Z
{
get { return _z; }
}
public SimpleClass()
{
_xy = new NestedClass(1, 2);
_z = 3;
}
}
[TypeConverter(typeof(NestedClassConverter))]
public class NestedClass
{
private int _x;
private int _y;
public int X
{
get { return _x; }
set { _x = value; }
}
public int Y
{
get { return _y; }
set { _y = value; }
}
public NestedClass(int x, int y)
{
_x = x;
_y = y;
}
}
public class NestedClassConverter : ExpandableObjectConverter
{
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
{
if (destinationType == typeof(NestedClass))
return true;
return base.CanConvertTo(context, destinationType);
}
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
{
if (destinationType == typeof(System.String) && value is NestedClass)
{
NestedClass nc = (NestedClass)value;
return nc.X.ToString() + "," + nc.Y.ToString();
}
return base.ConvertTo(context, culture, value, destinationType);
}
}
}
If I create an object of type SimpleClass, I want the property of type NestedClass to be readonly on the propertygrid. How can I do that?
Luis Barreira
|
|
|
|
|
|
I've tried that, and I also tried declaring the variable as
private readonly NestedClass _xy;
but it still let's me edit XY's properties...
|
|
|
|
|
|
Hi,
I have a C# application by using Access database. I developed it on Windows 2000 professional, evrything is fine.
But when I create a setup project, and install it on window xp home, I can n't connect to the database (I got a message, said db connection is closed!!).
I didn't install office on the xp home.
and the followin is the connection code:
OleDbConnection con=null;
string sConnection;
string sFile=Application.StartupPath + "\\cwads.mdb;";
sConnection="Provider=Microsoft.Jet.OLEDB.4.0;"
+ "Data Source=" + sFile
+ "User ID=Admin;"
+ "Jet OLEDB:Database Password=password";
try
{
con=new OleDbConnection(sConnection);
con.Open();
}
catch(Exception){};
Please help me out of this!!!!
Thanks!!
Alan Shen
MCAD for .NET Version
^~^~^~^~^~^~^~^~^~^~^
Great idea is the beginging of success!
|
|
|
|
|
Where did you get the error message? You couldn't have gotten it in the code you are showing.
You catch any exception that occurs and ignore it, so you'll never know if the connection was successful or not, or the reason if it wasn't. If you catch the exception, you have to handle it, or you will end up just as you are now, fumbling in darkness without a clue to what went wrong.
---
b { font-weight: normal; }
|
|
|
|
|
The message comes with the dialog with 3 buttons like "Detail, continue, Quit" , I got it from checking the detail button!
Alan Shen
MCAD for .NET Version
^~^~^~^~^~^~^~^~^~^~^
Great idea is the beginging of success!
|
|
|
|
|
Ley me get this straight. You're trying to open this connection to the database and leave it open for the life of the form? Bad practice.
In your Detail button code, open a connection to the database, do your work, then close it.
But, it's hard to tell because you haven't posted any of the code in your Detail button handler.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Ok, good.
Now also read the second paragraph of my previous post.
---
b { font-weight: normal; }
|
|
|
|
|
i solve the problem, i think it is because of the release optimise. since the code works for debug version. anyway, i change the code structure, everything is fine now!:
Alan Shen
MCAD for .NET Version
^~^~^~^~^~^~^~^~^~^~^
Great idea is the beginging of success!
|
|
|
|
|
Hello All,
I made a Com+ component and i used it in the client server way but my server in subnet and the clients in another subnet and there is a firewall in the network. after i search on the internet i found that the Com+ and DTC use the Netbios. the problem is the microsoft still use Netbios to comunicate to the server and client.
this is the problem. Please can any one help me to solve this problem.
thanks for your time.
Best regards,
Hoho
|
|
|
|
|
Hi to everybody,
I´m trying to connect with a database in Sybase, if I connect in local no problem, the problem is when I´m try to connect from other computer and the
program C# give me this error:
Message "Invalid connection string. Error parsing connection parameter string\r\nNombre del parámetro: connectionString" string
This is my code:
using iAnywhere.Data.AsaClient;
private AsaConnection _conn;
private void btnConnect_Click(object sender, System.EventArgs e){
string connStr = "Host=192.30.3.83;Port=2638;User ID=DBA;Password=SQL;Database Name=prisma1";
try{
_conn = new AsaConnection(connStr );
_conn.Open();
}
catch( AsaException ex ){
MessageBox.Show(ex.Message,"Failed to connect");
}
}
As well I have tried with this string:
string connStr = "server=192.30.3.83;user id=DBA; password=SQL; database=mysql; pooling=false";
string connStr "=192.30.3.83;Port=2638;Database=prisma1;UID=DBA;PWD=SQL";
//string connStr = "Host=192.30.3.83;Port=2638;UID='dba';PWD='sql';Database='prisma1';Pooling=false;";
//string connStr = "Data Source = prisma1;UID=DBA;PWD=SQL;";
//string connStr = "Data Source = prisma1;UID=DBA;PWD=SQL;";
//string connStr = "Network Address=192.30.3.83;Port=2638;UID=DBA;PWD=SQL;DatabaseName=prisma1;";
//string connStr = "Data Source=prisma1;Host=192.30.3.83;PWD=SQL;Port=2638;UID=DBA;DatabaseName=prisma1;";
But C# always return the same error.
Any help ??????? Any code ???????
Thanks in advance.
Coloso
|
|
|
|
|
From connectionstrings.com[^]:
"Data Source='myASEserver';Port=5000;Database='myDBname';UID='username';PWD='password';"
---
b { font-weight: normal; }
|
|
|
|
|
Hello,
I was wondering if you can give me some advice as to how I can see a webcam installed in a computer, from another one. I've been looking into Directshow, WIA, and they both seem to work in the same PC, but I was wondering how I could see the video live from another computer. Any suggestions?
I was thinking about sending information through a web service (Intranet) but I'm not sure yet about I can possibly obtain the memory stream or something from directShow or WIA.
Apologies but I don't know where would be the right place to ask this. So I figured C# could be a possible choice.
Are there any articles you can suggest?
daniero
|
|
|
|
|
You could use the DirectShow.NET[^] library and use that to publish your video. However, if you want something close to "real time," you may want to think about an architecture different than a Web service.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
Hi All,
I am having a function which can be called from different independent threads
simultaneously.Inside this i am having a hashtable.what each thread will do that it will check whether the hashtable contains a particular key if not then it will make an entry in the hashtable with that key or if it exists it will simply use the value corresponding to that particular key.what i want that the access to the function should be on first come first serve basis.so if a thread is already waiting on the function the current thread after completing processing should leave it (should enter in succession only if there is not any waiting thread), and no thread should be kept waiting for infinite.so entry into the function should be related to time of waiting in short i want the impementation to be a queue like.is using lock(object) will be suffice for the task or i have to use something else. and also if you can tell me how this lock statement functions.whether it will cause the other statement to wait or simply not allow the other threads to access it and throw some error.Thanks in Advance.
Rakesh
|
|
|
|
|
From the documentation.[lock ] marks a statement block as a critical section by obtaining the mutual-exclusion lock for a given object, executing a statement, and then releasing the lock However, you do not have the guarantee that it acts like a queue, only mutual exclusion on a thread-level basis. If you have an infinite condition in your lock block, then all other threads will wait forever.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
hi,
i have 2 froms: From1 & From2
Form1 have 2 buttons - 1st button open Form2, second button must close
opened Form2.
i opened Form2 by click button :
private void button1_Click(object sender, EventArgs e)
{
Form2 frm2 = new Form2();
frm2.Show();
}
how can i close this FORM2 by click on Button2?
thx for help
Athlon 64 3500+, Gigabyte GA-K8NXP-9, 2x512 DDR400 Kingston, Inno3d 6200 PCIe, SS2 B2C2 v2.6, HDD := 450gb, Genius 56k int, NEC DVD-RW и мать его Суньмастер 550.
|
|
|
|