Jump to content
Pulseway 9.14 🔥

PowerShell

Share your PowerShell scripts

  1. Started by Andrea Marchi,

    I want to set the period of by powershell Maintenance . I attach the powershell file which does not work ERROR : In C:\Program Files\Pulseway\automation_e4ae5e7d_784d_41fe_a512_7364b59decf2.ps1:394 car:14 + $value = "723" + ~ Carattere di terminazione mancante nella stringa: ". + CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordEx ception + FullyQualifiedErrorId : TerminatorExpectedAtEndOfString if you run the file locally on the server everything works, if imposed a console script does not work. Maintenance.ps1

    • 1 reply
    • 3.1k views
  2. Started by dbeckwitt,

    I've written a script to scan the network and insert all existing active IP addresses to the proper location in the registry, however Pulseway manager doesn't pick that up (even on service restart). Where do I need to insert those changes? Sample script below- It relys on a txt file for a list of active IP's (generated separately) cls # Remove any existing registry entries $ExistingKeys = Get-ChildItem "HKLM:\Software\MMSOFT Design\PC Monitor\DevicesPingResponses\" | Select-Object -expand Name $Count = 0 ForEach ($Key in $ExistingKeys){ Remove-Item "HKLM:\Software\MMSOFT Design\PC Monitor\DevicesPingResponses\Device$Count" $Count++ } …

    • 1 reply
    • 2.7k views
  3. Started by Christian Kiesel,

    I have added a powershel script to Pulseway and scheduled it. On the Server the script is running well, but with Pulseway it has a problem to send a mail with the PS command: Send-MailMessage. + Send-MailMessage -To $user.EmailAddress -BCC $MailSender -Fr ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (System.Net.Mail.SmtpClient:Sm tpClient) [Send-MailMessage], SmtpException + FullyQualifiedErrorId : SmtpException,Microsoft.PowerShell.Commands.Send MailMessage The command is: Send-MailMessage -To $user.EmailAddress -From $MailSender -SmtpServer $SMTP…

    • 1 reply
    • 4.9k views
  4. Started by Van Der Hoff ICT,

    Hi, We created a script which checks for Windows Updates, installs the updates, creates a report and reboots if necessary. This script runs in a single task and every system has it's own scheduled task. Unfortunately when I check the Script Output Results (where our report file is shown), I noticed the following error: "Download Status: FAILED With Error -- You cannot call a method on a null-valued expression. The property 'Updates' cannot be found on this object. Verify that the property exists and can be set. Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))()" (See the attachment for a more detailed Script Output, the script is als…

    • 1 reply
    • 3.5k views
  5. Started by lyoder,

    This script will check to see if a VPN connection with the given name exists. If it does exist, it updates the VPN connection. If it does not exist, it creates a VPN connection with the given values. Note: I believe Pulseway runs PowerShell scripts under the Local System account by default (unless you have defined PowerShell User Impersonation in the Pulseway Manager, I think). In order to expose the VPN to users, this script runs against the Global Phone Book (-AllUserConnection switch). Therefore, this script does not check for the existence of VPN profiles stored in individual user Phone Books. (If an existing user VPN profile exists, this script will create a new…

    • 4 replies
    • 21.4k views
  6. Hi, Is it possible to continue a script after a reboot using Tasks? I build a PowerShell script where a reboot is required and needs to continue after te reboot.

    • 3 replies
    • 4.3k views
  7. 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
    • 4.8k views
  8. 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
  9. Started by David-,

    Would like to execute powershell and batch scripts as admin. Is this possible? For example, I would like to run sfc. Is my only option scheduling tasks?

    • 4 replies
    • 6.9k views
  10. 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.1k views
  11. Started by nixituk,

    Hi, Is there a script to remotely enable o provide remote support the remote desktop client and ask users permission for connection? I have a number to remote users and would like to provide remote support to them Thanks Nick

    • 3 replies
    • 8.3k views
  12. Started by Keith,

    I am trying to create a PowerShell script that will run DBCC checks on a SQL server and then report status back to Pulseway. I have a working script that I can run from the command line but the script will not run correctly when sent as a Pulseway script. Here are the details. The script fails because it is unable to authenticate to the SQL server. The SQL Server is running on the same machine as I am running the script on. Thus wil are not dealing with cross machine accounts. I have put debug code into the script and the account reported back by PowerShell is MACHINENAME$. The machine is in a domain and thus the script appears to be reporting back the machine …

    • 1 reply
    • 5.7k views
  13. Started by ethorup,

    Small Correction: The scheduled task can be run on demand, but by default it restarts the pulseway service once a day at 11am, which in theory, should force it to check for updates. So one of the problems I ran into with pulseway is, sometimes I would want to restart the service. Doesn't really matter why, could be to get it to check for new updates to the pulseway agent and get them on the latest version. The problem was that if I just setup a script to restart the service, say like this ReStart-Service "Pulseway" what would happen is that it would send the command in whatever user environment pulseway runs in, it would execute it, the service would stop, and the…

  14. This script will download the small online installer, generate the silent install cfg file and run the installer. The timer near the end is set for 3 minutes as it has to download the full installer first and Java takes a while to install anyway. If you want to get the latest version just go to https://java.com/en/download/win10.jsp and copy the link from the button that says "Agree and start free download". Then past this link into the $source variable. I find that this installer works on both windows 7 and windows 10. # Download and silent install Java Runtime Environement # working directory path $workd = "c:\temp" # Check if work directory …

    • 0 replies
    • 26.5k views
  15. When u use the built-in script "Add Automatically Started Services in Pulseway" some services wil be monitored that are triggert and not always on. This wil result in unwanted notifications. The first variable has the servicenames you want to disable. $services = @('gupdate', 'ShellHWDetection', 'sppsvc', 'RemoteRegistry', 'MapsBroker', 'tiledatamodelsvc', 'WbioSrvc', 'WinDefend', 'CDPSvc') $servicesRegex = [string]::Join('|', $services) # create the regex $regservices = Get-ItemProperty "HKLM:\Software\MMSOFT Design\PC Monitor\Services" $regservicesSplit = $regservices -split ";" foreach ($regservice in $regservicesSplit) { If ($regservice -match $servic…

  16. Hi, is it possible to use the PowerShell scripts from https://gallery.technet.microsoft.com/scriptcenter/2d191bcd-3308-4edd-9de2-88dff796b0bc (= PSWindowsUpdate) over Pulseway. My idea is to create a new category unter Automation -> Scripts with all the scripts of PSWindowsUpdate, but I have no idea if they would work... Thanks, Christian.

  17. This script will set the virtual machine to auto start whenever the host reboots, it will also 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 –VMname * | Set-VM –AutomaticStartAction Start 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 =…

    • 0 replies
    • 3.9k views
  18. 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.5k views
  19. This will download and install or upgrade veeam and install a license if you have one, finally it will import a config file if one is available. I use Dropbox and a shared link. When using Dropbox be sure and change the zero at the end to 1 to download. You if course would have to update the dl links. Any questions let me know. VeeamInstall.ps1 ## $workdir = "c:\installer\" $LicenseFile = "$workdir\Veeamlicense.lic" $ConfigFile = "$workdir\config.xml" [Object[]]$List = @( New-Object -TypeName PSObject -Property @{"File" = "$workdir\Veeam2.exe"; "URL" = "https://www.dropbox.com/s/Veeamexedl=1"} New-Object -TypeN…

  20. Wrote this script with the help of Support. Thanks Ermins! $days = 35 $system = Get-WmiObject win32_operatingsystem if($system.ConvertToDateTime($system.LastBootUpTime) -lt (Get-Date).AddDays(-$days)){ Restart-Computer -Force }else{ Write-Host "Machine was rebooted less than $days days ago" }

  21. ## Downloads latest PDQ from Company Dropbox and silently installs or updates if already installed # Path for the workdir $workdir = "c:\installer\" # Check if work directory exists if not create it If (Test-Path -Path $workdir -PathType Container) { Write-Host "$workdir already exists" -ForegroundColor Red} ELSE { New-Item -Path $workdir -ItemType directory } # Download the installer $url = "https://www.dropbox.com/PDQ13.exe?dl=1" # Put your Url with the file here..I use dropbox, you can use whatever file hosting service. $destination = "$workdir\pdq13.exe" # Check if Invoke-Webrequest exists otherwise execute WebClient if (Get-…

    • 0 replies
    • 5.2k views
  22. Started by SilverAnt,

    I'm not sure this is the correct section to post in, but I am having issues with a sample script I wrote. In testing out the automation features of Pulseway, I wrote a script to start the PC Monitor service (because I am having issues with it not starting all of the time). Here is the script: Get-Service "PC Monitor" | Where {$_.status –eq 'Stopped'} | Start-Service Here is the error I get in return : At C:\Program Files\Pulseway\automation_a5487285_b624_4996_8bc3_3440ed567e5a.ps1:1 char:47 + ... ice "PC Monitor" | Where {$_.status ƒ?"eq 'Stopped'} | Start-Service + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The s…

  23. Started by andy0609,

    I use this when I am onboarding a new client. Computers have been there and most people don't know/have their own admin password

  24. Started by kavaa,

    I made a install script for CCleaner to do a Silent install and clean if needed. Improvements are welcome! When a new version of FireFox comes out, just change the firefox version or url to the new value. # Silent Install Firefox # Download URL: https://www.mozilla.org/en-US/firefox/all/ # Path for the workdir $workdir = "c:\installer\" # Check if work directory exists if not create it If (Test-Path -Path $workdir -PathType Container) { Write-Host "$workdir already exists" -ForegroundColor Red} ELSE { New-Item -Path $workdir -ItemType directory } # Download the installer $source = "https://download.mozilla.org/?product=firefox-51.0.1-SSL&os=win64&…

    • 1 reply
    • 38.4k views
  25. Started by kavaa,

    I made a install script for 7-Zip to do a Silent install and clean if needed. Improvements are welcome! When a new version of 7-Zip comes out, just change the 7z1604-x64.msi to the new value. # Silent Install 7-Zip # http://www.7-zip.org/download.html # Path for the workdir $workdir = "c:\installer\" # Check if work directory exists if not create it If (Test-Path -Path $workdir -PathType Container) { Write-Host "$workdir already exists" -ForegroundColor Red} ELSE { New-Item -Path $workdir -ItemType directory } # Download the installer $source = "http://www.7-zip.org/a/7z1604-x64.msi" $destination = "$workdir\7-Zip.msi" # Check if Invoke-Webrequest ex…

    • 3 replies
    • 30.6k views