remote install with csv

Welcome Forums General PowerShell Q&A remote install with csv

Viewing 9 reply threads
  • Author
    Posts
    • #262481
      Participant
      Topics: 1
      Replies: 4
      Points: 22
      Rank: Member

      hello

      im new to powershell

      im looking for the simplest way to remotely install an exe to computers listed in a csv file

      from my local machine

      i ran this script with no errors but it didnt do anything either :

      all the computers in the csv file are under “name”

       

      thanks!

      • This topic was modified 2 weeks ago by kvprasoon. Reason: code formatting
    • #262622
      Moderator
      Topics: 5
      Replies: 244
      Points: 1,368
      Helping Hand
      Rank: Community Hero
      Hi @wicked74
      Couple of changes that you need to do…
      If you have a header in the csv file then you can use something like this in the foreach loop…
      foreach ($computer in $computers.name)
      In the Copy-Item destination path, you need to use escape character before $ (not $computer) since PowerShell variables start with $ itself.
      In the Start-Process you should use full file path, not just filename…
      C:\Windows\Temp\SentinelAgent_windows_v4_2_4_154.exe
      Also, add -Wait flag

      Thank you.

      • This reply was modified 2 weeks ago by Kiran.
      • This reply was modified 2 weeks ago by Kiran.
      • This reply was modified 2 weeks ago by Kiran.
      • This reply was modified 2 weeks ago by Kiran.
      • This reply was modified 2 weeks ago by Kiran.
    • #262652
      Participant
      Topics: 1
      Replies: 4
      Points: 22
      Rank: Member

      hey kiran

      thank you very much  for your reply

      i ran the script and didnt noticed any errors however i dont see the file getting copied or the exe getting installed..

       

    • #262667
      Moderator
      Topics: 5
      Replies: 244
      Points: 1,368
      Helping Hand
      Rank: Community Hero

      First, check your csv file, and see the output of $Computers

      If you see your servers list, then try with one server, and execute the commands one by one with the direct path and see how it works.

    • #262682
      Participant
      Topics: 1
      Replies: 4
      Points: 22
      Rank: Member

      yep typo in the csv file

      moving forward  – the file got copied to the server but the exe didnt run

       

    • #262850
      Moderator
      Topics: 5
      Replies: 244
      Points: 1,368
      Helping Hand
      Rank: Community Hero

      Did you notice any error?

      Try running the command directly on the remote computer and see the outcome. Also, check to replace the site token in the argument list.

      Thank you.

      • This reply was modified 1 week, 6 days ago by Kiran.
    • #262922
      Participant
      Topics: 1
      Replies: 4
      Points: 22
      Rank: Member

      running the command locally only runs the exe   a pop up dialog box asking if you want to install the app guess -ArgumentList is ignored

    • #263280
      Participant
      Topics: 1
      Replies: 4
      Points: 22
      Rank: Member

      sorry for bumping

    • #263286
      Moderator
      Topics: 5
      Replies: 244
      Points: 1,368
      Helping Hand
      Rank: Community Hero

      Go through the Start-Process help and try to see anything that you are missing…

      https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/start-process

      Thank you.

       

    • #263310
      Participant
      Topics: 16
      Replies: 1794
      Points: 3,300
      Helping Hand
      Rank: Community Hero

      First, have you tested this Start-Process on a local system to ensure it runs and works properly? The documentation recommends a push via CLI,SCCM or GPO. Each of these methods are most likely installing the software as SYSTEM. Have you attempted a local installation with the credentials you are using with Invoke-Command? Unfortunately, the documentation doesn’t appear to have installation logging, but have you looked at event viewer for failures as well?

Viewing 9 reply threads
  • You must be logged in to reply to this topic.