Quantcast
Viewing all articles
Browse latest Browse all 2021

Altiris powershell push

I need a solution

I am attempting to run a powershell script from altiris and having a problem

First I created a script to change the execution policy for powershell to unrestricted and verified this one works

I then created the following script.  I didnt want to make it this noisey but other iterations didnt work.

$name = Get-WmiObject Win32_ComputerSystem
$Cname = $name.name
New-PSDrive -Name Z -PSProvider FileSystem -Root \\unc\path
get-service | ft name | Out-File Z:\"$Cname".txt

 

When I run the commands directly or as a .ps1 on the server it works as expected.  When I run it from altiris i get a text file named .txt that is blank but all results in altiris come back success.  Any ideas?


Viewing all articles
Browse latest Browse all 2021

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>