|
-
Sep 22nd, 2010, 03:59 AM
#1
Thread Starter
Hyperactive Member
-
Sep 22nd, 2010, 04:19 AM
#2
Re: Could not create Windows user token from the credentials specified
It should be domain\username
Code:
<identity impersonate="true" userName="Domainname\UserName" password="password"/>
Please mark you thread resolved using the Thread Tools as shown
-
Sep 22nd, 2010, 04:26 AM
#3
Thread Starter
Hyperactive Member
Re: Could not create Windows user token from the credentials specified
Thanks DanaSekar,
Yes, Its may be like this, I'm waiting for the client's reply.
But, I learned something by this
-------------------------------------------------------------------------
Error: "Could not create Windows user token from the credentials specified in the config file. Error from the operating system 'Logon failure: unknown user... "
This error usually is encountered when either the username / password is not valid for the selected user OR the selected user does not have necessary privilege.
You can add the privileges by following the below steps:
Run - Control Panel, Administrative Tools, Local Security Policy
Choose - Local Policies, User Rights Assignment from the tree
"Act as part of OS" should be the second entry on the right hand pane
-------------------------------------------------------------------------
Is it right???
-
Sep 22nd, 2010, 05:03 AM
#4
Thread Starter
Hyperactive Member
Re: Could not create Windows user token from the credentials specified
Hi,
I tried this too
open C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\CONFIG\machine.config
find: <processModel
change attributes: userName="machine" password="AutoGenerate"
where "machine" will be the account name you want to run under, and "AutoGenerate" is the password for that account.
But but not working.... still having the same problem
-
Sep 22nd, 2010, 06:32 AM
#5
Re: Could not create Windows user token from the credentials specified
I would encourage you not to make changes to the machine.config file without good reason, as these changes will go against all the web applications on that server.
Have you verified that the username and password that you have entered into your web.config file actually working on the server that you are trying to access?
Gary
-
Sep 22nd, 2010, 06:48 AM
#6
Thread Starter
Hyperactive Member
Re: Could not create Windows user token from the credentials specified
Hi Gary,
Thanks for the reply.
The username and password which are given in the web config files is which I used to login into the system, Its belongs to the administrator gruop....
But the same code working in my machine with a mapped drive, but not in the server.
-
Sep 22nd, 2010, 06:51 AM
#7
Re: Could not create Windows user token from the credentials specified
Can you provide some details about how these servers interact with each other? Are they all on the same network? Are they part of the same workgroup/domain?
Gary
-
Sep 22nd, 2010, 06:56 AM
#8
Thread Starter
Hyperactive Member
Re: Could not create Windows user token from the credentials specified
Gary,
Its a single web service which is installed locally in a machine.
The service want to work with a mapped network drive,
The drive, username, password details are in a .ini file.
The web service consumes that file and work with that,
I installed the same service two more machines its working fine.
But not in this machine... Its the problem.
Its giving the error.
-
Sep 22nd, 2010, 07:11 AM
#9
Re: Could not create Windows user token from the credentials specified
Hey,
How and where are you mapping this drive, and what permissions have you set up on the destination folder?
Gary
-
Sep 22nd, 2010, 07:16 AM
#10
Thread Starter
Hyperactive Member
Re: Could not create Windows user token from the credentials specified
Gary,
I need to get the Text files from this mapped drive to the web service.
I mapped the drive from my the system, and I need to use the drive with the web service.
I used the code like this
Code:
//WIN32API - WNetAddConnection2
[DllImport("mpr.dll", CharSet = System.Runtime.InteropServices.CharSet.Auto)]
private static extern int WNetAddConnection2A(
[MarshalAs(UnmanagedType.LPArray)]
NETRESOURCE[] lpNetResource,
[MarshalAs(UnmanagedType.LPStr)]
string lpPassword,
[MarshalAs(UnmanagedType.LPStr)]
string lpUserName,
int dwFlags
);
NETRESOURCE[] nr = new NETRESOURCE[1];
nr[0].lpRemoteName = share;
nr[0].lpLocalName = ""; //mLocalName;
nr[0].dwType = 1; //disk
nr[0].dwDisplayType = 0;
nr[0].dwScope = 0;
nr[0].dwUsage = 0;
nr[0].lpComment = "";
nr[0].lpProvider = "";
WNetAddConnection2A(nr, password, username, 0);
-
Sep 22nd, 2010, 08:35 AM
#11
Re: Could not create Windows user token from the credentials specified
 Originally Posted by sarathi125
Gary,
I need to get the Text files from this mapped drive to the web service.
I mapped the drive from my the system, and I need to use the drive with the web service.
I used the code like this
Code:
//WIN32API - WNetAddConnection2
[DllImport("mpr.dll", CharSet = System.Runtime.InteropServices.CharSet.Auto)]
private static extern int WNetAddConnection2A(
[MarshalAs(UnmanagedType.LPArray)]
NETRESOURCE[] lpNetResource,
[MarshalAs(UnmanagedType.LPStr)]
string lpPassword,
[MarshalAs(UnmanagedType.LPStr)]
string lpUserName,
int dwFlags
);
NETRESOURCE[] nr = new NETRESOURCE[1];
nr[0].lpRemoteName = share;
nr[0].lpLocalName = ""; //mLocalName;
nr[0].dwType = 1; //disk
nr[0].dwDisplayType = 0;
nr[0].dwScope = 0;
nr[0].dwUsage = 0;
nr[0].lpComment = "";
nr[0].lpProvider = "";
WNetAddConnection2A(nr, password, username, 0);
Did you try to map the drive from the new service machine manually ?
Please mark you thread resolved using the Thread Tools as shown
-
Sep 22nd, 2010, 08:42 AM
#12
Thread Starter
Hyperactive Member
Re: Could not create Windows user token from the credentials specified
Dana,
Thanks for the reply.
Already teh drive is mapped to the machine manually, we using that only.
Actually I'm using a username in the identity tag of the web config,
The user is belongs to adminstrator group,
Is there anything differrence between the administrator and teh user who belongs from the administrator.
Because, In one installation the administrator account working fine,
-
Sep 22nd, 2010, 01:39 PM
#13
Re: Could not create Windows user token from the credentials specified
Please mark you thread resolved using the Thread Tools as shown
-
Sep 22nd, 2010, 03:03 PM
#14
Re: Could not create Windows user token from the credentials specified
This can only be a problem with permissions. There must be something different between the two servers that work, and the one that doesn't. It is hard to know what that is, without more information from you.
Gary
-
Sep 22nd, 2010, 11:25 PM
#15
Thread Starter
Hyperactive Member
Re: Could not create Windows user token from the credentials specified
Gary,
What information you looking for
-
Sep 23rd, 2010, 01:02 AM
#16
Re: Could not create Windows user token from the credentials specified
Hey,
What Operating Systems are you using?
The user that you are trying to use, is it a local user, or it is a domain account?
Does that user, if it is a local one, have the correct permissions on the shared folder?
Are the computers on a domain?
Are the computers on a workgroup?
etc..
Bottom line is, this a a permission problem. You have two computers that are working and one that isn't. Look at the differences between them.
Thanks
Gary
-
Sep 23rd, 2010, 01:52 AM
#17
Thread Starter
Hyperactive Member
Re: Could not create Windows user token from the credentials specified
Gary,
Thanks for the reply.
I have solved the problem by analysis the problem with the IIS 5.1.
For your information
its a Windows XP machine
with IIS 5.1
I have removed teh existing web service and installed the new and changed the
ASP.NET settings of the webservice property in the IIS 5.1.
And in the configuration, I have changed the Application with the Impersonate mode checkbox, I unchecked it. And now its working fine.
So finally its working fine now. But, I need the final conclussion where, what mistake I did, But, I need to set permission for all the folders which are all involving with the web service, Please advice on this.
-
Sep 23rd, 2010, 01:59 AM
#18
Re: Could not create Windows user token from the credentials specified
So, to be clear, on the systems where is was working before, what settings did you have in IIS? I am assuming that impersonate mode was off, it was correct?
In your case, you are providing the user name and password for mapping the drive directly in the code, and likely for accessing the files. With impersonation mode in IIS turned on, it would be using the credentials on the incoming request to try and do this work, however, with your ASP.Net Configuration the way it was, it should have been passing again those credentials from your ASP.Net website.
So I am still not 100% clear on what/why it is working.
Bottom line is, what do you want to happen?
Do you want the credentials of the person accessing your site to determine whether the drive should be mapped? Or, do you want to hard code the credentials, such that the same set of credentials will be used for every person who is accessing your site?
Gary
-
Sep 23rd, 2010, 05:00 AM
#19
Thread Starter
Hyperactive Member
Re: Could not create Windows user token from the credentials specified
Gary,
Thanks for the time spent...
Its clear now....
-
Sep 23rd, 2010, 07:19 AM
#20
Re: [RESOLVED] Could not create Windows user token from the credentials specified
-
Sep 24th, 2010, 02:42 AM
#21
Re: Could not create Windows user token from the credentials specified
 Originally Posted by sarathi125
Gary,
Thanks for the time spent...
Its clear now....
Could you Please the actual answer for your problem, so that this will be helpful for others.
Please mark you thread resolved using the Thread Tools as shown
-
Sep 24th, 2010, 04:35 AM
#22
Re: Could not create Windows user token from the credentials specified
 Originally Posted by danasegarane
Could you Please the actual answer for your problem, so that this will be helpful for others. 
Good point Dana
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|