Running powershell on remote machine

how do I run a script that is currently on my desktop to multiple remote machines? Does the script needs to be on the remote machine before it can be executed? wsman is already enabled on all remote machines

Hi Jon,
I’m writing to just check in to see if the suggestions were helpful. If you need further help, please feel free to reply this post directly so we will be notified to follow it up.
If you have any feedback on our support, please click here.
Best Regards,
Anna Wang
TechNet Community Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

Similar Messages

  • Install SQL Server 2012 SP1 on a Windows Server 2012 R2 Failover Cluster - hangs at "Running discovery on remote machine" on VMWare VSphere 5.5 Update 1

    <p>Hi,</p><p>I'm trying to install SQL Server 2012 SP1 on the first node of a Windows Server 2012 R2 failover cluster.</p><p>The install hangs whilst displaying the "Please wait while Microsoft SQL Server 2012 Servce
    Pack 1 Setup processes the current operation." message.</p><p>The detail.txt log file shows as follows:</p><p>(01) 2014-07-17 15:36:35 Slp: -- PidInfoProvider : Use cached PID<br />(01) 2014-07-17 15:36:35 Slp: -- PidInfoProvider
    : NormalizePid is normalizing input pid<br />(01) 2014-07-17 15:36:35 Slp: -- PidInfoProvider : NormalizePid found a pid containing dashes, assuming pid is normalized, output pid<br />(01) 2014-07-17 15:36:35 Slp: -- PidInfoProvider : Use cached
    PID<br />(01) 2014-07-17 15:36:35 Slp: Completed Action: FinalCalculateSettings, returned True<br />(01) 2014-07-17 15:36:35 Slp: Completed Action: ExecuteBootstrapAfterExtensionsLoaded, returned True<br />(01) 2014-07-17 15:36:35 Slp: ----------------------------------------------------------------------<br
    />(01) 2014-07-17 15:36:35 Slp: Running Action: RunRemoteDiscoveryAction<br />(01) 2014-07-17 15:36:36 Slp: Running discovery on local machine<br />(01) 2014-07-17 15:36:36 Slp: Discovery on local machine is complete<br />(01) 2014-07-17
    15:36:36 Slp: Running discovery on remote machine: XXX-XXX-01</p><p>After about 4 hours and 10 minutes, the step seems to time out and move on, however it doesn't seem to have discovered what it needs to and the setup subsuently fails</p><p></p>

    Hi,
    Sorry Information you provided did not helped can you post content of both summary file and details,txt file on shared location for analysis.
    Can you download Service pack again and try once more
    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it.
    My TechNet Wiki Articles

  • Checking for running applications on remote machines

    I am trying to check for application running on remote machine - it could be LV or some other application.
    I have Server and Client applications (developed in LV) running as .exe on separate computers. Only LV-Runtime is installed. They exchange data via Datasockets. The problem I have is that if Client is launched before the server the (Client) takes ownership of certain sockets which causes Server to fail on startup. All the remote Clients have to be shotdown before Server can be started again properly.
    I was wondering if anyone has run into a similar problem.

    Hi Slawek,
    I would suggest using Remote Front Panels in LabVIEW. Remote front panels allow you to view and control a VI front panel remotely, either from within LabVIEW or from within a web browser, by connecting to the LabVIEW built-in web server. There is a tutorial Developer Zone: Remote Panels in LabVIEW -- Distributed Application Development that will provide you with more information.
    Also, there are example programs in LabVIEW that walk you through how to programmatically connect to a remote front panel. Go to LabVIEW >> Help >> Find Examples >> Networking >> General >> RemotePanelMethods-Client/Server.vi.
    Hope
    this helps and good luck!
    Kileen C.
    Applications Engineer
    National Instruments

  • Run Powershell in remote computers

    Hi All,
    I want to run Powershell function in a remote computers in AD 
    Here are the steps that i take but i got some errors 
    * I Import the ADComputer from Active directory 
    Get-ADComputer -Filter * -Property * | Select-Object Name,OperatingSystem,OperatingSystemServicePack,OperatingSystemVersion | Export-CSV C:\Users\Administrator\Documents\AllWindows.csv -NoTypeInformation -Encoding UTF8
    *Then I create a script to run the function I got from net 
    $FilePath = "C:\Users\Administrator\Documents\AllWindows.csv"$ComputerName = Import-Csv -Path $FilePath -Delimiter ","foreach($CompName in $ComputerName){Invoke-Command -ComputerName $PSItem.Name -ScriptBlock ${function:Get-WindowsKey}}
    But when i run above gives the following error
    Invoke-Command : Cannot validate argument on parameter 'ComputerName'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.
    At C:\Users\Administrator\Desktop\GetWinKey.ps1:9 char:30
    + Invoke-Command -ComputerName $PSItem.Name -ScriptBlock ${function:Get-WindowsKey ...
    +                              ~~~~~~~~~~~~
        + CategoryInfo          : InvalidData: (:) [Invoke-Command], ParameterBindingValidationException
        + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.PowerShell.Commands.InvokeCommandCommand
    Following is the function i run to get windows keys
    function Get-WindowsKey {    ## function to retrieve the Windows Product Key from any PC    param ($targets = ".")    $hklm = 2147483650    $regPath = "Software\Microsoft\Windows NT\CurrentVersion"    $regValue = "DigitalProductId"    Foreach ($target in $targets) {        $productKey = $null        $win32os = $null        $wmi = [WMIClass]"\\$target\root\default:stdRegProv"        $data = $wmi.GetBinaryValue($hklm,$regPath,$regValue)        $binArray = ($data.uValue)[52..66]        $charsArray = "B","C","D","F","G","H","J","K","M","P","Q","R","T","V","W","X","Y","2","3","4","6","7","8","9"        ## decrypt base24 encoded binary data        For ($i = 24; $i -ge 0; $i--) {            $k = 0            For ($j = 14; $j -ge 0; $j--) {                $k = $k * 256 -bxor $binArray[$j]                $binArray[$j] = [math]::truncate($k / 24)                $k = $k % 24            }            $productKey = $charsArray[$k] + $productKey            If (($i % 5 -eq 0) -and ($i -ne 0)) {                $productKey = "-" + $productKey            }        }        $win32os = Get-WmiObject Win32_OperatingSystem -computer $target        $obj = New-Object Object        $obj | Add-Member Noteproperty Computer -value $target        $obj | Add-Member Noteproperty Caption -value $win32os.Caption        $obj | Add-Member Noteproperty CSDVersion -value $win32os.CSDVersion        $obj | Add-Member Noteproperty OSArch -value $win32os.OSArchitecture        $obj | Add-Member Noteproperty BuildNumber -value $win32os.BuildNumber        $obj | Add-Member Noteproperty RegisteredTo -value $win32os.RegisteredUser        $obj | Add-Member Noteproperty ProductID -value $win32os.SerialNumber        $obj | Add-Member Noteproperty ProductKey -value $productkey        $obj    }} 
    What i want is to run the Get-WindowsKey function in all AD computers 
    Thanks

    The error tells you what is wrong, try changing this -
    Invoke-Command -ComputerName $PSItem.Name to thisInvoke-Command -Computername $Compname.Name
    You need to use the variable you declare in the foreach loop.

  • To check whether a service is running in a remote machine

    My problem is to test whether a service is running in a
    machine or not.
    I have done a simple socket program.It just takes the IP and the port at which the service is supposed to run.
    My algo is to check whether it fails to make a connection or not.
    If there is a success the service is running.
    Is this
    sufficient???

    Technically there are more failure points (and presuming configuration failures are ignored.)
    If the connection is through a router/gateway then that could fail and the server/service could still be running.
    The service could be written in such a way that its functionality is handled in a seperate thread from the connection thread. And that thread blocks/stops. So the connection succeeds even though the service is in a failure state.

  • How to run Labview exectuable on remote machine?

    I am trying to use VI Server to launch a built Labview application (.exe) residing on a remote PC from a CRIO.  I need to run this .exe programmatically and I would like to do this with only the LV Run-Time Engine installed on the remote PC (Windows XP).  I am currently able to do this successfully, but only if I have the LV Development Enviroment splash screen is open on teh remote PC.  I assume this has somehting to do with the LV VI Server not running when the LV DE is closed. 
    I have also tried to build a dummy LV application that runs on the remote machine indefinitely (infinite while loop) hoping this would initiate the VI Server but it doesn't seem to work either, I get Error 63.
    Anyone done this before?
    Thanks
    Dan

    Thanks, I've seen this one already.  I will be using a CRIO as my host so I believe ActiveX cannot be used to launch Labview on the remote PC.
    I have been troubleshooting this issue bu using a PC (Win XP) for my host and client.  I have managed to get a Labview application to run as a Windows service on my remote PC and this application runs an inifinte while loop.  But even with this application running I receive Error 66 while trying to open an application reference to a VI on the client PC form the host PC.  Everyhting works fine if I have the LV splash screen open on the remote machine though. 

  • How to execute a shell script which is present in remote machine using ODI

    I have requirement of executing a batch (shell script) which is present in the remote machine.
    i have an ODI agent in remote machine as well. I have created agent locally by using the remote machine IP and port.
    I am able to test the agent successfully. But when i am executing the package using that agent it is failing with the following error
    errorODI-1226: Step Execution of the Scenario REMOTE_DEMO version 001 fails after 1 attempt(s).
    ODI-1241: Oracle Data Integrator tool execution fails.
    Caused By: oracle.odi.runtime.agent.invocation.InvocationException: HTTP/1.1 500 ODI-1423: Warning connecting to Agent localagent: work repository WORKREP1 is not bound to the master
    My Work Repository Name is : WORKREP1
    Remote Work Repository Name is:WORKREP_LOCAL.
    Could anyone please help me regarding this.
    I can't download shell script and run it locally this needs to be run on that remote machine only.
    Thanks
    senthilkumar

    This is the code.
    1. we can declare types dynamically
    2. Internal table dynamically
    3. Select querry dynamically
    just copy paste this code
    Here is the code for your question
    DATA:v_fieldname
    TYPE fieldname,
    l_PROG TYPE string,
    v_mess TYPE string,
    l_sid TYPE string,
    wa_ddfields TYPE dntab.
    DATA i_tab TYPE STANDARD TABLE OF string.
    DATA:l_str TYPE string,
    l_str1 TYPE string.
    PARAMETERS matnr type marc-matnr.
    end-of-SELECTION.
    *build the subroutine pool
    APPEND 'PROGRAM subpool.' TO i_tab.
    APPEND `LOAD-OF-PROGRAM.` TO i_tab.
    APPEND `DATA i_tab1 TYPE TABLE OF vbak.`      TO i_tab.
    APPEND `DATA l_rows TYPE i.`      TO i_tab.
    APPEND `select * into table i_tab1 from vbak.` To i_tab.
    append 'DESCRIBE TABLE i_tab1 LINES l_rows.' to i_tab.
    append 'Write :  l_rows .' to i_tab.
    GENERATE SUBROUTINE POOL i_tab NAME l_PROG
    MESSAGE v_mess
    SHORTDUMP-ID l_sid.
    IF sy-subrc = 0.
    PERFORM ('LOOP_AT_TAB') IN PROGRAM (l_PROG) IF FOUND.
    ELSEIF sy-subrc = 4.
    MESSAGE v_mess TYPE 'I'.
    ELSEIF sy-subrc = 8.
    MESSAGE l_sid TYPE 'I'.
    ENDIF.
    Edited by: vijay wankhade on Jan 1, 2009 5:34 PM
    Edited by: vijay wankhade on Jan 1, 2009 5:34 PM

  • How to start/stop/restart a java desktop application from remote machine

    Hi,
    I want to know is there a way in java where i can start/stop/restart a java desktop application running on a remote machine through another java desktop application?
    For e.g i have an Admin console which monitors its clients based on socket communication, all of them are java desktop applications. I want to also give start/stop remote clients through my Admin console.
    I am thinking in terms of windows system service which can start/restart/stop my clients on request of Admin console, but how can i call this system service remotely?
    How can i do it?

    I got it. its about connection...

  • Compiling based on variable remote machine

    I am having great trouble getting a script to compile based on a repeat loop from a record. The script compiles fine if the finder actions are something simple like a beep but when I put in my required actions it fails to compile.
    I think the problem is related to how I refer to the "of machine ....." but can't work out why it is related to my finder actions...
    Any help much appreciated.
    set catlist to {{catname:"Ollie", catip:"eppc://192.168.1.12", ssdDrive:":Volumes:Cat109 Content A:"}, {catname:"Richard", catip:"eppc://192.168.1.13", ssdDrive:":Volumes:Cat109 Content A:"}}
    repeat with cat_ref in catlist
    set theMachine to catip of cat_ref
    with timeout of 10 seconds
    tell application "Finder" of machine theMachine
    activate
    set sourceFile1 to document file "001_Sahr.mov" of folder "096-Act 1 - Club shots" of folder "Cast Rotation" of folder "SSD" of disk "Cat109 Content A"
    set destinationFile1 to folder "096-Act 1 - Club shots" of folder "Active" of disk "Cat109 Content A"
    duplicate sourceFile1 to destinationFile1 with replacing
    set foldercontents1 to result
    end tell
    end timeout
    end repeat

    There are many issues to deal with when using remote Apple Events, especially with regard to user permissions/access. In general you can't easily target an application on a remote machine that's running as a different user (e.g. you're logged in as 'joe', but the 'bob' is logged in the remote machine - 'joe' can't tell 'bob's Finder what to do.
    Once you address that issue, please never, ever, ever do this:
    tell application "Finder" of machine theMachine
      activate
    Imagine you're bob running on the remote machine, in the middle of writing a document, editing an image, browsing the web - it doesn't really matter - when all of a sudden, without any notice or warning, the Finder pops to the front for no apparent reason. Aaagghhhh! How annoying would that be?
    There is rarely, if ever, any need to activate the Finder. If it's running, even in the background, you can send it commands and it will do what you ask. It does not have to be frontmost to do so.
    That said, I'd take a slightly different approach to your task and eschew the Finder altogether. A shell command is probably an easier way to achieve what you're trying here:
    tell application "System Events" of machine theMachine
      do shell script "cp -r '/Cat109 Content A/SSD/Cast Rotation/096-Act 1 - Club shots/001_Sahr.mov' '/Cat109 Content A/Active/096-Act 1 - Club shots/'"
    end tell

  • Run commands on remote Hyper-V host in different domain/network with powershell

    Hi experts,
    My Setup: Windows Server 2012 R2 / SCVMM 2012 managing localhost and other Hyper-V hosts
    I need to run a script on the remote Hyper-V Host which is in different domain/workgroup using powershell.
    I have tried
    Invoke-SCScriptcommand cmdlet. But I am getting the below error
    Error (2917)
    Virtual Machine Manager cannot process the request because an error occurred while authenticating MY-PC-15.mydomain.local. Possible causes are:
    1) The specified user name or password are not valid.
    2) The Service Principal Name (SPN) for the remote computer name and port does not exist.
    3) The client and remote computers are in different domains and there is not a two-way full trust between the two domains.
    The network path was not found (0x80070035)
    I tried the 'Run Script Command' option in the Host tab in VMM. But getting the same error.
    Checked that it uses the 'Invoke-ScScriptcommand' PS cmdlet.
    Could someone explain how to run scripts on remote Hyper-V host in different Domain/Perimeter network ?
    Regards,
    Saleem

    Hi Saleem,
    Please try to follow the article below to regarding using command "enter-pssession" across domains :
    https://social.technet.microsoft.com/Forums/windowsserver/en-US/f60a29ef-925e-4712-9788-1f95e12c8cfc/forum-faq-introduce-windows-powershell-remoting?forum=winserverpowershell
    (I tested it in my lab )
    Best Regards,
    Elton Ji
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected] .

  • How to run a PS script on a remote machine

    Hi,
    I have a script located on a remote machine at c:\Temp\Script1.ps1  I want to run this script remotely from a driver system.  Via Powershell remoting on the driver machine, I run the following:
    $cred = Get-Credential Domain1\User1
    $Sessid = New-Pssession DC1
    Invoke-Command -session $sessid -cred $cred -ScriptBlock {c:\temp\Script1.ps1}
    I get an error 'Invoke-Command : Parameter set cannot be resolved using the specified named parameters.
    I see the Session ID created and opened fine and the script runs fine on its own on the remote machine.
    Any suggestions as to how to resolve the error
    Thanks for your help! SdeDot

    You don't say what the client machine is, but if it is a windows PC you could use the TEXT_IO package that comes as part of Oracle Forms or procedure builder. Alternatively you could use the client version of SQL*Loader. If neither of these options are feasible, why not just copy the file on to the server and use UTL_FILE, SQL*Loader, or define an extrnal table?
    Regards,
    Steve Rooney

  • Running a J2EE client on a Remote machine

    How do you run a J2EE client application on a remote machine?

    and what about running on remote client .
    the things i know is , ok leave i am pasting a client which is on different machine (i.e not on the machine on which the server is ) copy
    1. the client jar file which is return when u deploy the beans .
    * Remember to add jar path in the class path
    2. client class / java file on the remote client
    and then run the client
    for eg . client code
    change Properties 's prop accoding to u
    import javax.ejb.*;
    import javax.naming.*;
    import java.rmi.*;
    import javax.rmi.PortableRemoteObject;
    import java.util.*;
    public class TestClient {
    public static void main(String[] args) {
    try {
         System.out.println("IDFactory");
         Properties prop = new Properties();
         /* prop.put("org.omg.CORBA.ORBInitialHost","192.168.10.5");
         prop.put("org.omg.CORBA.ORBInitialPort","1050");
         prop.put(Context.PROVIDER_URL, "iiop://192.168.10.5:1050");
         prop.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.cosnaming.CNCtxFactory");
         InitialContext initial = new InitialContext(prop);
         Object objref = initial.lookup("TimeReport/Data/TestHome");
         TestHome home = (TestHome)PortableRemoteObject.narrow(objref,TestHome.class);
         System.out.println("looking up IDFactory Session Bean");
         Test TestRemote = home.create();
         System.out.println("IDFactory Created ");
         long roleID = TestRemote.getID("TR_ROLE","Role_ID");
         System.out.println("RoleID is " + roleID);
         TestRemote.remove();
         } catch (Exception ex)
         System.err.println("Caught an unexpected exception!" + ex.getMessage());
         ex.printStackTrace();
    if it works then let know on [email protected]
    cheers
    Deepak Sumani

  • Update-Help error when console application is run in remote machine via PS remoting

    Hello,
    When I execute a particular console application in a remote machine via PS remoting, I get an error related to update-help. When I execute it directly on the remote machine, it works...
    My code:
    $credential = Get-Credential -Credential "DomainName\AccountName"
    $session = New-PSSession -ComputerName "MachineName" -Authentication Credssp -Credential $credential;
    Invoke-Command -session $session -ScriptBlock {
    try{
    cd <network share location>
    .\theConsoleApp.exe | Out-File C:\console-output.txt
    $error | Out-File C:\console-error-output.txt
    $exitCode
    } catch {
    throw $error
    Error seen in the console:
    NetNat, PcsvDevice, PSDesiredStateConfiguration, SoftwareInventoryLogging, StartScreen, TLS, WindowsSearch' with UI culture(s) {en-US} : Unable to retrieve the HelpInfo XML file for
    UI culture en-US. Make sure the HelpInfoUri property in the module manifest is valid or check your network connection and then try the command again.
    $error variable from above:
    Errored out (exit code 1603) with error message: ErrorId 10010: Xpatch threw an unexpected exception: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
    I’ve tried
    two different user accounts
    multiple file share locations
    different OSs
    different target servers
    but have not determined the cause of the error.
    I would appreciate any help on this.
    -Rohan.

    Clearly the remote EXE cannot run in that context.  YOU should not run that program remotely.
    I suspect there is also information you are not giving to us.
    ¯\_(ツ)_/¯

  • How to test oracle is up and running in remote machine using shell script

    Hello,
    I need help to write an linux script.
    I have a java application server running on machine 192.168.5.20 and our oracle 10g standard 1.0.2 is running on machine 192.168.5.21.
    I have found script to start oracle when computer is turned on.
    But I cannot start my application server automatically since it depends on whether oracle is up and running or not on the remote machine.
    Therefore, in case of power failure or maintenance, our client has to call us to start application server.
    I would be grateful if someone can help me "How can I write script to check oracle is up and running in machine 192.168.5.21 from machine 192.168.5.20.
    For your information, I have no oracle installed in application server. So tnsping won't work.
    What I want is when power is back, application server script automatically and tesing for oracle server is up and running. If it is up, script will start application server.
    Thanking you.

    Hi,
    It's not failover or experimental. My application server uses JBOSS and JBOSS needs database name to start up. My enviroment is LAN. My database is in different machine as I mentioned before. So In case of power failure, I need to start my application server (JBoss) manually, because I need to confirm that oracle is already running before start app server.
    I want an automated script (when power is just on) to start my application server which will wait to check if the datbase server is up I will start application server.
    The scripts given above It works if appserver and db server in the same machine (my development machine).
    But when I test the script in my production applicaiton server, It shows sqlplus command not found (my app server does not have any oracle client installed).
    About hostname yes My applicaiton server hostname is hostapp1 and dabase server hostname is hostdat1.
    Do you think Is it possible to test the script without oracle client not installed. or It has to be done writing code like java program and test using jdbc connection.
    Best regards.

  • How to make OTM scripts to run on remote machines

    Hi,
    I came across lot of posts which tells how to configure OTM to connect to remote machines.
    Some how i dont understand when they say stop the OATS service and configure it manually
    Also to use the password for authentication manager.
    What i really want to know is step by step for a layman to set up OTM to run scripts on a remote desktop and on the local with the execution being displayed (not suppressed)
    How do we configure that?
    Any help is deeply appreciated!! my test cases are just stuck inprogress status
    Thanks
    Radhika

    Hi Radhika,
    For running Scripts from either the server or the remote machine using OTM you need to run the Agent Manager service as a console not the OATS service. For that you need to stop that service--> set the startup type as manual--> the run the ' C:\OracleATS\agentmanager\bin\AgentManagerService.exe –c AgentManagerService.conf ' command in the CMD to run this service as a console. Because this agent manager service is for OLT to communicate with its agents and works fine even if it is set to automatic or manual and started normally. Hope this helps.....
    Regards,
    Charles Kingsly

Maybe you are looking for

  • Verizon is harassing me, how do I get them to stop?????

    I'm at my wits end.  I've tried everything.  This is my last attempt to find some kind of solution before I resort to the expense of a lawyer. Apparently at some point in the mists of the past, a person who worked in my building used my number as an

  • Hard Drives not sleeping SystemUIServer Hangs

    I have been having problems with SystemUIServer “Hanging” when I used either my scanner or digital card reader which are both connected via FireWire. USB devices didn’t do this. You could see that it was Hanging in the Activity Monitor window. I was

  • Error Compiling Movie  Unknown Error

    Greetings, I have been trying to pinpoint a problem I have been having rendering sequences in CS5.5.1. I am currently shooting AVCHD 1080p/23.976 using Adobe Sequences Settings that match. I get this error on various projects. My workflow preference

  • I can't drag and drop or add to library for dvd's that I converted with Bootstrap VideoWizard All-in-one app.  hep!

    i purchased Bootstrap VideoWizard all-in-one edition and converted my homemade Dvds, but I can't drag and drop the converted files into iTunes or use iTunes file - add to library to add them to iTunes so I can sync them onto my iPad 1.  What am I doi

  • I-Mac G4 to TV (connection)

    I just inherited a Imac G4 and I want to connect it to my TV using HDMI. It looks like I need a DVI to HDMI, and the cable I bought looks right, but doesn't seem to fit. What cable to I need? This is the one I originally bought: http://www.cablewhole