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!

NEW App using PowerShell to map print devices.

craigegross

Member
Messages
9
Reaction score
0
Points
1
We are trying to create an app that is deployed to our environment that will users to map to print servers/printers at their location without needing elevated privileges to complete.

We have three PowerShell scripts to achieve this. Our PowerShell guru has made some awesome scripts for this.

Script 1 - run as the user and calls a form that the user completes to determine the print server and print devices. It then attempts to install that device for the user. If it is successful then a pop up is displayed to show the printer was installed. If the printer could not be installed then an output file is created and the user doesn't see anything.

Script 2 - runs as the system. The user doesn't see anything from this script running. It attempts to install the printer as the system (so no elevation required).

Script 3 - runs as the user and copies the mapped printer to the user's profile. If the map is successful, then a popup is displayed showing that. If it is unsuccessful, a popup will show what happened.

My questions are:
1. How do we make the app stop running if Step 1 is successful and show as successful in Software Center.
2. When step 1 fails, how do we ensure steps 2 and 3 are run?
3. Any suggestions for optimization?
 
We are trying to create an app that is deployed to our environment that will users to map to print servers/printers at their location without needing elevated privileges to complete.

We have three PowerShell scripts to achieve this. Our PowerShell guru has made some awesome scripts for this.

Script 1 - run as the user and calls a form that the user completes to determine the print server and print devices. It then attempts to install that device for the user. If it is successful then a pop up is displayed to show the printer was installed. If the printer could not be installed then an output file is created and the user doesn't see anything.

Script 2 - runs as the system. The user doesn't see anything from this script running. It attempts to install the printer as the system (so no elevation required).

Script 3 - runs as the user and copies the mapped printer to the user's profile. If the map is successful, then a popup is displayed showing that. If it is unsuccessful, a popup will show what happened.

My questions are:
1. How do we make the app stop running if Step 1 is successful and show as successful in Software Center.
2. When step 1 fails, how do we ensure steps 2 and 3 are run?
3. Any suggestions for optimization?

i suggest using vb.net or c# to make an application instead of using powershell scripts. we had an app that runs as system through software center and the user chooses the site then the printer. once done an install button to install the printer
 

Forum statistics

Threads
7,136
Messages
27,873
Members
18,159
Latest member
jordysmits
Back
Top