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

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

Impersonation Issues on remote machine

Posted By:      Posted Date: October 26, 2010    Points: 0   Category :Sql Server

I am trying to build a CLR function which will return a list of remote sessions on various servers. I'm using an external .Net Library of functions called Cassia which i've been recommended by a friend.


I am using impersonation within the function and this works fine when the function is hosted on my local machine and is executed from my local machine. However, if i connect to my local machine from a remote server and execute the function, i get "Access is denied" errors. My feeling is that this has something to do with delegation but i'm at a bit of a loss as to how to troubleshoot or progress this issue.

Can anyone point me in the direction of a possible solution- i can post the source code if required.

I'm running SQL2008 Sp1 on Windows XP SP3. The remote servers are all Win2k3.


every day is a school day

View Complete Post

More Related Resource Links

WCF issues sending large data - "An existing connection was forcibly closed by the remote host"

Hi Guys I have posted the following on www.asp.net but thought it might be productive posting here too.I have been pulling my hair out trying to fix an issue with sending data over WCF, I have read pretty much every THREAD on this forum regarding or similar to this issue without any successful solution.  I have a simple data object which has a [DataMember] with a data type of byte[]. I use this to send binary data from my web app as follows: Asp.net MVC website --> WCF Client (Has my Service References) --> My Services (MyServices.svc) --> Business/Data Tier Everything is being executed from within VS 2008 Pro.   Now I have successfully sent data up to 2.2MB, however it fails if i try and send a file such as 2.3MB or larger i get the following exceptions: General Exception Exception rethrown at [0]:    at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)   at SoftApp.WCFClient.MyServiceReference.IMyService.Document_Save(DtoDocument dtoDocument, Int32 usercode)   at SoftApp.WCFClient.MyServiceReference.MyServiceClient.Document_Save(DtoDocument dtoDocument, Int32 usercode) in c:\dev\softapp\softapp.wcfclient\service references\myservicereference\refe

Facing MSDTC related issues while archiving data from one database server machine to another databas

I have a question with respect to distributed transactions when carried out between two database server machines on the same network.   Consider there are two database server machines \SOURCE_DATABASE_SERVER\ and \DESTINATION_DATABASE_SERVER\. Now we have to archive the data from one database server to other database server.   Let us suppose the database server \SOURCE_DATABASE_SERVER\ is the live production database server and \DESTINATION_DATABASE_SERVER\ is Long term storage database server. Now data from \SOURCE_DATABASE_SERVER\ needs to be archived into the database server \DESTINATION_DATABASE_SERVER\.   So I have written a dynamic stored procedure which includes distributed transaction (begin Tran, commit Tran, rollback            Tran) coding in it.   Now initially when I executed the procedure, it gave some of the following errors   1) OLE DB provider "SQLNCLI" for linked server "\DESTINATION_DATABASE_SERVER\" returned message "The partner transaction manager has disabled its support for remote/network transactions.". Msg 7391, Level 16, State 2, Line 1 The operation could not be performed because OLE DB provider "SQLNCLI" for linked server "\DESTINATION_DATABASE_SERVER\" was unable to begin a distributed transaction.    

problem in Transferring a large dataset to remote machine by using the NetTcpBinding

i am developing an WCF application, in which i have to transfer a large dataset to the remote machine!! for that im using nettcpbinding in WCF but i got this exception ' The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '10:29:59.4140000'. at my sender side.   Sender/Client side code   // Object for sending to remote client using (_dpParameters = new DPParameters()) { _dpParameters.SequenceFieldName = "Sequence"; _dpParameters.Size = 10; _dpParameters.SubjectsForFiles = "S,Y,T"; _dpParameters.SubjectNames.Equals(SubjectNames); _dpParameters.FilePath = " E:\\Source\\Phospho.xml"; // this dataset can be in GBs but for testing me using jst 6.78mb DataSet ds = new DataSet(); ds.ReadXml(_dpParameters.FilePath); _dpParameters.Usd = ds.Tables[0]; } /// This is the binding settings NetTcpBinding tcpBinding = new NetTcpBinding(); tcpBinding.ReceiveTimeout = new TimeSpan(10, 30, 00); tcpBinding.SendTimeout = new TimeSpan(10, 30, 00); tcpBinding.MaxBufferSize.Equals(67108864); tcpBinding.MaxBufferPoolSize.Equals(67108864); tcpBinding.MaxReceivedMessageSize.E

PERFMON: Cannot see SQL Server 2008 R2 64 bit instance counters from remote machine

Hi, I have 2 machines X and Y. I am using X machine to run perfmon which will remote connect to Y machine and collect the counters for Y machine. I am surprised to see that I am not able to see the counters for SQL Server 2008 R2 64 bit when I remote connect the perfmon on X machine to Y machine. However, when I directly log in to Y machine and open perfmon, I can see the counters for SQL Server 2008 R2 64 bit !! What is not allowing me to see those counters while connecting remotely? I have same adminstrator rights on both machine for my login and use same login details to log into both machines. Both machiens X and Y are in same network and same domain. Any help will be appreciated.

Execute process on remote machine from windows service



I am using Windows Management Instrumentation (WMI) to connect to a remote system. I am connecting to a remote system and executing an exe on the remote system. This works if it is a normal exe. I am passing the user name and the password as well.

But when I use the same code in a Windows Service, I get an error which says "Access is Denied." My requirement is to invoke the exe (every 2 hours) on client system from a windows service on the server.

My code looks like this:



processHandle As Integer
Dim connection

Execute process on remote machine from windows service



I am using Windows Management Instrumentation (WMI) to connect to a remote system. I am connecting to a remote system and executing an exe on the remote system. This works if it is a normal exe. I am passing the user name and the password as well.

But when I use the same code in a Windows Service, I get an error which says "Access is Denied." My requirement is to invoke the exe (every 2 hours) on client system from a windows service on the server.

My code looks like this:



processHandle As Integer
Dim connection

Remote copy and execution given admin username and password for remote machine



I have an application (.exe files) that I need to install on remote machine. For this I need to copy .exe file from my machine A remote machine B  and execute it remotely.

I have local administrative privilleges on remote machine.

For e.g. Username & password on remote machine : "remoteAdmin" , "remotePassword".

However this "remoteAdmin" account is not present in my local admin group on my machine A.

Is there a way to do this ?

Also on remote machine B firewall may be on or off.

I tried this using WMI but there were some issues due to firewall.

I can do this using File.Copy method of System.IO namespace but it needs "remoteAdmin" account to be present in my local machine's (A) Administrators group. I have even tried creating new user account and adding to admin goup using DirectoryServices but I don't know how to set domain for the new account.

Also for remote execution I tried using wmic but it did not work when firewall was on. Iteried remotely running notepad.exe. It works if firewall is off but I cannot assume that firewall would be always off.

So , is there a way to copy file and remotely execute them if I have admin username and password for remote machine ( preferable using C++ or C#) ?

 Also I cannot

Synchronizing schema from local development machine to remote web server


As a single developer in a small business I'm developing a data-driven website on my local machine using VS2008 Professional (I also have 2010 Professional)

It is then synchronised with a dedicated server using Expression Web (ditto design)

I'm using SqlExpress both machines and as features are added, I want to synchronize the dedicated server schema from the local schema

VS2010 has such a feature, but it's a ____ of a price to pay for one feature - basically adding fields as I add functionality.

I'm surprised SqlServer doesn't have such a feature built in - am I missing something?

(I've trialled RedGate SqlCompare, but it can't access the remote db, and I'm reluctant to enable SqlServer Remote Connections on a machine I don't own).


How to create SQL Database Backup on a remote machine through Backup Class provided by C#?


I need to take SQL database backup on a remote machine through C#. I am using Backup Class provided by Microsoft.SqlServer.Management.Smo namespace.

When I call SqlBackup function of Backup Class I get the following error:

Cannot open backup device '\\WKS-123\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\CalDBServer.bak'. Operating system error 53(The network path was not found.).
BACKUP DATABASE is terminating abnormally.

I have already shared folder \\WKS-123\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\ with "Full Control" permissions.

Please let me know if anybody has any idea regarding the error.





How to upload files to remote machine using FTP or other method in VB.Net 2005 (Windows Application)



I have to create an application to upload and download files using FTP.
Are there any classes, methods in VB.Net 2005(Windows Application) to do this?

I have created a small GUI for this.

It contains 4 text boxes - Path of Local file to be uploaded, IP address of remote machine, User name and password of remote machine At last there is one Transfer button when I click on this transfer button that file should get copied to the remote machine.


I tried this using FTPWebRequest class by reading example in msdn.

But to connect to remote machine it requires URI format of FTP and I only have IP address of that remote machine. I think there is no web server on that remote machine.

Should I need to install web server on that remote machine.

Or is there any other method to do upload files to remote machine ?


Slow Page draw on remote machine


I set up a Sharepoint 2010 site for development testing and it seems to be rendering pages slowly (about 8-9 seconds) when accessed remotely.  It seems to want to redraw the whole page almost every time.
On the sharepoint server itself, the pages render decently in the brower (1-2 seconds from link click).

Any ideas where to look?

It's a Hyper-V machine running a vanilla 2008 R2 Windows and SQL installation. 
The pages render slowely on the Hyper-V host machine as well as computers on the same network, so I've ruled out network latency.
I've also installed the MS "2010 Information Worker Demonstration and Evaluation Virtual Machine (RTM)" on the same host, with LESS RAM and LESS CPU resources than my machine, and it's contoso pages render fine (1-2 seconds) on the host and remotely.  So I've ruled out under powered.
The MS VHD has no output caching and no object caching and renders fine, so I haven't added it to mine (although I tried with no change in page draw time).
I tried a simple SharePoint Foundation install and I'm seeing the same thing (slow remote page draws)

Any leads would be appreciated.

problem in reading event logs of remote machine



I work on application which connects to remote machine and retrieves all event logs from it using EventLogReader and EventLogQuery classes.

I use the API EventLogReader.ReadEvent() for it. It works fine on all platforms except on Windows 7 machine. If I run my application on Windows 7 machine, EventLogReader.ReadEvent() throws an EventLogException with the error message - "The array bounds are invalid"

Have anyone faced this issue before? How I can overcome this problem and continue reading next event logs?

Please let me know.




AD qurey page does not work on remote machine...


First, I apologize if this has been answered somewhere, but I feel I have been searching forever.

I am trying to setup code that will allow me to pull a domain users first and last name from the AD.  I have the code working successfully from the server browser, but it will not work from a remote browser.  The error I get (when using 2-3 different versions of the code) is

Exception Details: System.DirectoryServices.DirectoryServicesCOMException: An operations error occurred.

I have Authentication set to Windows and Impersonation set to True.  Again, both sets of code work on the server, just not from any remote box.

The IIS server is set for Integrated Windows Authentication.

Here is one version of the code

Dim ADUser As System.DirectoryServices.AccountManagement.UserPri

How to Acess VSS from a remote Computer


i acess vss from lan with no problems and now i want acess from a remote computer not in a Lan

I need access over the Internet

What are settings i need to set up in the server and my client machine

VS2010 Professional .NET 4.0 Remote Debugging ASP Website Project


Trying to remote debug ASP website from VS2010 Pro to Windows Server 2003 machine.  Specifically, trying to debug a Web Service, but breakpoint says, "The breakpoint will not currently be hit. No symbols have been loaded for this document."  This happens for all compiled code though.  I have read this is due to missing PDB files and the work around is to manually copy them, as noted here.  Problem is, I cannot find any PDB files for my project, except referenced libraries, which I can remote debug.


  • web.config has <compilation debug="true">
  • Debugger is attached to wewp.exe process on remote server
  • Installed VS2010 remote debugger from DVD (as I can remote debug referenced libraries)

This is beyond frustrating.  I migrated my code from VS2008 .Net3.5 to VS2010 .Net4.0 to take advantage of the inherent multithreading framework.  Debugging works when using local host and was stable until deployment to test server.

Thanks in advance,


Wrong Account being used to access files - Help - No Impersonation


I run a simple .aspx website on a Windows Server 2008 machine.

There is NO impersonation, and System.Security.Principal.WindowsIdentity.GetCurrent().Name returns NT AUTHORITY\NETWORK SERVICE, which it the account which the application pool runs. In my web.config, I have <authentication mode="Forms">.


I tried to test the security of the application and server by removing file permissions to the .aspx files. I was greatly worried when the website continued to run without problem (it should not have been able to read the .aspx files).

By turning on file level auditing, I discovered that the .aspx files were being read by the machine$ account (if the machine is called Serv1, then the files would be read by the Serv1$ account, which seems to have access to all files on the local machine).


Is this a security breach or is this behaviour by design ?

Please can somebody assist, as I am worried.

How do I preserve __viewstate between cross domain posts or how do I get a __viewstate of a Remote S


Here is what I want to do:
I have a local site in which I want to display data from a remote site
Lets say: I want to display data of http://www.abc.com/Default.aspx on my localhost

Now Default.aspx requires some post-data which it sends to itself. Thus the __viewstate and __eventvalidation are posted back to it by itself. I want to directly post the data to Default.aspx from localhost without opening Default.aspx and display the Default.aspx's response on my localhost.

The WebApp on http://www.abc.com is configured for __eventvalidation i.e. I cannot post-data to it from my localhost without getting a __viewstate from it. I also have to post the current __viewstate of http://www.abc.com/Default.aspx to itself

How can I accomplish it?

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