Search the Community
Showing results for 'how to powershell'.
Found 436 results
-
PowerShell Script to Eject USB Storage Devices via Pulseway Automation
Hey @Rhatake - Thanks for reaching out! Yes, you can use custom script include Sysinternals Handle.exe (from Microsoft) via PowerShell to identify and log. Next you can create a PowerShell script under Automation > Automation hub > User Defined > Create Script. Either you can create a Task in the same page to schedule the script or run manually on multiple machines from Device > Device management > Selecting the machines > Action > Run Script. Refer to images😊
-
PowerShell Script to Eject USB Storage Devices via Pulseway Automation
Hi everyone, I wanted to share a simple PowerShell script that you can use within Pulseway Automation to remotely eject any USB storage devices connected to a system. This can be helpful for security-conscious environments or in scenarios where USB usage needs to be tightly controlled. Works well in combination with the Disable USB Storage Access script in the built in category. The script uses Shell.Application to trigger the native "Eject" action for removable drives (DriveType = 2). Here's the version that loops through all mounted USB volumes: ✅ Works great in Pulseway automation tasks 💡 You can modify it to eject a specific drive letter if needed powershell # Eject all USB volumes using Shell.Application COM object $Eject = New-Object -ComObject Shell.Application # Get all removable (DriveType = 2) volumes with drive letters $volumes = Get-WmiObject -Class Win32_Volume | Where-Object { $_.DriveType -eq 2 -and $_.DriveLetter } foreach ($vol in $volumes) { Write-Host "Ejecting drive $($vol.DriveLetter)..." $Eject.NameSpace(17).ParseName($vol.DriveLetter).InvokeVerb("Eject") } Notes: During my testing, I've seen that USB devices will not be removed if a process is running from the disks in question. In other words, if there is a write/read process running, the disk is not ejected. Let me know if you have questions or enhancements!
-
PowerShell Script to Eject USB Storage Devices via Pulseway Automation
For remote troubleshooting and logging in Pulseway, is there a good PowerShell method to first identify and log the specific process (or processes) that are currently holding a file handle on a drive before the eject command is run?
-
HELP - Successfully runs the Enable SSO PowerShell script via Pulseway RMM, but does not execute on the endpoint
HI All, I am trying to enable SSO on my endpoint running Windows 10 x64 by running the below PowerShell Script through Pulseway RMM, however the Task runs successfully, but does not execute on the computer and doesn't give me any errors. I have however ran the script on Windows PowerShell ISE locally on the computer and it executes without any problems. Please can someone help me understand why this script will not execute on the endpoint via Pulseway RMM. i have however ran other scripts on my test machine and they work, but for some reason this one doesn't seem to want to execute. PowerShell Script: # Set variables to indicate value and key to set $RegistryPath = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\microsoftazuread-sso.com\autologon' $Name = 'https' $Value = '1' $Path = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\microsoftazuread-sso.com\autologon' # Create the keys if it does not exist If (-NOT (Test-Path $RegistryPath)) { New-Item -Path "$Path" -Force | Out-Null } # Now set the value New-ItemProperty -Path $RegistryPath -Name $Name -Value $Value -PropertyType DWORD -Force
-
HELP - Successfully runs the Enable SSO PowerShell script via Pulseway RMM, but does not execute on the endpoint
Hey @Lix1 - Thanks for reaching out! Yes, this can be done by workflows. Once created, run/schedule the workflow. Refer to image.
-
HELP - Successfully runs the Enable SSO PowerShell script via Pulseway RMM, but does not execute on the endpoint
Does Pulseway RMM specifically offer a built-in 'Run as Logged-in User' or 'Run with Impersonation' feature that would allow the script to directly target the HKCU hive of the currently active user, thus avoiding the need for complex registry path modifications?
-
Execute Script with Powershell 7
Hello Pulseway Support, I am currently using the Pulseway Task module to execute PowerShell scripts. My scripts require PowerShell 7 (pwsh.exe) to function properly, as certain modules like HuduAPI are not supported in PowerShell 5.1. However, when I attempt to run scripts that rely on PowerShell 7 functionality, they default to PowerShell 5.1, resulting in compatibility issues and failures. I would like to request guidance on how to: Configure Pulseway to explicitly run scripts using PowerShell 7 (pwsh.exe). Verify if the Pulseway PowerShell module supports PowerShell 7, and if not, what workaround or timeline is available to ensure compatibility. Please let me know how I can resolve this issue or if Pulseway tasks can be configured to execute PowerShell 7 scripts ( Powershell 7 is installed at the endpoints and the script executes as expected locally). Thank you for your support. Best regards,
-
Powershell Script works when run Locally but not through pulseway.
This script below runs find when ran locally. When I use it in pulseway it doesnt work. This is what I get as an error message. Can someone help me please. Thanks, Output At C:\Program Files\Pulseway\automation_6d035661_a3a3_4e34_b6c2_8e997a18878a.ps1:5 char:149 + ... owsdesktop-runtime-6.0.24-win-x64.exe" -wait -ArgumentList '/S /v/qn' + ~ You must provide a value expression following the '/' operator. At C:\Program Files\Pulseway\automation_6d035661_a3a3_4e34_b6c2_8e997a18878a.ps1:5 char:149 + ... owsdesktop-runtime-6.0.24-win-x64.exe" -wait -ArgumentList '/S /v/qn' + ~ Unexpected token 'S' in expression or statement. At C:\Program Files\Pulseway\automation_6d035661_a3a3_4e34_b6c2_8e997a18878a.ps1:17 char:212 + ... portAssistConfiguration.mst" DEPLOYMENTKEY="855asd$#" /norestart /qn' + ~ The string is missing the terminator: '. + CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException + FullyQualifiedErrorId : ExpectedValueExpression #Runs file from Fileserv01 if it can $folder = '\\Fileserv01\Public\IT\Software\DellSupport For Business\SupportAssist.bat if (Test-Path -Path $folder) { PowerShell.exe -ExecutionPolicy Bypass -File "\\Fileserv01\Public\IT\Software\DellSupport For Business\SupportAssistCleanup.ps1" Start-Process -FilePath "\\Fileserv01\Public\IT\Software\DellSupport For Business\windowsdesktop-runtime-6.0.24-win-x64.exe" -wait -ArgumentList '/S /v/qn' Start-Process msiexec -wait -argumentlist '/i "\\Fileserv01\Public\IT\Software\DellSupport For Business\SupportAssistInstaller-x64.msi" TRANSFORMS="\\Fileserv01\Public\IT\Software\DellSupport For Business\SupportAssistConfiguration.mst" DEPLOYMENTKEY="855asd$#" /norestart /qn' } else { New-Item -path "C:\Temp\SupportBusiness -Itemtype Directory Invoke-WebRequest -Uri "https://www.dropbox.com/scl/fi/nxdsz42jkcu5ss4tpdsvf/SupportAssistCleanup.ps1?rlkey=lidz0ms8aatgwhiv8dtvxr6dw&dl=1" -Destination "c:\temp\SupportBusiness\SupportAssistCleanup.ps1" Invoke-WebRequest -Uri "https://www.dropbox.com/scl/fi/j75w4oqajfbjpw2sdrpxg/SupportAssistConfiguration.mst?rlkey=he4shs9vzts47reav8d5ziv6x&dl=1" -Destination "c:\temp\SupportBusiness\SupportAssistConfiguration.mst" Invoke-WebRequest -Uri "https://www.dropbox.com/scl/fi/cuyvomxuui4z29bpk9x2r/SupportAssistInstaller-x64.msi?rlkey=g1lmxvprpb0nv1wxvtefwizii&dl=1" -Destination "c:\temp\SupportBusiness\SupportAssistInstaller-x64.msi" Invoke-WebRequest -Uri "https://www.dropbox.com/scl/fi/p7ctmo837kv9cnsyi6779/windowsdesktop-runtime-6.0.24-win-x64.exe?rlkey=e0ehydmwf1t86bu461b3xp1t9&dl=1" -Destination "c:\temp\SupportBusiness\windowsdesktop-runtime-6.0.24-win-x64.exe" PowerShell.exe -ExecutionPolicy Bypass -File "c:\temp\SupportBusiness\SupportAssistCleanup.ps1" Start-Process -FilePath "\\Fileserv01\Public\IT\Software\DellSupport For Business\windowsdesktop-runtime-6.0.24-win-x64.exe" -wait -ArgumentList '/S /v/qn' Start-Process -FilePath "c:\temp\SupportBusiness\windowsdesktop-runtime-6.0.24-win-x64.exe" -wait -ArgumentList '/S /v/qn' Start-Process msiexec -wait -argumentlist '/i "c:\temp\SupportBusiness\SupportAssistInstaller-x64.msi" TRANSFORMS="c:\temp\SupportBusiness\SupportAssistConfiguration.mst" DEPLOYMENTKEY="855asd$#" /norestart /qn' #Removes Folder after install Remove-Item "c:\temp\SupportBusiness" -recurse }
-
Pulseway 9.21 is Here!🔑
Say goodbye to click fatigue. This release is all about speed and simplicity, making sure you get to what matters faster, without all the extra steps🚀 Top Features in this release: Device Management Shortcuts Quick-launch remote desktop, PowerShell/Terminal, and shortcuts right from the Device Management page. No more hunting through menus, jump straight into action. Registry Viewer Direct access to the Windows Registry from the Device Card, no remote desktop session needed. Navigate, view values, and keep your flow without bugging the end user. Automation Hub A unified content management page for all your scripts, tasks, workflows, and managed files. Organized, searchable, and streamlined in one place. 📖 Want the full scoop? Read all about it here.
-
Queue scripts to run when back online
Hi there! I often find myself running scripts on our machines in a way that demands follow up/verification, so I thought it would be a good thing to be able to add scripts to a queue in Pulseway to have them run at a later point in time when a system becomes available online. Currently I tend to keep a document with all the machines listed, so I can mark them one by one in order to know which ones are done, and which ones remain. This is kinda tedious because our machines (especially laptops) tend to be offline for longer periods of time, and I have to follow up on a daily basis until the script ran successfully on all of them. I know about automation tasks in Pulseway and the possibility to schedule scripts to run daily, weekly etc. But they will continue to run on all computers for as long as the task is enabled. I've tried to cope with this by building scripts that won't reapply the software and/or settings if existing data is found. It seems to work, although it's not an optimal solution since the scripts will run tens or hundreds of times on our systems when they only really need to be ran once. So, what am I suggesting? The possibility to run one or multiple scripts (either directly or via an automation task depending on what the Pulseway devs prefer) With an option to run once. With an option to include offline systems (the script/s will be queued for when they come back online) With an option to send success/failure-reports to the administrator With an option to retry once, twice or three times whenever a script is unsuccessful. (in my case this is useful because Powershell Impersonation doesn't work in home environments when VPN is disabled, so a second attempt may succeed.) A section in Pulseway WebGUI where an administrator can see the deployment progress and success/failure-ratio. One of many scenarios: I have a script that will install a scheduled task with some predefined values, and upgrade an MSI-installation to a newer version. I want to make sure that all our computers run the script with a successful output. Please let me know if you find this suggestion useful!
-
Windows 11 Readiness Check
I found a PowerShell script that checks if the machine can run Windows 11. I can see the output in Pulseway after it runs when I click on the execution option. But I would like to run it for all of the customers machines and get the output all at once. Is there an easy way to do this in Pulseway automation?
-
Bitdefender (password secured) distribution and uninstall
Hi I am experimenting with Bitdefender distribution. At our company, Bitdefender packages are protected against unauthorized uninstallation by a password. When I initiate uninstallation via the Pulseway portal, it fails. I would still like to automate this process. What would be the best way to do this? A powershell script with an integrated password, or is there a possibility via workflow? Many thanks in advance. Best regards, Geko
- Install Sentinel One via Powershell script
-
Running a .bat file on a remote machine using a Pulseway script
If I have a file in C:\tmp\somefile.bat and I have a (Powershell) script in Pulseway that simply contains "Start-Process "C:\tmp\somefile.bat" will that .bat file run in a shell for the current logged in user, or for the System account that Pulseway uses? Cheers,
-
Powershell script to change registry values
Hi, I have created a powershell script to activate a specific screensaver, password enable it and set the idle timeout value, but it does not work when I try to run it from the PulseWay Web interface. I have also tried it from a batch script, but it does not work either. Both scripts work fine when running them directly from the local computer. The Powershell script it as follows: #Values to customize $ScreenSaveActive = 1 #set to 1 if you want the screensaver enabled, 0 to disable $TimeOutValue = 60 # number of idle seconds before screensaver gets active $ScreenSaverFile = "C:\Windows\system32\mystify.scr" # full path to screensaver file $ScreenSaverIsSecure = 1 # set to 1 if you need a password to get out of screensaver, a.k.a. unlocking the pc #If the screensaver is not compliant with $ScreenSaveActive, we reset it to the preferred value if((Get-ItemProperty -Path "hkcu:control panel\desktop" -Name "ScreenSaveActive").ScreenSaveActive -ne $ScreenSaveActive) { Set-ItemProperty -Path "hkcu:control panel\desktop" -Name "ScreenSaveActive" -Value $ScreenSaveActive } #If user set screensaver timeout to a value larger than 1200 seconds (20 minutes), we set the value back to 1200 seconds [int]$Current_TimeOutValue = (Get-ItemProperty -Path "hkcu:control panel\desktop" -Name "ScreenSaveTimeOut").ScreenSaveTimeOut if($Current_TimeOutValue -eq 0 -OR $Current_TimeOutValue -gt 1200) { Set-ItemProperty -Path "hkcu:control panel\desktop" -Name "ScreenSaveTimeOut" -value 1200 } #If no screensaver file is set or if the path doesn't exist anymore, we set it to the blank screensaver $Current_ScreenSaverFile = (Get-ItemProperty -Path "hkcu:control panel\desktop" -Name "SCRNSAVE.EXE")."SCRNSAVE.EXE" if($Current_ScreenSaverFile -eq "" -OR (Test-Path $Current_ScreenSaverFile) -eq $false) { Set-ItemProperty -Path "hkcu:control panel\desktop" -Name "SCRNSAVE.EXE" -Value $ScreenSaverFile } #If the screensaver "lock" is not compliant with $ScreenSaverIsSecure, we reset it to the preferred value if((Get-ItemProperty -Path "hkcu:control panel\desktop" -Name "ScreenSaverIsSecure").ScreenSaverIsSecure -ne $ScreenSaverIsSecure) { Set-ItemProperty -Path "hkcu:control panel\desktop" -Name "ScreenSaverIsSecure" -Value $ScreenSaverIsSecure } #Before our changes become active in the current Windows session, we need to run the following command more than 3 times for ($i=1; $i -le 4; $i++) { rundll32.exe user32.dll, UpdatePerUserSystemParameters } I have also tried this from batch script, but it does not work either. @echo off reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v SCRNSAVE.EXE /t REG_SZ /d C:\Windows\System32\Mystify.scr /f reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v ScreenSaveActive /t REG_SZ /d 1 /f reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v ScreenSaveTimeOut /t REG_SZ /d 60 /f reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v ScreenSaverIsSecure /t REG_SZ /d 1 /f
-
Installing Pulsway Via Powershell script
Hello All, I am attempting to install puslway by using a powershell script. what i am trying to acomplish is being able to have a way to run a script against a windows machine either via intune or A provisioning package to install pulsway during New deivce provisioning. I have a way to do the install using an MSI file but im worried about the installer expiring, so i was trying to find a way to install pulsway using the installer link which does not expire. Thanks for any help you can provide.
-
Request for help! Trying to record local admin group memberships for all systems
Hi Guys, I've cobbled together a workflow using Powershell that looks at membership of the local Administrators group and that output is emailed to me. That's gone without issue but I want to refine it and that's where I'm struggling. So I know that in our case, every machine's local admin group has some membership, i.e. the local admin account and our domain admins group. I want to filter these machines out and have email results for only those where there's anything more than those "defaults". Get-LocalGroupMember -Group 'Administrators' | Where-Object {$_.PrincipalSource -ne 'Local' -and $_.Name -ne 'MyDomain\Administrator' -and $_.Name -ne 'MyDomain\Domain Admins'} | Select-Object -Property 'Name','PrincipalSource' This code works locally and using Pulseway's remote Powershell function. What I was hoping to do was to basically skip a system if the output of the code was blank or null. For systems where I haven't received any output back when using Pulseway's Powershell, I guess I don't know if the output is actually completely empty or not. I also don't know if using Pulseway's variable function is considered separately to the Powershell environment the code gets run in, if that makes sense? When I try to run the workflow on a single machine I always get emailed the results, even when the return from the Powershell is blank. I'm not brilliant with Powershell so have been searching around for alternatives. I was wondering about return codes perhaps but could I also put these into a Pulseway workflow?
-
Run powershell on user site elevated user.
Deze script werkt als het gerunt is van een user account maar niet vanuit pulseway. $password = ConvertTo-SecureString "your_password" -AsPlainText -Force $credentials = New-Object System.Management.Automation.PSCredential("your_username", $password) $scriptBlock = { Start-Process powershell -Verb RunAs Write-Host "Running with elevated privileges!" } $encodedCommand = [Convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes($scriptBlock)) Start-Process powershell.exe -ArgumentList "-NoProfile -EncodedCommand $encodedCommand" -Credential $credentials
-
Unable to use "param" with Powershell Scripts
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 script it is on line 31, which is what led me on the path to find that the extra line was being added at the top of the script by Pulseway. Is there a way to prevent that first line from being added to the script, or do I need to contact Huntress and have them rework a different version of the script that doesn't include the "param" command? Cheers.
-
Change Endpoint Configuration via Powershell on Admin Console
HI Team Is there a way to remotely enable/disable notifications for a specific endpoint via the Admin Console (mydomain.pulseway.com/app/main/systems/{system_id}/details) under Manage > Execute Powershell? I want to disable the "Send notification when computer is offline" but is there a way i can do it with remote powershell/scripting without logging into the computer?
-
Missing modules like Hyper-V, AD, VMWare...
Hey @josheld_65 - Thanks for reaching out! To enable Legacy Mode, run the below Powershell script and open Pulseway manager. Set-ItemProperty -Path "HKLM:\Software\MMSOFT Design\PC Monitor\" AgentLegacyMode -Value 1 Hope this helps 😊
-
Reg edit powershell scripts
I want to add the below PowerShell command into Pulseway script, any help with creating or articles would be great. Powershell cd HKLM:\ New-Item -Path "SOFTWARE\Policies\" -Name "Google" New-Item -Path "SOFTWARE\Policies\Google\" -Name "Chrome" cd HKLM:\ New-ItemProperty -Path SOFTWARE\Policies\Google\Chrome -Name "IntensiveWakeUpThrottlingEnabled" -Value "0" -PropertyType "DWord" New-ItemProperty -Path SOFTWARE\Policies\Google\Chrome -Name "WindowOcclusionEnabled" -Value "0" -PropertyType "DWord"
-
Powershell 7.2
Is there a way to force use of Powershell 7.2 when running powershell scripts in Pulseway?
-
Bug with Workflows that call Powershell Script
So, I have been using the workflow automation to much sucess. I have one activating script upon logon. It used to work wonderfully even though every time it ran it reported "Failed" in workflow status. It seems that my PowerShell scripts hang up the workflow. These two scripts write back to custom variables on each machine when they run. I just tested and it does not seem to matter whether the custom variable code snippet is in the script or not. It is not possible to successfully run a workflow with any steps after a PowerShell script currently. Does anyone have any way to fix this, I tried adding "exit" at the end and that didn't help. I'm also going to contact support and see what they say. -Hayley
-
Hardware monitoring through REST API & PowerShell
Hi, My requirement is to monitor hardware components in a server using the REST API and Powershell. Currently I'm working at Fujitsu servers and I'm able to get the necessary monitoring information to Powershell objects from Fujitsu iRMC (Baseboard Management Controller) using the REST API. However, proceeding from here is the issue. I want to know how to feed the queried information to Pulseway and generate notifications based on the thresholds that will be defined. Based on the research I've done it seems like I need to create a plugin and add it to the Pulseway Manager. (Not 100% sure about this) Could you please help on how to get this done? Thanks, Randula.