Jump to content

Mark G38

  • Posts

  • Joined

  • Last visited

Posts posted by Mark G38

  1. I am not a Pusleway user anymore, but there are a couple of ways you could do this.  You mention event ID, but I don't see any logic in your script to write an event ID to the event log.

    However, that would probably be the easiest way, and then have Pulseway look for (and alert off of) that event entry.  I always set up a custom Event Log and then use my own codes so that I never have to worry about looking through logs with other stuff in it.  All my stuff goes to a custom log I set up.  

    As far as your code, your logic seems, a bit off to me unless I'm just too tired lol, but your first if statement, your essentially saying if lastboot is BEFORE 14 days ago, SetCustomeFieldNo... Would you want that to be a yes, since that means it hasn't rebooted in over 14 days? I think your statements are backwards.  I assume your SetCustomField Yes would be used for if it's been up for over 14 days. Maybe I'm just reading it wrong.

    I personally wouldn't bother with setting the custom fields. I would again, just write to whatever event log you want, with whatever event ID you want, set Pulseway to alert off that event ID, and then schedule your script to run once a day.  As soon as it runs and sees a machine over 14 days, it creates event log entry which Pulseway will then alert you to. 

  2. I wrote and used this often (before using a 3PP solution).  The only thing is I couldn't find a static link to Adobe Reader DC when I wrote this, so I simply downloaded the latest version, and hosted it in AWS S3 and pulled it from there.  So feel free to find a static URL or do the same I did.  

    Function New-FileDownload {
            [Parameter(Mandatory = $true)]
            [Parameter(Mandatory = $true)]
        $webClient = New-Object System.Net.WebClient
        $webClient.DownloadFile($Url, $Destination)
        if (Test-Path -LiteralPath $Destination) {
            Write-Verbose "File downloaded Successfully"
            return $true
        else {
            Write-Verbose "File download Failed"
            return $false
    $AppName = "Adobe Acrobat Reader DC"
    $InstallStatus = Get-ItemProperty "HKLM:\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*" |
    Where-Object { $_.DisplayName -eq $AppName }
    if ($InstallStatus) {
        Write-Output "$($AppName) already installed."
        Exit 0
    $AdobeURL = "ENTER YOUR URL TO AdobeReaderDC.exe"
    $Destination = "$($env:temp)\adobeinstall.exe"
    $FileDownload = New-FileDownload -Url $AdobeURL -Destination $Destination
    if ($FileDownload) {
        Write-Output "Download succeeded, beginning Adobe Reader install..."
        Start-Process "$($Destination)" -ArgumentList "/sAll /rs /msi EULA_ACCEPT=YES" -Wait -NoNewWindow
        $InstallStatus = Get-ItemProperty "HKLM:\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*" |
        Where-Object { $_.DisplayName -eq $AppName }
        if ($InstallStatus) {
            Write-Output "$($AppName) successfully installed."
            Exit 0
        else {
            Write-Output "$($AppName) failed to install."
            Exit 1
    else {
        Write-Output "Failed to download installation file. Exiting."
        Exit 1


  3. On 5/16/2022 at 2:29 PM, Evan Newton said:

    Hello, i am trying to setup a very simple script to install powertoys as we have a need for the image resize feature on some computers. it can be installed using the winget cmdlet in powershell or the windows terminal, i have run it manually on both widows 10 and 11, but running the script the pulseway give be the following


    $ winget install Microsoft.PowerToys --source winget

    winget : The term 'winget' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

    At line:1 char:1

    + winget install Microsoft.PowerToys --source winget + ~~~~~~ + CategoryInfo : ObjectNotFound: (winget:String) [], CommandNotFoundException

    + FullyQualifiedErrorId : CommandNotFoundException

    You can just use the RunAs PowerShell module as well to accomplish this if you don't feel like dealing with psexec and having to distribute the package yourself. 

    This works fine for logged in users. It will check if you have the RunAs module installed and if not, install it first.

    $ErrorActionPreference = "SilentlyContinue"
    if (!(Get-InstalledModule | Where-Object { $_.Name -eq "RunAsUser" })) {
        Write-Host "Not Installed. Installing"
        Install-Module RunAsUser -Force
    $ScriptBlock = {
        winget install Microsoft.PowerToys --source winget
    Invoke-ASCurrentUser -ScriptBlock $ScriptBlock
    Write-Host "Check Device to ensure PowerToys installed successfully."
    Exit 0
  4. You should have saved backup codes when you set up your 2FA the first time, that allow you into the account.  You have to select Try Another Way after entering your creds.  Assuming you no longer have your old phone.  

    Aside from this, if you don't have your codes, good luck, you should probably reach out directly to support.  

  5. On 3/24/2022 at 3:57 PM, beli3ver said:


    I tried to remove the agent, with this:

     Get-WmiObject win32_product -filter "Name LIKE 'Pulseway'" | Select-Object IdentifyingNumber;

    But it is empty. Try to reinstall the agent, but I get the error "Service already exist."

    In add/remove software is Pulseway agent, how can I remove it?

    First off, you should never call Win32_Product. It's slow for starters, but it also triggers Windows to perform a Windows Installer reconfiguration on EVERY single msi app installed on the system.  This is terrible and could cause apps to do a repair if it thinks it found an issue. The impact and possible damage that could be caused by running that command is not worth the hassle.  

    I highly recommend instead you run this:

    Get-ItemProperty "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*" | Where-Object {$_.DisplayName -eq "Pulseway"}

    You can grab the UninstallString and perform an uninstall that way.  LMK if you need further assistance scripting this. 

  6. On 3/24/2022 at 10:22 PM, beli3ver said:


    Good morning,

    I have a Powershell script which should install a certain software at our customer.
    During the installation a key is needed. I would like to enter this key every time I run the script, is this possible?

    Background is that we have different keys for each customer, so I do not have to create 10 versions of the script with different keys.

    lol nope. This is not possible unfortunately, but it's something that is constantly requested by users of Pulseway.  The thread below contains a list of improvements and links to the Feature Upvote section so you can upvote this very idea. 


  7. 4 hours ago, AC_Martin_J said:

    Thanks Mark G38! I'll look into that.

    As long as the client gets registered in pulseway (not just having the agent installed), then it should be fine.

    Yea no problem.  If you go into Onboarding - Downloads - And then select your Windows download, you can make one for each customer, or if it's just for your internal machines (if that's what you use Pulseway for) then you just make the one, and you just do "Copy Link" and throw that link into your PowerShell script, call the URL to download the file, and then run it. It's an MSI so you can do silent install and it will fully register with Pulseway. 

  8. On 3/21/2022 at 7:00 PM, JanSnow said:

    Is there a tweak to exempt certain machines (servers and VMs) on this script?

    Don't run it against those machines. Create a scope in Pulseway and apply the job / script to that scope and don't include those machines.  

    If you don't want to do that, then modify the script and using this.  Change the PCNames to the ones you don't want it to run on, and then yea, it will just exit with a success if it sees those names.  If you are on machines that are all PowerShell 3.0 and above, then you can also use $env:computername -in $Exclusions as well.  -contains is PowerShell 2 compatible.


    $Exclusions = @("PCName1", "PCName2", "PCName3")
    if ($Exclusions -contains $env:COMPUTERNAME) {
        Exit 0
    else {
  9. I haven't experience these issues personally, but the only other thing I can offer as a possible solution than, is to tell your patch policy to NOT reboot anything, and then schedule a job/task on a recurring schedule to reboot the devices at a specific time.  

  10. I do not have the exact steps, and it's been awhile since I've actually done much inside Intune, but I do know using Intune, you can push scripts to systems.  Pulseway can definitely be scripted using PowerShell, so there should be no reason you can't push Pulseway to the machine once it's inside Intune.  I've pushed other RMMs in the past, such as Datto RMM via Intune.  

  11. That's certainly interesting.  I'm doing mine directly through PowerShell, but I can't imagine that "should" make a difference.  Maybe I'll install Postman and see if it has any different output on mine.  

    EDIT - Unfortunately, I just downloaded and installed Postman and sent the request.  My info still is populating as it should.  Sorry man, was hoping I could help.  Sounds like perhaps an issue with your instance.  Are the other API endpoints working fine for you? 

  12. Yea this is not a great change.  If anything, it would be great if they could at least give an option to "expand" the content and then display it in a better format that previously.  But I'd still take the previous output over having to hover to see the details. Just an extra step that isn't needed. 

  13. Hey Jamie,

    I'm a bit confused here.  The new tabs thing and favorites thing is cool.  But I swear, for a long time now, at least a year, there has always been Account Overview as well as Patch Management Policy and AV Policy pages.  So not really sure if I'm crazy or what is so new about these pages.

    Can I ask, what is the status on a lot of the feature requests that have been marked In Development for at least 4+ months. 



  14. I don't have an official answer for this, but honestly I think your idea of how patch management works is a bit off.  You understand that Windows doing updates, often times requires a reboot before it can move onto the next patch/update, which may also require a reboot.  So in general, even with other RMMs I've worked with, will install updates and reboot more than once if required all within the allowed patch window specified in the policy. 

  • Create New...