Jump to content
Pulseway 9.14 🔥

PowerShell

Share your PowerShell scripts

  1. Started by Brant,

    I've implemented a script that retrieves and stores the Windows Build Version number to a custom field in the system overview. It works fine on MOST systems. However, there are a small number systems that are unable to run the script. The error message displayed includes: Start-Process : This command cannot be run due to the error: The system cannot find the file specified. I used the "Insert Output Variable Code" in the script and verified that it includes the inserted text "Start-Process -FilePath "$env:PWY_HOME\CLI.exe" -ArgumentList ("setVariable .....". For some reason, a few systems do not seem to have the environment variable PWY_HOME set. It ap…

  2. Started by eDecisions,

    Well until Pulse-way get around to integrating Bitdefender I needed some way to quickly see who was installed and who was not, this scrip adds an entry to the computer name as "NoBit" or "BitActive" depending weather or not the bitdefender service is found or not. then just visit Systems, Key in the name filed NoBit and hit search to see which clients are missing Bitdefender. Note, does not check if service is running or actually active, only that the service exist. Suggestions Welcome. #Written by eDecisions #Use to determine if Bitdefender is loaded $computername = (New-Object -ComObject WScript.Shell).RegRead("HKLM\SOFTWARE\…

    • 0 replies
    • 2.8k views
  3. Started by eDecisions,

    This script changes the state of Hidden files, if hidden files are set to show this turns them off, if hidden files are set to hide this shows them. Comments? # This key contains all of the profiles on the machine (including non-user profiles) $profileList = Get-ChildItem -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList" # This key contains the path to the folder that contains all the profiles (typically c:\users) $profileFolder = (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList').ProfilesDirectory # This key contains the path to the default user profile (e.g. C:\Users\Default)…

    • 0 replies
    • 2.7k views
  4. Started by eDecisions,

    1: ENABLE MANAGER LOCK (PASSWORD 123) Set-Itemproperty -path 'HKLM:\SOFTWARE\MMSOFT Design\PC Monitor' -Name 'PreventChanges' -value '1' Set-Itemproperty -path 'HKLM:\SOFTWARE\MMSOFT Design\PC Monitor' -Name 'PreventChangesPassword' -value 'u9jnMTCy8Op4FP7ojbHApnslkq4g2bxhTW8uvNKsURYntjFyJKp302SXGSI+d7lCghuzlNhB6kZb71JpwMiHIw==' Set-Itemproperty -path 'HKLM:\SOFTWARE\MMSOFT Design\PC Monitor' -Name 'PreventChangesPasswordCtrl' -value 'A1-B9-23-A3-6D-C6-BD-A4-DF-CE-82-F5-F3-F6-69-81' 2: DISABLE MANAGER LOCK: Set-Itemproperty -path 'HKLM:\SOFTWARE\MMSOFT Design\PC Monitor' -Name 'PreventChanges' -value '0' Set-Itemproperty …

    • 0 replies
    • 2.7k views
  5. I want to start a program after rebooting and used this script, but it's not working. When I run it local in powershell it works. Someone who can help me? pushd "\\fax-dataserver\IT\WVL\04. Software\IT_Monitor\IT_Monitor_live\" & '.\IT Monitor.exe' popd

    • 3 replies
    • 2.7k views
  6. 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
  7. Pulseway doesn't seem to send the following script to create an INI file correctly to the target computer. The script runs fine on local Powershell, but it creates a setupconfig.ini file with text as a long string when run through Pulseway. $fqdn=(Get-WmiObject win32_computersystem).DNSHostName+"."+(Get-WmiObject win32_computersystem).Domain $fqdn=$fqdn.Substring($fqdn.IndexOf(".") + 1) $sysfolder="\\$env:computername\sysvol\$fqdn\policies\" $setupconfig="\\$env:computername\sysvol\$fqdn\policies\setupconfig.ini" $functiontext = @" [Setupconfig] auto=upgrade BitLocker=AlwaysSuspend Compat=IgnoreWarning Priority=Normal DynamicUpdate=Enable ShowOOBE=None Telemetry=Enab…

  8. It's fairly simple to create a Windows user account with Powershell. Are there any reasons why this cannot be done with Pulseway via Powershell scripting?

  9. Started by beli3ver,

    Hello, 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.

    • 1 reply
    • 2.6k views
  10. Ok this guy will display the users mapped drive of the user thats logged into the pc as well as the status of the drive, disconnected, Ok, ect... Nice if you's setting up another pc remotely and you want to see what the shared drives on another users pc were so you can match them. #by eDecisions $Taskname = "netuse" $lastlogon = (New-Object -ComObject WScript.Shell).RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\LastLoggedOnUser") SCHTASKS /CREATE /sc ONCE /st 00:00 /TN $Taskname /RU $lastlogon /TR "c:\maplist.bat" start-sleep -s 1 New-Item c:\maplist.bat -ItemType "file" Set-Content c:\maplist.bat 'net use…

    • 0 replies
    • 2.6k views
  11. Is there a way to prompt when a script is ran for input? Like say I make a script that changes the name of the computer, is it possible to make pulseway prompt for what you want the new system name to be? If I could figure this out it would be huge.

    • 2 replies
    • 2.5k views
  12. I feel like I am missing something simple here. I cannot get any PS scripts or commands to execute on client machines from the Pulseway Dashboard. I began by making some simple cache clearing scripts I need to run daily/weekly, and quickly realized those as well as many scripts from my predecessor in the Dashboard were simply not working (folders marked for deletion were still present). In testing, I am now trying to run something as simple as "Restart-Computer" and when ran from the Dashboard (Systems > SystemName > Scripts) it shows as if it ran successfully, but the machine does not reboot. Of course running this command in a non elevated PS prompt directly on th…

  13. Started by PaulWTech,

    I have a Windows 10 Pro (local) machine that is not responding to: wmic UserAccount set PasswordExpires=True I've been digging a big hole looking for a comparable powershell command. Anyone know? Also, how to check if the user cannot change password is set. It does not list using net accounts

    • 2 replies
    • 2.4k views
  14. Update 3rd Party applications eg, adobe, quickbooks, zoom, etc

  15. Started by Nick Grey,

    Hi All we are trying to run the following as a PS script in Pulseway. We have no issues with running the script from the machine but when we running the script via Automation it says it worked and was successful but it makes no changes. thanks Nick New-Item -Path "HKCU:\SOFTWARE\Microsoft\Office\16.0\Outlook\Profiles" -Name "GO_365" -Force Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Office\16.0\Outlook" -Name "DefaultProfile" -Value "GO_365"

  16. Started by OptimisTech,

    What do folks consider best-practice for this? I need to push out a very small app, but PW has no file storage which seems like a HUGE roadblock.

  17. 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…

  18. Not really sure if anything like this has been posted before. I've seen a couple posts about removing services or stopping the monitoring of Automatic services. What I couldn't seem to find in Pulseway was an easy way to take say an inventory of services on machine, and easily convert specific ones to being monitored. Ideally having the agent inventory all services on the machines and then giving us a way to select which ones we want to monitor through the web portal would be ideal. Currently we have to log into the actual computer and do it from within the Pulseway Manager desktop app. Not ideal when you need to monitor specific services across a larger group. …

  19. Started by Youssef Heiba,

    Hello Everyone ! I could find a script that is going to show the internet speed for end-users through Powershell. You can use the follow script to also send an automated email with the results : #https://www.speedtest.net/apps/cli cls $DownloadURL = "https://install.speedtest.net/app/cli/ookla-speedtest-1.0.0-win64.zip" #location to save on the computer. Path must exist or it will error $DOwnloadPath = "c:\temp\SpeedTest.Zip" $ExtractToPath = "c:\temp\SpeedTest" $SpeedTestEXEPath = "C:\temp\SpeedTest\speedtest.exe" #Log File Path $LogPath = 'c:\temp\SpeedTestLog.txt' #Start Logging to a Text File $ErrorActionPreference="Silent…

    • 1 reply
    • 2.2k views
  20. I have created this small script to enable monitoring of the active network adapter on a given machine. Hope this can be of some help for others in the forum. $activeadapter = Get-NetAdapter | Where-Object {$_.status -EQ "UP" -and $_.HardwareInterface -and $_.Name -notlike "*npcap*"} | select DeviceID $DeviceID = $activeadapter.DeviceID Set-ItemProperty "HKLM:\SOFTWARE\MMSOFT Design\PC Monitor\NetworkInterfaces\" -Name count -Value 1 Set-ItemProperty "HKLM:\SOFTWARE\MMSOFT Design\PC Monitor\NetworkInterfaces\" -Name service0 -Value "$DeviceID"

  21. Started by eDecisions,

    I'll circle back and create an array and loop thru the array later, but this should give you an idea where its heading, this script will remove any current excluded items so be carefull, and it will turn off monitoring on just the ones in the script, I use this to reset all clients to the same set of excluded services, the array will be nice to have all the excluded services listed at the top of the script. Remove-Item -Path "HKLM:\Software\MMSOFT Design\PC Monitor\ServicesExcludedFromNotifications\" -Recurse New-Item -Path "HKLM:\Software\MMSOFT Design\PC Monitor\ServicesExcludedFromNotifications\" Set-Itemproperty -path 'HKLM:\SO…

    • 1 reply
    • 2.1k views
  22. I create a PS script that won't run on my workstation, nothing happens. After investigation the script download the EXE file but the installation next runs or executes. Not sure if this is permission issue or a scripting error? Please help me. Below is my current script # Silent Install Dropbox # Download URL: https://vbc-downloads.vonage.com/win/VonageBusinessSetup.exe # Path for the workdir $workdir = "c:\temp\Vonage" # 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 directo…

  23. Started by eDecisions,

    Script enables RDP if its disabled, and enables if its disabled. #By eDecisions $RDP = (Get-ItemProperty -path 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server').fDenyTSConnections If ($RDP -eq 0) { Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server' -Name fDenyTSConnections -Value "1" } IF ($RDP -eq 1) { Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server' -Name fDenyTSConnections -Value "0" }

    • 0 replies
    • 2k views
  24. 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
    • 1.9k views
  25. Started by Kyle Woods,

    For our client security audits, and PEN testing events, we are required to disable NetBIOS on the network adapters. The below script is what we run when an asset registers with Pulseway. $key = "HKLM:SYSTEM\CurrentControlSet\services\NetBT\Parameters\Interfaces" Get-ChildItem $key | foreach { Set-ItemProperty -Path "$key\$($_.pschildname)" -Name NetbiosOptions -Value 2 -Verbose}

    • 0 replies
    • 1.9k views