Forums on Intune, SCCM, and Windows 11

Welcome to the forums. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your topics and posts, as well as connect with other members through your own private inbox!

PENDING Powershell Script Deploy

  • Thread starter Thread starter harveybham
  • Start date Start date
  • Replies Replies 5
  • Views Views 2K

harveybham

Well-Known Member
Messages
86
Solutions
1
Reaction score
5
Points
8
Hi All,

I have a Powershell script that we have created that we need to push to all machines.
The script needs to look at a .csv file (Same patch as the script) and it needs to pull the hostname and another field.
Inside the same folder is a uninstall tool which also needs to run.

Doing this manually it works. So I run the script , it looks up the uninstall, it looks up the csv and it works.

What is the best way to push this via SCCM? Iv tested using a package and it says installed but it has not removed the program.

The command line i used is Command line: Powershell.exe -ExecutionPolicy ByPass -File "ScriptName"

Thanks
 
Hi @harveybham,

You can deploy the Powershell script as an application or package then you can monitor the deployment status and keep the deployment for active/inactive devices.
 
Hi,

Thanks for the reply

iv tested running this as a package but it seems to quick and moves to installed.

If i was to do this as a application how could i do the detection method. This script is only removing the application
 
You can add a detection method of a file or register key, for example if the C:\Program Files\Google\chrome.exe is not present, the script is compliant.
 
Hi All,

Thanks for the replies. I got this working in the end and had to use a Task Sequence for this to work. There was an issue with the script which also got fixed but this can now be marked as resolved. Thanks for the feedback
 
Back
Top