Chin Jam Posted January 10, 2020 Report Share Posted January 10, 2020 Hi, I am new to Smart Deploy and have been searching the forum but havent found what i am looking for and hoping someone can assist. I want to know if you can deploy powershell scripts to client computer from the smartdeploy console. I want to deploy simple copy or config scripts to client computers that have the smart deploy client/agent installed. If so what is the process to configure this? Thanks, CJ Link to comment Share on other sites More sharing options...
Jeff Harris Posted January 10, 2020 Report Share Posted January 10, 2020 You can create Application Packs for running PowerShell scripts, and push those to your SmartDeploy clients. Here's our KB article for creating custom Application Packs; https://support.smartdeploy.com/support/solutions/articles/48000960633-create-your-own-custom-application-pack You'll need to add PowerShell.exe -NoProfile -NonInteractive -ExecutionPolicy bypass -File to the start of the executable path after selecting your script,, per the documentaiton. Link to comment Share on other sites More sharing options...
Chin Jam Posted January 16, 2020 Author Report Share Posted January 16, 2020 Thanks for the reply Jeff but unfortunately the powershell script is not deploying through Smart Deploy. The script executes on the computer locally, so I know it works. Is there a log file I can view to help troubleshoot the issue? thanks, CJ Link to comment Share on other sites More sharing options...
Walter Rmz Posted June 25, 2020 Report Share Posted June 25, 2020 On 1/10/2020 at 8:19 AM, Jeff Harris said: You can create Application Packs for running PowerShell scripts, and push those to your SmartDeploy clients. Here's our KB article for creating custom Application Packs; https://support.smartdeploy.com/support/solutions/articles/48000960633-create-your-own-custom-application-pack You'll need to add PowerShell.exe -NoProfile -NonInteractive -ExecutionPolicy bypass -File to the start of the executable path after selecting your script,, per the documentaiton. Hi Jeff! I tried to follow the instruction doing the following: [ApplicationsFolder]\Teams Registry Key\Files\powershell.exe -NoProfile -NonInteractive -ExecutionPolicy bypass -file RegistryChange.ps1 powershell.exe -NoProfile -NonInteractive -ExecutionPolicy bypass -file [ApplicationsFolder]\Teams Registry Key\Files\RegistryChange.ps1 powershell.exe -NoProfile -NonInteractive -ExecutionPolicy bypass -file "[ApplicationsFolder]\Teams Registry Key\Files\RegistryChange.ps1" [ApplicationsFolder]powershell.exe -NoProfile -NonInteractive -ExecutionPolicy bypass -file "\Teams Registry Key\Files\RegistryChange.ps1" Still not luck. Hope we could get some help with this. Thanks! Link to comment Share on other sites More sharing options...
Walter Rmz Posted September 23, 2020 Report Share Posted September 23, 2020 Hello Guys! I haven't seen any real help about this. Since last time I posted I found the Solution to correctly run the Script as Admin. In my example I'm trying to create a URL Shortcut in the Public Desktop Create and Application Pack that will contain 3 tasks (1. Copy File/Folder, 2. Copy File/Folder and 3. Run Command) The First Task will copy my custom icon to the WINDOWS Folder. The Second Task will copy the PS1 file to the Public Pictures Folder. I'm using the Public Pictures Folder because there's no restriction to copy files there. No worries because we will delete the file later. The Third Task will Run the CMD File to RUN the PS1 file. Create your CMD file that will have the code to Run the PS1 file with the following: Powershell.exe -executionpolicy bypass start-process "PowerShell.exe C:\Users\Public\Pictures\filename.ps1" -verb runas (-executionpolicy bypass allows to run the ps1 file without errors and start-process "PowerShell.exe filelocation" -verb runas allows you to run PowerShell as Admin). Create the PS1 Scrip to create the Shortcut $shortcut_name = "Shortcut" (Shortcut Name) $shortcut_target = "http://webaddress" (URL of the page for your shortcut) $sh = new-object -com "WScript.Shell" (Creates the process) $p = $sh.SpecialFolders.item("AllUsersDesktop") (Location for your Shortcut. In this case trying to create it in the Public Desktop Folder running PowerShell without Admin privileges is not possible). $lnk = $sh.CreateShortcut( (join-path $p $shortcut_name) + ".lnk" ) $lnk.TargetPath = $shortcut_target $lnk.IconLocation = "C:\Windows\SharePoint.ico" (Icon path was set in the FIRST TASK) $lnk.Save() (Creates the Shortcut) del C:\Users\Public\Pictures\filename.ps1 (Deletes the PS1 file from the PUBLIC PICTURES FOLDER) This was the only way I could figure it out to Run PowerShell in Admin Mode and being able to create or copy stuff in folders that otherwise can be copied without Admin Permission. Hope It will be helpful. Cheers!! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now