.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Impersonation issue | Multiple domain

Posted By:      Posted Date: September 02, 2010    Points: 0   Category :ASP.Net
Hi,I am working on an Intranet site.The site is running with the following configurationWindows 2003 Server, IIS 6The users of the site come from 3 different domains (say Domain A, B, C). We have Integrated Windows Authentication turned on. App pool identity - Network Service Impersonation is turned Off in web.config. We try to impersonate the original caller programatically for one functionality where we try to access contents of a folder on shared drive by giving a UNC path. System.Security.Principal.WindowsImpersonationContext impersonationContext;impersonationContext = ((System.Security.Principal.WindowsIdentity)Context.User.Identity).Impersonate();...DirectoryInfo rootDir = new DirectoryInfo(path); DirectoryInfo[] dirContents = rootDir.GetDirectories();// We show the folders and files which can be downloaded after this ..impersonationContext.Undo();  The web server and the file share are on domain AIssue The above functionality works fine for all users coming from Domain A but for users coming in from Domain B and C get System.UnauthorizedAccessException at rootDir.GetDirectories(). But when the same users type the same UNC path from Win>Run or File Explorer, they are able to open it.The users are all coming in through IE6, so they do not have to provide their user name, password as trust has been established between all 3 domains. Can anyone please p

View Complete Post

More Related Resource Links

Multiple Paramatized Threading issue


I need the funcitonality to have two methods run concurrently of each other and the parent thread (aka the method that makes these two calls) to halt until BOTH are done. After the threads are done, I need to perform logic on the returns of the method, so it is essential for both of them to be complete before the parent thread continues. I have searched the internet and tried varous attacks, and I always come up with the same result, this being the parent thread continues operation after the first thread finishes, leaving the second thread running.  Can someone show me a quick example of how I can do this. I have tried checking states of the threads, halting the threads, but I always end up with the same thing. Any help would be great. Thanks.

windows authentication issue with different domain

Webservice(frame work 2.0 & VB.NET) connecting to SQL Server 2008 in Windows Authentication mode and WS configured on App pool with domain\user id credentials and granted full access to temp folder still getting the following error. System.InvalidOperationException: Unable to generate a temporary class (result=1). error CS2001: Source file 'C:\WINDOWS\TEMP\ixymjcwh.0.cs' could not be found error CS2008: No inputs specified at System.Xml.Serialization.Compiler.Compile(Assembly parent, String ns, XmlSerializerCompilerParameters xmlParameters, Evidence evidence) at System.Xml.Serialization.TempAssembly.GenerateAssembly(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, Evidence evidence, XmlSerializerCompilerParameters parameters, Assembly assembly, Hashtable assemblies) at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, String location, Evidence evidence) at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[] mappings, Evidence evidence) at System.Web.Services.Protocols.XmlReturn.GetInitializers(LogicalMethodInfo[] methodInfos) at System.Web.Services.Protocols.XmlReturnWriter.GetInitializers(LogicalMethodInfo[] methodInfos) at System.Web.Services.Protocols.MimeFormatter.GetInitializers(Type type, LogicalMethodInfo[] methodInfos) at System.Web.Services.Protocols.H

Error in Impersonation - different domain account.

Hi I am trying to stop a windows service in a server(on different domain) from my C#.NET windows application using ServiceController I am getting following error Inner Exception: {"Access is denied"} Exception Message: "Cannot open Service Control Manager on computer 'x.y.z.a'. This operation might require other privileges." Enviroment:       Windows application running on Windows 7, C#.NET, 3.5 on “ABC” DOMAIN       Target service running on Windows 2003 server. on “XYZ” DOMAIN       Port 445,135 opened between two systems Code:       ServiceController lo_WinSC = new ServiceController();       lo_WinSC.MachineName = "SYSTEMIPAddress";       lo_WinSC.ServiceName = "ServiceToBeStopped"; Some forum suggesting to impersonate account of target domain but failed to Impersonate. Error: “The security database on the server does not have a computer account for this workstation trust relationship”   Question 1: Is it possibile to impersonate account of different domain. i.e My application running on “XYZ” domain, I would like to impersonate an account “ABC” domain. Note: Port LDAP port 389 is opened between two systems. Is possb

MOSS 2007 Alerts - Multiple Emails Issue

I've been experiencing a strange issue with SharePoint alerts that seem to happen randomly.  I've setup a daily alert on a custom list that sends a summary of all changes at 5pm, but on some days I'll receive more than 1 summary email (150+ this past Tuesday).  Each email contains different information and the total number of emails is random along with the number of records in each email.  Some days the summary comes in one email and others it comes in multiple.  This is happening on our production server and I haven't been able to recreate the issue in development.  Does anyone have any thoughts as to how a daily alert would get split up into several emails?We have 1 MOSS 2007 app server, 1 index server and 1 SQL 2005 database server.

Issue with Alerts with multiple Managed MetaData fields?

i'm seeing an issue in SharePoint 2010 with alerts.  If a list has more than 1 Managed MetaData columns, alerts stop working.  If I take it down to only one managed metadata column, they start working again.  Is this a known issue?  I'm seeing it in multiple sites/mulitple users.

Issue by enabling Impersonation on IIS 7.5

Dear all,I am running ASP.MVC 2 with LINQ2SQL on IIS 7.5. I have enabled Windows Authentication with ASP.NET Impersonation. Application pool is running on different domain account [Asia\TestWebUser] is part of windows group [Asia\TestUserGrp]When i enable Asp.net impersonation on MVC web site. Once i hit LogOn from the default page , it's throwing me with below error message14/9/2010 4:35:41 PM | Error | Controller | An exception occured in controller: Session, while executing action: SignOn. 14/9/2010 4:35:41 PM | Error | Controller | Error Message: An operations error occurred. , StackTrace: at System.Data.Linq.SqlClient.QueryConverter.VisitInvocation(InvocationExpression invoke) at System.Data.Linq.SqlClient.QueryConverter.VisitInner(Expression node) at System.Data.Linq.SqlClient.QueryConverter.VisitBLOCKED EXPRESSION at System.Data.Linq.SqlClient.QueryConverter.VisitMemberInit(MemberInitExpression init) at System.Data.Linq.SqlClient.QueryConverter.VisitInner(Expression node) at System.Data.Linq.SqlClient.QueryConverter.VisitSelect(Expression sequence, LambdaExpression selector) at System.Data.Linq.SqlClient.QueryConverter.VisitSequenceOperatorCall(MethodCallExpression mc) at System.Data.Linq.SqlClient.QueryConverter.VisitInner(Expression node) at System.Data.Linq.SqlClient.QueryConverter.VisitFirst(Expression sequence, LambdaExpression lambda,

Server domain name issue

We have 2 branch offices in India and USA, also we have used 2 server one is USA and another one is India. we have alreadey installed sharepoint 2007 in USA server that is also domain controller and indian server configure with USA server. All domain users(India and USA) used sharepoint in USA server. Now we successfully installed and configurel sharepoint 2007 in Indian server using same domain name (ex:domain\jg). It is working fine in Indian server. but it not working in client machine. ex: If try some other machine using same domain name(domain\jg) it is not working. can we install sharepoint in 2 server using same domain controller (ex: domain\jg) ? If it is possible please explain how it is possible.

Impersonation with domain account without joining the domain?


My feeling says it's not posible but anyway I am curious if there is at least a workaround for accomplish this.

Basically I am working at my client site and my machine is not connected to the domain.
What I want to do is running a web application locally under a domain account, and using the webdev server.
The webapp uses the default authentication, windows authentication that is.
I tried using impersonation with domain\user & password but I got the following error

Could not create Windows user token from the credentials specified in the config file. Error from the operating system 'Logon failure: unknown user name or bad password.

I have to mention that the username and the password are correct.

Thanks in advance

FAST Search Sever Installation - Domain / Password Issue


I have isntalled SharePoint Server 2010 and here is my configuration:  One virtual machine with Windows 2008 R2 as a domain controller.  One virtual machine with SharePoint Server 2010, SQL Server R2 2010.  SharePoint was installed as a farm pointing to the local SQL Server.  I also used the domain account domainname\SPUser during the SharePoint Server configuration wizard.  I then installed FAST Search Server 2010.  Everything worked without an issue until I try to run the FAST Search Server 2010 Configuration Wizard.  When asked to provide username and password, I try to use a domain account domainname\FSUser.  I receive the following:  User validation failed.  Username or domain is incorrect.

I tried logging into the SharePoint Server / FAST Search Server virutal machine with the domain account domainname\FSUser with no problem.

Any ideas?

LINQ to SQL Classes (dbml file) across multiple websites issue



I have a single LINQ to SQL Classes (dbml file) compiled in a Class Library that's referenced by 3 websites. Inside that Class Library there's also a class that's using the DBML to manipulate data.

At one point it needs to save in a user table the user info (firstname, lastname, email). SOMEHOW (!?) two of the 3 webapps saves email instead of firstname and viceversa while the other 1 saves them correctly ! The one compiled last seems to be the one saving correctly.

There's no code error as I have debugged this multiple times. The values are assigned correctly but before the SubmitChanges() call the data inside the database object is corrupted.

Now, I have already fixed this locally by putting every website in a separate AppPool (which also needs to be set to "Classic" and not "Integrated". However I really don't want to bug the client with such IIS changes so I'm looking for another workaround !

Please Help!



Upload Multiple Documents issue after office 2010 install



I am getting issue in "Upload Multiple Documents" after office 2010 install.

Its asking me to Drag n Drop files but after droping all files, if i click OK button , each file Staus is failed.

Kindly help me, its urgent.




One Gridview & Multiple CommandText Issue on Paging


Hi All,

I am using a gridview to display data from two separate functions. [VS 2010 on Framework 4]

This works fine without paging. On paging, clicking 'next page' invokes the older data(of function 1) instead of that in the new function (function 2) Cry


' Function 1

cmd.CommandText = "select * from table1,
Dim dTable As DataTable
Dim dataAdapter As SqlDataAdapter
            dTable = New DataTable
            dataAdapter = New SqlDataAdapter(cmd.CommandText, AquisitionString)

'Function 2

cmd.CommandText = "select * from table2,
Dim dTable As DataTable
Dim dataAdapter As SqlDataAdapter
            dTable = New DataTable
            dataAdapter = New SqlDataAdapter(cmd.CommandText, AquisitionString)

'Handling PageIndexChange

   Protected Sub grdAcquisition_PageIndexChanging(ByVal sender As Object, _
       ByVal e As System.Web.UI.WebControls.GridViewPageEventArgs) Handles grdAcquisition.PageIndexChanging

Does the 2008 R2 Data Alignment in the columns (Domain Scope) work with multiple tablix's


Does the 2008 R2 Data Alignment in the columns (Domain Scope) work with multiple tablix's or only with one Tablix with different groups?


I have been trying to use it for a report that has 3 tablixs (the same dataset and same format) but it doesnt seem to work. All the examples i find are for a single tablix.

Anyone know?

Updating multiple Indexes on a table - Performance issue



I have a performance issue when trying to update a table with multiple indexes. The table itself has about 280 million rows. The selection of the records is fast, about 160 ms, as it has a suitable non-clustered index. However the update itself takes over 10 minutes.

When I look at the excution plan, it shows the update to the clustered index as well 5 other non clustered index which are being affected by the statement. Unfortunately it doesn't show me how those indexes are being accessed. I suspect that the update statement is performing a full index scan against each of the non-clustered indexes in order to do the update.

So my question is this, if i add the key columns of the other non-clustered indexes as included columns on the index used to select the records for update will sqlserver use them to access the additional non-clustered indexes?

any advice greatly appreciated


how to add multiple ajax ratings issue...


I am using visual studio 2008 C# 2.0. I have an issue adding multiple ratings...What i have of code so far is:


im adding this to datalist:

  <cc1:Rating ID="LikeRating" runat="server"
                    style="float: left;">
    </cc1:Rating><br />



 protected void r_Changed(object sender, AjaxControlToolkit.RatingEventArgs e)

        Rating r = (Rating)sender;
        string id = r.ClientID;

        string s = e.Value;


and this is some of the xml file:


<entry... (some other attributes comes here)... ... ratingid="Guestbook_ctl00_r" ratingclicks="3" ratingresult="9">some text comes here..</entry>

so now the problem is how can i control ever

AutoPostBack issue with other web controls resulting in multiple clicks on "Save" Button


A new ASP.NET web application that I've been working on has among other web controls on the DetailView, a DropDownList for Category (ddlCategory) a TextBox for Quantity (txtQuantity) a Label for the Rate (lblRate) and a Label for the Amount (lblAmount) along with a Save button (btnSave), etc.; there are also TabIndexes set to progressively navigate from control-to-control ending on the Save button.  NOTE: the user would like to see the Rate & Amount values in the DetailView prior to saving the record.

The Rate is determined by the selected the Category so I have the AutoPostBack property set to "true" on ddlCategory to make a call to the database to retrieve the Rate on the SelectedIndexChanged event; likewise, the AutoPostBack property on txtQuantity is set to "true" in order to compute the Amount (and populate lblAmount) once the user enters a Quantity.  Theoretically, the user could enter the values sequentially and still go back to change the Category prior to the save so simply performing some client-side JavaScript to compute the Amount would not be bulletproof.

Everything works according to plan when the user tabs from control-to-control {e.g., Category > Quantity > Save}, or tabs off the control.  However, the problem occurs when the user enters all the values and then clicks on the Save button without tabbing off the

Multiple Drill Through Issue when using Report Viewer in SharePoint



I have a report that has a Pie chart and Bar Chart on it.  This report has default parameters on it.  Both the Pie Chart and Bar Chart Drill through to different reports. Looking at the paramater panel of this report all looks fine.

When I drill through on the Pie chart this works OK and the drill through reports this has another parameter on it.  The parameter panel updates correctly.  I then click the return to parent report and this returns correctly but does not update the parameter panel.

I then try to drill through on the Bar Chart (the report is showing the incorrect paramater panel) I get the following error.

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; InfoPath.3; .NET4.0C; .NET4.0E)
Timestamp: Mon, 26 Jul 2010 20:47:20 UTC

Message: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.
Details: Error parsing near '
<!DOCTYPE html PUB'.
Line: 5
Char: 62099
Code: 0

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend