How to run .exe application in remote system from your system

Guys,

Wondered how to run an application that existed somewhere remotely from here in your command prompt?

Its literally simple..lets see how we can do that..

Foremost you need to know what is windows sysinternals??

Please visit this site to know more

Steps:

1. Download it and extract the files. Now you can see list of files like below referred image

28-03-2014 13-15-16

2. Now copy these files to C:\Windows\System32

3. Now open cmd(in administrator mode) and type the following

psexec -i -s -d \\10.10.11.123 -u domain\username -p password notepad  \\ this opens notepad

psexec -i -s -d \\10.10.11.123 -u domain\username -p password calc        \\ this opens calculator

Explanation on usage:

Usage: psexec [\\computer[,computer2[,…] | @file]][-u user [-p psswd][-n s][-r servicename][-h][-l][-s|-e][-x][-i [session]][-c [-f|-v]][-w directory][-d][-<priority>][-a n,n,…] cmd [arguments]

-a Separate processors on which the application can run with commas where 1 is the lowest numbered CPU. For example, to run the application on CPU 2 and CPU 4, enter: “-a 2,4”
-c Copy the specified program to the remote system for execution. If you omit this option the application must be in the system path on the remote system.
-d Don’t wait for process to terminate (non-interactive).
-e Does not load the specified account’s profile.
-f Copy the specified program even if the file already exists on the remote system.
-i Run the program so that it interacts with the desktop of the specified session on the remote system. If no session is specified the process runs in the console session.
-h If the target system is Vista or higher, has the process run with the account’s elevated token, if available.
-l Run process as limited user (strips the Administrators group and allows only privileges assigned to the Users group). On Windows Vista the process runs with Low Integrity.
-n Specifies timeout in seconds connecting to remote computers.
-p Specifies optional password for user name. If you omit this you will be prompted to enter a hidden password.
-r Specifies the name of the remote service to create or interact with.
-s Run the remote process in the System account.
-u Specifies optional user name for login to remote computer.
-v Copy the specified file only if it has a higher version number or is newer on than the one on the remote system.
-w Set the working directory of the process (relative to remote computer).
-x Display the UI on the Winlogon secure desktop (local system only).
-priority Specifies -low, -belownormal, -abovenormal, -high or -realtime to run the process at a different priority. Use -background to run at low memory and I/O priority on Vista.
computer Direct PsExec to run the application on the remote computer or computers specified. If you omit the computer name, PsExec runs the application on the local system, and if you specify a wildcard (\\*), PsExec runs the command on all computers in the current domain.
@file PsExec will execute the command on each of the computers listed in the file.
cmd Name of application to execute.
arguments Arguments to pass (note that file paths must be absolute paths on the target system).
-accepteula This flag suppresses the display of the license dialog.

You can enclose applications that have spaces in their name with quotation marks e.g.

psexec \\marklap”c:\long name app.exe”

The following command launches an interactive command prompt on \\marklap:

psexec \\marklap cmd

This command executes IpConfig on the remote system with the /all switch, and displays the resulting output locally:

psexec \\marklap ipconfig /all

This command copies the program test.exe to the remote system and executes it interactively:

psexec \\marklap -c test.exe

Specify the full path to a program that is already installed on a remote system if its not on the system’s path:

psexec \\marklap c:\bin\test.exe

Run Regedit interactively in the System account to view the contents of the SAM and SECURITY keys::

psexec -i -d -s c:\windows\regedit.exe

To run Internet Explorer as with limited-user privileges use this command:

psexec -l -d “c:\program files\internet explorer\iexplore.exe”

Advertisements

What are webservices

In simple words, webservices will establish a good mode of communication with other servers. Lets say like this, we have temperature widgets everywhere(android,ios,windows etc etc). Now you want to display temperature in your widgets..will you code everywhere to show the temperature? its a very bad idea..instead you can easily call up some webservices through api’s where your api will contact to yahoo temperature server and display temperature. Here yahoo server will have a kind of method in public where receives parameters from different clients and then process and send back responses to the websites through webservices. This is how webservices will work..the same procedure will follow for cricket score updates, currency updates etc etc. Hope this is clear to get an basic idea of webservices..

web service is a method of communication that allows two software systems to exchange this data over the internet. The software system that requests data is called a service requester, whereas the software system that would process the request and provide the data is called a service provider.

Different software might be built using different programming languages, and hence there is a need for a method of data exchange that doesn’t depend upon a particular programming language. Most types of software can, however, interpret XML tags. Thus web services can use XML files for data exchange.

Rules for communication between different systems need to be defined, such as:

  • How one system can request data from another system
  • Which specific parameters are needed in the data request
  • What would be the structure of the data produced. Normally, data is exchanged in XML files, and the structure of the XML file is validated by an .xsd file.
  • What error messages to display when a certain rule for communication is not observed, to make troubleshooting easier

All of these rules for communication are defined in a file called WSDL (Web Services Description Language), which has the extension .wsdl.

Web services architecture: the service provider sends a WSDL file to UDDI. The service requester contacts UDDI to find out who is the provider for the data it needs, and then it contacts the service provider using the SOAP protocol. The service provider validates the service request and sends structured data in an XML file, using the SOAP protocol. This XML file would be validated again by the service requester using an XSD file.

A directory called UDDI (Universal Description, Discovery and Integration) defines which software system should be contacted for which type of data. So when one software system needs one particular report/data, it would go to the UDDI and find out which other system it can contact for receiving that data. Once the software system finds out which other system it should contact, it would then contact that system using a special protocol called SOAP (Simple Object Access Protocol). The service provider system would first of all validate the data request by referring to the WSDL file, and then process the request and send the data under the SOAP protocol.

XML Schemas

XML Schema

XML Schema is an XML-based alternative to DTD:

In general words its used to validate the XML code..for eg we need to validate some data that is in xml format before we store into our DB. Validation might include syntax, tags, data types etc. Then how you will validate it? Here comes the XML Schema..

<xs:element name=”note”><xs:complexType>
<xs:sequence>
<xs:element name=”to” type=”xs:string”/>
<xs:element name=”from” type=”xs:string”/>
<xs:element name=”heading” type=”xs:string”/>
<xs:element name=”body” type=”xs:string”/>
</xs:sequence>
</xs:complexType></xs:element>

The Schema above is interpreted like this:

  • <xs:element name=”note”> defines the element called “note”
  • <xs:complexType> the “note” element is a complex type
  • <xs:sequence> the complex type is a sequence of elements
  • <xs:element name=”to” type=”xs:string”> the element “to” is of type string (text)
  • <xs:element name=”from” type=”xs:string”> the element “from” is of type string
  • <xs:element name=”heading” type=”xs:string”> the element “heading” is of type string
  • <xs:element name=”body” type=”xs:string”> the element “body” is of type string

Everyting is wrapped in “Well Formed” XML.

XML Schemas are More Powerful than DTD

  • XML Schemas are written in XML
  • XML Schemas are extensible to additions
  • XML Schemas support data types
  • XML Schemas support namespaces

Why Use an XML Schema?

With XML Schema, your XML files can carry a description of its own format.

With XML Schema, independent groups of people can agree on a standard for interchanging data.

With XML Schema, you can verify data.

XML Schemas Support Data Types

One of the greatest strength of XML Schemas is the support for data types:

  • It is easier to describe document content
  • It is easier to define restrictions on data
  • It is easier to validate the correctness of data
  • It is easier to convert data between different data types

 

More about XML Schemas:

In a typical project many schemas will be created. The schema designer is then confronted with this issue: “shall I define one targetNamespace for all the schemas, or shall I create a different targetNamespace for each schema, or shall I have some schemas with no targetNamespace?” What are the tradeoffs? What guidance would you give someone starting on a project that will create multiple schemas?

Here are the three design approaches for dealing with this issue:

     [1] Heterogeneous Namespace Design: 
         give each schema a different targetNamespace
     [2] Homogeneous Namespace Design:
         give all schemas the same targetNamespace
     [3] Chameleon Namespace Design: 
         give the "main" schema a targetNamespace and give no 
         targetNamespace to the "supporting" schemas (the no-namespace supporting 
         schemas will take-on the targetNamespace of the main schema, just
         like a Chameleon)

To describe and judge the merits of the three design approaches it will be useful to take an example and see each approach “in action”.

Example: XML Data Model of a Company

Imagine a project which involves creating a model of a company using XML Schemas. One very simple model is to divide the schema functionality along these lines:

Company schema
   Person schema
   Product schema

“A company is comprised of people and products.”

Here are the company, person, and product schemas using the three design approaches.

[1] Heterogeneous Namespace Design

This design approach says to give each schema a different targetNamespace. Below are the three schemas designed using this design approach. Observe that each schema has a different targetNamespace.

Product.xsd

<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            targetNamespace="http://www.product.org"
            xmlns="http://www.product.org"
            elementFormDefault="unqualified">
    <xsd:complexType name="ProductType">
        <xsd:sequence>
           <xsd:element name="Type" type="xsd:string"/>
        </xsd:sequence>
    </xsd:complexType>
</xsd:schema>

Person.xsd

<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            targetNamespace="http://www.person.org"
            xmlns="http://www.person.org"
            elementFormDefault="unqualified">
    <xsd:complexType name="PersonType">
        <xsd:sequence>
           <xsd:element name="Name" type="xsd:string"/>
           <xsd:element name="SSN" type="xsd:string"/>
        </xsd:sequence>
    </xsd:complexType>
</xsd:schema>

Company.xsd

<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            targetNamespace="http://www.company.org"
            xmlns="http://www.company.org"
            elementFormDefault="unqualified"
            xmlns:per="http://www.person.org"
            xmlns:pro="http://www.product.org">
    <xsd:import namespace="http://www.person.org"
                schemaLocation="Person.xsd"/>
    <xsd:import namespace="http://www.product.org"
                schemaLocation="Product.xsd"/>
    <xsd:element name="Company">
        <xsd:complexType>
            <xsd:sequence>
                <xsd:element name="Person" type="per:PersonType" 
                             maxOccurs="unbounded"/>
                <xsd:element name="Product" type="pro:ProductType" 
                             maxOccurs="unbounded"/>
            </xsd:sequence>
        </xsd:complexType>
    </xsd:element>
</xsd:schema>

Note the three namespaces that were created by the schemas:

   http://www.product.org
   http://www.person.org
   http://www.company.org

[2] Homogeneous Namespace Design

This design approach says to create a single, umbrella targetNamespace for all the schemas. Below are the three schemas designed using this approach. Observe that all schemas have the same targetNamespace.

Product.xsd

<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            targetNamespace="http://www.company.org"
            xmlns="http://www.product.org"
            elementFormDefault="qualified">
    <xsd:complexType name="ProductType">
        <xsd:sequence>
           <xsd:element name="Type" type="xsd:string"/>
        </xsd:sequence>
    </xsd:complexType>
</xsd:schema>

Person.xsd

<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            targetNamespace="http://www.company.org"
            xmlns="http://www.person.org"
            elementFormDefault="qualified">
    <xsd:complexType name="PersonType">
        <xsd:sequence>
           <xsd:element name="Name" type="xsd:string"/>
           <xsd:element name="SSN" type="xsd:string"/>
        </xsd:sequence>
    </xsd:complexType>
</xsd:schema>

Company.xsd

<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            targetNamespace="http://www.company.org"
            xmlns="http://www.company.org"
            elementFormDefault="qualified">
    <xsd:include schemaLocation="Person.xsd"/>
    <xsd:include schemaLocation="Product.xsd"/>
    <xsd:element name="Company">
        <xsd:complexType>
            <xsd:sequence>
                <xsd:element name="Person" type="PersonType"
                             maxOccurs="unbounded"/>
                <xsd:element name="Product" type="ProductType"
                             maxOccurs="unbounded"/>
            </xsd:sequence>
        </xsd:complexType>
    </xsd:element>
</xsd:schema>

Note that all three schemas have the same targetNamespace:

   http://www.company.org

Also note the mechanism used for accessing components in other schemas which have the same targetNamespace: <include>. When accessing components in a schema with a different namespace the <import> element is used, as we saw above in the Heterogeneous Design.

[3] Chameleon Namespace Design

This design approach says to give the “main” schema a targetNamespace, and the “supporting” schemas have no targetNamespace. In our example, the company schema is the main schema. The person and product schemas are supporting schemas. Below are the three schemas using this design approach:

Product.xsd (no targetNamespace)

<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            elementFormDefault="qualified">
    <xsd:complexType name="ProductType">
        <xsd:sequence>
           <xsd:element name="Type" type="xsd:string"/>
        </xsd:sequence>
    </xsd:complexType>
</xsd:schema>

Person.xsd (no targetNamespace)

<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            elementFormDefault="qualified">
    <xsd:complexType name="PersonType">
        <xsd:sequence>
           <xsd:element name="Name" type="xsd:string"/>
           <xsd:element name="SSN" type="xsd:string"/>
        </xsd:sequence>
    </xsd:complexType>
</xsd:schema>

Company.xsd (main schema, uses the no-namespace-schemas)

<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            targetNamespace="http://www.company.org"
            xmlns="http://www.company.org"
            elementFormDefault="qualified">
    <xsd:include schemaLocation="Person.xsd"/>
    <xsd:include schemaLocation="Product.xsd"/>
    <xsd:element name="Company">
        <xsd:complexType>
            <xsd:sequence>
                <xsd:element name="Person" type="PersonType" 
                             maxOccurs="unbounded"/>
                <xsd:element name="Product" type="ProductType"
                             maxOccurs="unbounded"/>
            </xsd:sequence>
        </xsd:complexType>
    </xsd:element>
</xsd:schema>

There are two things to note about this design approach:

First, as shown above, a schema is able to access components in schemas that have no targetNamespace, using <include>. In our example, the company schema uses the components in Product.xsd and Person.xsd (and they have no targetNamespace).

Second, note the chameleon-like characteristics of schemas with no targetNamespace:

  • The components in the schemas with no targetNamespace get namespace-coerced. That is, the components “take-on” the targetNamespace of the schema that is doing the <include>
    • For example, ProductType in Products.xsd gets implicitly coerced into the company targetNamespace. This is the reason that the Product element was able to reference ProductType in the default namespace using type=”ProductType”. Ditto for the PersonType in Person.xsd.

“Chameleon effect” … This is a term coined by Henry Thompson to describe the ability of components in a schema with no targetNamespace to take-on the namespace of other schemas. This is powerful!