Jump to content

PowerShell

Share your PowerShell scripts

  1. Up until the most recent update to Pulseway, I was able to install the Huntress agent via their provided Powershell script at: https://github.com/huntresslabs/deployment-scripts/blob/main/Powershell/InstallHuntress.powershellv2.ps1 This script includes the "param" command, which has to be the first line of the script in order to run. After the recent update to Pulseway, all scripts that are run add an $ENV_AgentTemp variable to the top of the script, see screenshot below: This prevents the script from running correctly, see screenshot below of the error: Please note that the powershell output shows the error on line 32, whereas in the scr…

  2. Started by eDecisions,

    I don't think its possible to have more than one NINJARMM Agent installed, however if there are this script will likely fail, but for a clean ninja install will locate the correct uninstall path and uninstall the ninja agent. $UninstallString = (Get-ItemProperty HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\NinjaRMMAgent*).UninstallString Start-Process -FilePath "$UninstallString" -ArgumentList "--mode unattended"

    • 5 replies
    • 58.6k views
  3. Update 3rd Party applications eg, adobe, quickbooks, zoom, etc

  4. Hey Fellow PW users, I've created a script which allows the system to change its name to %computername%-Current logged on username, which makes life a little easier when trying to remote to their computers on the remote control tool/Webapp. To get started, create your script in the script editor, in my example, Name: Update Computer Name with Logged on Username Windows/Powershell Code: $pwqusers = quser | Select-Object -skip 1 $pwquserfmt = $pwqusers.substring(1,22).Trim() -join "," Set-ItemProperty -Path "HKLM:\Software\MMSOFT Design\PC Monitor\" -Name ComputerName -Value "$env:computername-$pwquserfmt" Click Save. Next we create at new t…

    • 9 replies
    • 12.4k views
  5. This script will update Hyper V integration services. Be sure and change your server names to match. Server0 is host and server1 is the Hyper V. Run on Host. Get-VM -Name SERVER1 –ComputerName server0 Set-VMDvdDrive -ComputerName server0 -VMName SERVER1 -Path 'C:\Windows\System32\vmguest.iso' $DVDriveLetter = (Get-VMDvdDrive -ComputerName server0 -VMName SERVER1).Id | Split-Path –Leaf Invoke-Command –ComputerName SERVER1 -ScriptBlock { if ($ENV:PROCESSOR_ARCHITECTURE -eq 'AMD64') { $folder = 'amd64' } else { $folder = 'x86' } Start-Process -FilePath "$($using:DVDriveLetter):\support\$folde…

    • 0 replies
    • 5.6k views
  6. I created a simple script to update the Pulseway Manager settings. The script verifies if a directory exists, and if it doesn't then creates it. Afterwards, it downloads the file from the URL and saves it to the outpath. Then updates Pulseway Manager config with the file located in the outpath. This has been extremely useful for modifying settings and updating all agents with the new settings. The flow for this process is as follows: 1. Update settings on the Pulseway Manager application, export settings. 2. Upload the settings file to a cloud or web-based URL, I use AWS S3 buckets with a public URL. 3. Add the URL to the $url variable, and change the paths…

    • 2 replies
    • 3.6k views
  7. Started by Josh-405,

    After noticing the addition of Custom Fields to the Scripts section, I was testing it out and wanted to store a value in a Custom Field for each system. I have setup a powershell script that should save a variable value to the Custom Field and ran it against my computer. The script ran successfully, but I am not able to find the Custom Field to see if value was saved properly. Where can the Custom Field be found?

  8. Started by Keith,

    This is more of a general script question about Pulseway. There are a number of the built-in script that appear like they should return data. When I review the scripts they are PowerShell scripts that would return data to the screen. I don't understand where the data is returned when they are run remotely via Pulseway. Is there someplace that Pulseway returns the data from a script after it is run? This would be super convenient but I surely cannot find this. Examples: List Installed Hotfixes List System Restore Points List Computers in the Active Directory These are built in but I don't understand where the results are supposed to be r…

    • 4 replies
    • 5k views
  9. Started by eDecisions,

    Upgrade widnows 7 - 8 to windows 10 or run on windows 10 to reload in place windows 10 over itself and keep files and settings. all silent, click and go, system will reboot in about 1 hour without warning so best to run at night, found this on another site, have used several times, its about the same as running it manualy as far as success rate, it won't fix a machine that just won't update, but for the ones that will its a single click and your done # Upgrade to Windows 10 # # Created by CN @ CCT 19th Feb 2020 # # # ##Create Directory New-Item -Path "c:\temp\" -Name "Win10Upgrade" -ItemType "directory" ##Get Variables $url…

    • 1 reply
    • 3.4k views
  10. Started by Chris1992,

    Good evening, I would like to use the standard script for windows that is in pulseway automation. But I get this error message: Checking for Windows updates Downloading updates Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) At C:\Program Files\Pulseway\automation_9fdca742_c373_41fb_80e3_ce2b245530ca.ps1:25 char:5 + $Downloader = $Session.CreateUpdateDownloader() + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : OperationStopped: (:) [], UnauthorizedAccessException + FullyQualifiedErrorId : System.UnauthorizedAccessException The user used to execute the script (Settings…

  11. Started by Greg Weides,

    We noticed that all machines we had with Win 10 either via fresh install and or upgrade would not WOL from Pulseway. Through much troubleshooting and testing it came down to the fast startup option in the power settings preventing WOL from happening. We setup a PS script to change the regkey value for fast startup and set it to disabled. After a restart and processing of the registry the systems now wake when requested to via Pulseway RMM. PS script is below... Set-ItemProperty 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Power' -Name HiberbootEnabled -Value 0

    • 1 reply
    • 4.8k views
  12. Started by eDecisions,

    Seems I still find a lot of these systems that were managed by 2011 small buiness server where the server has been removed from the domain but the WUSU settings were not removed from the GPO correctly leaving one or more systems looking for a server that no longer exist. This script removes and reset the update service back to default on the client. Suggestions/Comments? # Stop the Windows Update service Stop-Service -Name wuauserv # Remove the registry key Remove-Item ` 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' ` -Recurse # Start the Windows Update service Start-Service -Name wuauserv

    • 0 replies
    • 2.1k views