Notification

Icon
Error

Powershell script deployment - Powershell script deployment

Posted: Wednesday, February 17, 2021 3:54:24 PM(UTC)
cstoop

cstoop

Member Original PosterPosts: 4
0
Like
I would like to run a powershell script (.ps1) file which resists on a network share on several clients.
I have tried with the invoke-command etc. but is not a success.

The question is how to run a powershell ps1 file with Lansweeper.
I have already tried the following:
script
powershell.exe -executionpolicy bypass -file \\fsnl\gpodiverse\Teams\Install-MicrosoftTeams.ps1

or

installer

{PackageShare}\powershell.exe -executionpolicy bypass -file \\fileshare\Teams\Install-MicrosoftTeams.ps1

The goal is to install a softwarepackager on some clients which is a msi file and i would like to do this with powershell thru Lansweeper.
Brandon
#1Brandon Member Posts: 90  
posted: 2/17/2021 6:12:33 PM(UTC)
You would need to save the PowerShell script on your Lansweeper server in the package share folder. In the deployment you should be able to use the following command: powershell.exe -executionpolicy bypass -file "{PackageShare}\Install-MicrosoftTeams.ps1"
CyberCitizen
#2CyberCitizen Member Posts: 409  
posted: 2/19/2021 3:09:34 AM(UTC)
This works perfectly fine for me.

Installer Type Cpmmand
powershell.exe -executionpolicy bypass -file "{PackageShare}\CleanUpMGRScript.ps1"
cstoop
#3cstoop Member Original PosterPosts: 4  
posted: 2/19/2021 11:17:08 AM(UTC)
Originally Posted by: CyberCitizen Go to Quoted Post
This works perfectly fine for me.

Installer Type Cpmmand
powershell.exe -executionpolicy bypass -file "{PackageShare}\CleanUpMGRScript.ps1"


I have made a exe from the ps1 and try to execute that with Lansweeper.
I get an error on the client that there is something with the CAB file and that it cannot extract it problebly not enough memory or something but tis is new pc with enough memory?

The message is from LSdeployment\remotedeployment_x64.exe


Active Discussions

Lansweeper LSAgent Rescan Asset
by  marck1024   Go to last post Go to first unread
Last post: Today at 4:11:53 PM(UTC)
Lansweeper Allowing a role to create asset groups
by  mh6543   Go to last post Go to first unread
Last post: 2/26/2021 10:00:40 PM(UTC)
Lansweeper Export LsAgent Assets
by  steveb  
Go to last post Go to first unread
Last post: 2/26/2021 7:26:32 PM(UTC)
Lansweeper Asset Uptime "Asset on total"
by  Andy.S   Go to last post Go to first unread
Last post: 2/26/2021 3:07:35 PM(UTC)
Lansweeper Scanning for Static Routes?
by  ChrisParr  
Go to last post Go to first unread
Last post: 2/26/2021 12:43:28 PM(UTC)
Lansweeper lansweeperuser sql database permissions
by  David K.   Go to last post Go to first unread
Last post: 2/25/2021 11:54:38 PM(UTC)
Lansweeper Scanning certificates
by  Vincent Pollock  
Go to last post Go to first unread
Last post: 2/25/2021 8:35:11 PM(UTC)