|
If the aspnet user has access you also need to give IIS_WPG access, then it should work.
Ben
|
|
|
|
|
Hi,
I tried to add user into Active directory using ASP.Net and C# web application. If i tried to add it in "Users" then it successfully added and I can also change that user password.
But if I want to add that user into another "Organizantional Unit" then It add it successfully but create a problem at "SetPassword" method. Web application gives timeout problem. When i tried it in Window application then one popup box is opened. It display me that I am accessing private data.
How can i update private data of Active directory? I used Directory Entry for that. How can i change user's password which is in User defined Organizational unit?
Please Help....
Regards,
Hardik Patel
Analyst Programmer
|
|
|
|
|
Hope this helps:
public void CreateUserAccountAd()
{
string userID= "CN=userID";
string pass= "password";
// Use this command to add it into other OUs
//string lPath=
// "LDAP://domain/OU=OrganizationalUnit,DC=DomainName,DC=com";
//Use this one to add in default OU
string strpath =
"LDAP://domain/";
DirectoryEntry de = new DirectoryEntry(lPath);
DirectoryEntries child = de.Children;
DirectoryEntry deuser = child.Add(userID,"user");
deuser.Properties["SAMAccountName"].Add(userID);
deuser.CommitChanges();
SetPassword(deuser, pass);
Enable(deuser);
}
private static void SetPassword(DirectoryEntry DE, string password) {
object[] oPassword = new object[] {password};
object ret = DE.Invoke("SetPassword", oPassword );
DE.CommitChanges();
}
public void Enable(DirectoryEntry DE)
{
ActiveDs.IADsUser user1 = (ActiveDs.IADsUser)
DE.NativeObject;
user1.AccountDisabled = false;
DE.CommitChanges();
}
|
|
|
|
|
Hi
I want to get the ip of the machine using a web application.
I used Request.UserHostAddress() and Context.Request.ServerVariables ["REMOTE_ADDR"] but still gives me IP Address: 127.0.0.1
Any ideas?
Could it be a configuration from our network administrator?
|
|
|
|
|
When you are viewing a web page that is hosted on your own computer, you are browsing from localhost to localhost, so the IP address 127.0.0.1 is correct.
---
single minded; short sighted; long gone;
|
|
|
|
|
That is correct. The reason is that iam using an application hosted on my Laptop
Try to put the ip instead of localhost u will get the ip right.
thanks for ur response.
|
|
|
|
|
Hello Everybody...
I have a web application developed in .net 2.0 which uses SQL Server 2005 as its backend.
No error is thrown when I jus debug from my machine.
But When I host it in IIS it is throwing the error mentioned in subject line.
My connenction string in web.config file just has, server, database attributes along with integrated security is set to true...
And the SQL Server is in Mixed Mode authentication.
Still I face the error.
PS: I could successfully browse the site if i mention some SQL Authenticated User id and password in connection string instead of integrated security...
Is there anyother way without giving the sql userid?
Why do we have to have the sql authenticated user?
-Saran
|
|
|
|
|
If you use authenticated security in a .net application then then connection will be made in the context of the process account IUSR_MachineName most probably. It is unlikely that user has access to the sql server and I wouldnt recommend that you add it.
I would suggest using a sql login from the web site rather than integrated authenication.
|
|
|
|
|
If you still want to use integrated security to access sql server you will need to do a few things.
First set up a new app pool in IIS. Point your web app to use this app pool. Next create a network login for the app pool. Set the identity of the app pool as the network user. On the web server add the new user to the IIS_WPG group Make sure the user has the correct read and write rights to the directories that your web app are in. Finally make sure this network user has the correct rights in sql server so the web app will run.
Hope this helps.
Ben
|
|
|
|
|
hi,
I am working on web application(ASP.NET ,VB.NET) and some reports push on server daily.
GZ (application like winzip) is installed on only server machine not on client machine.
I want to open report in GZ on server from any client machine and print on printer.
Can I do this ?
thanks in advance!!
|
|
|
|
|
We've got an IIS server running with ASP.NET 1 and 2 on it, and are trying to develop an intranet website based on 2. The web pages are being created with a prog that uses version 2 only, and all the settings we can find on the server are also set to use Version 2, but loading a web page always brings up an error, and the ASP version number it contains is always 1.xxxxxx
Any ideas how to configure the server so it uses ASP 2.xxx for the website instead?
|
|
|
|
|
Have you set the website to use v2 in IIS? Go into IIS right click on the web site and go to properties. In the ASP.net tab change the version to 2 and apply.
If the application pool currently has any 1.1 applications running in it you will need to make sure you assign it to a new pool since you cannot mix versions in application pools.
|
|
|
|
|
Thanks for the reply, yes we've set it to version 2.
It could be the application pool thing, I'll have to try and find those settings.
|
|
|
|
|
IF you are running IIS with both .Net 1 and .Net 2 you need to set a different application pool for both. You can share an application pool for all 1 and a seperate one for 2.0 but they cannot have the same pool.
Darroll
|
|
|
|
|
in my code i write update query like this
string strSqlCmdText;
strSqlCmdText = "update tUser1 set Count = "+Convert.ToInt32(txtCount.Text)+" where UserId = '"+txtUserId.Text;
objClsDllSql.funSqlCmd(strSqlCmdText);
but i have error ie input string is not in correct format.
pls i want to update query.
pls help me urgently.
gayatri
Gayatri
|
|
|
|
|
strSqlCmdText = "update tUser1 set Count = "+Convert.ToInt32(txtCount.Text)+" where UserId = '"+txtUserId.Text;
Change to
strSqlCmdText = "update tUser1 set Count = "+Convert.ToInt32(txtCount.Text).ToString+" where UserId = '"+txtUserId.Text;
Also, I should note that you are wide open to SQL injection attacks with that particular implementation.
More about SQL injection attacks[^]
|
|
|
|
|
hello
again same error.
pls urgently give me reply
Gayatri
|
|
|
|
|
Can you put a watch on the sql command being executed and paste it in so i can see what command is being executed on the server?
|
|
|
|
|
Hi,
Try this one..............
strSqlCmdText = "update tUser1 set Count = Convert.ToInt32
(txtCount.Text.trim().ToString()) where UserId = '"+txtUserId.Text;
I think it will run properly.............
Nisar Inamdar.
|
|
|
|
|
1. Please do not use text speak.
2. Please do not use 'urgent' anywhere in your message. It's urgent for most people.
_____________________________________________
Flea Market! It's just like...it's just like...A MINI-MALL!
|
|
|
|
|
Shucks, do you have these "The rules" sitting on the clipboard somewheres
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
I guess you are missing closing quote for UserID field value, probably a text field.
With toString change also try to change WHERE clause from
where UserId = '"+txtUserId.Text ;
To
where UserId = '"+txtUserId.Text + "'";
|
|
|
|
|
You could do so, but you are open to SQL injection attacks. I'd use parameters instead...
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
use required filed validator with textbox in my web site and i put initial value 5
when i run the application i write 5 in textbox
the validation for that textbox happen in 2 case
1- when i leave textbox empty
2-when i write initial value in textbox
the unlogical case is no 2 why validation faild when i i enter intial value for that validator
why
how i can deal with it
md_refay
|
|
|
|
|
use required filed validator with textbox in my web site and i put initial value 5 when i run the application i write initial value in text box (5) in text box the error message of validator appear
why
how i can deal with it
md_refay
|
|
|
|