Online criminals hate us. We protect you from attacks that antivirus can't block.

How to deploy a PowerShell script through Asset Management

Archiving the PS1 file

If you have a PS1 file that you want to deploy via Asset Management, you need to use WinRar in order to create an SFX archive. Below are the steps that you need to take to make a successful deployment package.

1. Right-click on the PS1 file and select add to archive:

no_1.png

 

2. Make sure that you check the Create SFX archive tick-box

0.PNG

 

3. Under the Advanced tab, click the SFX options button

no_3.png

 

4. Under the SFX options, you must first select the path where you want the PS1 file to be extracted

1.PNG

 

5. Under Setup, you must add the following command-line:

Powershell.exe -executionpolicy bypass -file C:\temp\Start.ps1

2.PNG

 

6. Under the Modes menu you can choose to hide the interface. (this is recommended)

no_6.png

Adding the SFX file to Asset Management

After you finished completing all the steps above you can then create the SFX archive. The resulting file will be a .exe file that can be afterward encrypted with the Heimdal Encryption tool and then you can create a patch in IM with this file to deploy in your organization. When creating the Heimdal Asset Management patch, please define the following silent argument: /S

After you have successfully encrypted the SFX archive you can then proceed to upload it to the Asset Management storage. After a successful upload, you will need to create the patch

no_7.png

You can specify any name that you want for the app and also architecture. Please note that the custom expression here does not matter since this is not a program that will be installed and it will not appear in Control Panel, so in this case. In our case, we used new as a Custom Expression.

The next step is to create the patch:

no_8.png

 

After adding the patch, we need to set the version, and, in this case, since we do not install an app, it can be anything, so I put there 1. The silent argument should be /S in this case.

The last step is to select the desired windows version and save the patch:

no_9.png

Now you can deploy the script through Asset Management. You must go to the desired group policy and add the new patch.

no_10.png

You must tick the first box so that the Heimdal Thor Agent pushes the PS1 file to the PCs.

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Article is closed for comments.