.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

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

Posted By:      Posted Date: October 08, 2010    Points: 0   Category :.NET Framework


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

View Complete Post

More Related Resource Links

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.

remote execution of ssis package using wcf doesn't like date parameter


I have a ssis package remotely executed by a C# windows application that runs ok in context of SSIS installed on the desktop; I created a wcf windows service that the C# application executes, creates a copy of the package with the date in the variable, but errors on the first SQL task component that requires the date. The copy executes using the SSIS utility. What is possibly the issue with wcf and the date type in the SSIS package? Here is the error:

OnError,SRVR2BLADEA3,MIC\1347259,Clear CII ImportDate,{AB3CF5BA-C114-40F6-9ECB-4C7620D97829},{8B1C10CB-580F-4BFE-BC7D-0B97C181E307},9/27/2010 3:29:56 PM,9/27/2010 3:29:56 PM,-1073548784,0x,Executing the query "" failed with the following error: "The type initializer for '<Module>' threw an exception.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

Here is the code:

case @"E:\SSIS Packages\CIISCImport.dtsx":

//string dtValue = (prms[iPrms - 1].Split('=').GetValue(1).ToString()) + " 12:00";

vars["User::ImportDate"].Value = DateTim

problem with worklow - update remote copy


hi, I have downloaded a worklow form here http://wssactivities.codeplex.com/

I just cant seem to update item  into another site, I keep getting the below errors

Value does not fall within the expected range.    at Microsoft.SharePoint.SPList.GetItemById(Int32 id, String strRootFolder, Boolean cacheRowsetAndId)
   at Microsoft.SharePoint.SPList.GetItemById(Int32 id)
   at MyLocalBroadband.Activities.WSS.Utilitie




Hello all.. 


I have a simple DTSX package that takes a CSV file and loads it into a table in SQL Server 2008 Ent. x64 bit (on 2008 Ent. Server).  The package runs well when DTEXEC is executed locally on the server which it resides on.  I run into trouble when I try to execute the package using PSExec like so:

C:\>c:\pstools\psexec \\myservr -u "mydom\myuser" -p "mypass" dtexec /FILE "X:\ETL\packages\test1.dtsx" /CHECKPOINTING OFF  /REPORTING EW /DECRYPT mykey


The package encryption is set to "EncryptAllWithPassword", which I supply along with DTEXEC "/decrypt" attribute.  The error I am getting is "SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER.  The AcquireConnection method call to the connection manager "MyDB" failed with error code 0x80004005. There may be error messages posted before this with more information on why the AcquireConnection method call failed."


When the package is executed locally, the user connection properties are exactly the same (Windows Authenticated connection, using an administrative account).  The account specified in the SSIS log below (mydom\myuser - modifi

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

VWD 2010: Copy Web Fails if File Exists on Remote Site



I just started using VWD 2010 and I used Copy Web to upload the site to the server. However, whenever I try to upload a new version of a file that I've already uploaded, the upload fails, with this error in the log (as an example):

Copy from 'C:\Users\Lou\Documents\Visual Studio 2010\WebSites\genusus10\tools' to '' started at 10/6/2010 4:00:33 PM.
            Copy file password.aspx.vb from source to remote Web site.
            Has error -- Unable to add 'tools/password.aspx.vb' to the Web site.  The file tools/password.aspx.vb has been modified by (unknown) on 06 Oct 2010 11:45:33 -0500.

Copy from 'C:\Users\Gen\Documents\Visual Studio 2010\WebSit

copy a folder and subfolders + files from remote location to local drive



i am making a windows application( C#.Net) in which there is a folder placed at remote location( on other computer). this folder contains files + subfolders inside it. i need to copy all the files and subfolders present inside this main folder to my local drive. How can i do this. 

Thanks in advance

how to remote copy ?


how to copy a small file to remote computer from network ?

(i want to remote file Invisible (hidely))

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 ?


Impersonation Issues on remote machine


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

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.




howto access remote shared folder using remote login and password ?



I want to write some piece of code in C# to access (create directory, create files) on a remote shared folder (stored in a remote machine), but using a specific remote user and password (a user defined in the remote machine) but not defined on the local machine where my piece of code is to be run.

I can do that using the explorer: if I type \\remoteserver for exemple, I can then give a login as remoteserver\remoteuser and the password of this remoteuser to access the shared folder (the permission has been set on the remote shared folder to authorize full permission for this user)

Plesae tell me if it is possible and how I can do that using the base .NET framwork library (or any extension of 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