PowerShell
Share your PowerShell scripts
112 topics in this forum
-
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"
-
- 2 replies
- 2.9k views
-
-
I made a install script for Calibre to do a Silent install. UPDATED VERSION 2 With auto detect if Invoke-WebRequest exists Improvements are welcome! # Silent Install Calibre # https://calibre-ebook.com/download # 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://calibre-ebook.com/dist/win32" $destination = "$workdir\calibre.msi" Invoke-WebRequest $source -OutFile $destination # Start the inst…
-
- 1 reply
- 5k views
-
-
I made a install script for Skype to do a Silent install. UPDATED VERSION 2 With auto detect if Invoke-WebRequest exists Improvements are welcome! # Silent Install Skype # https://www.skype.com/en/download-skype/skype-for-windows/ # 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.skype.com/go/getskype-full" $destination = "$workdir\skype.exe" Invoke-WebRequest $source -OutFile $destination # Sta…
-
- 1 reply
- 15.9k views
-
-
I made a install script for Google Chrome to do a Silent install. UPDATED VERSION 2 With auto detect if Invoke-WebRequest exists Improvements are welcome! When a new version of Google Chrome comes out follow this url: https://enterprise.google.com/chrome/chrome-browser/ Next find the download button -> Right click on the download button and choose Copy Download Location paste it in the script and it will download the latest version. # Silent Install Chrome # https://enterprise.google.com/chrome/chrome-browser/ # Path for the workdir $workdir = "c:\installer\" # Check if work directory exists if not create it If (Test-Path -Path $wor…
-
- 1 reply
- 23.3k views
-
-
Here is a script to remove Dropbox with PowerShell. Be aware that your Dropbox could also be removed. #Script to remove Dropbox #This May remove your dropbox folder contents form your computer #By: Enrique Sanchez #Dropbox Paths $Dir = "C:\Users\" $drop = "\Appdata\Roaming\Dropbox" $dropM = "\Appdata\Roaming\DropboxMaster" $DropD = "\Dropbox" $StartM = "\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Dropbox" $Short = "\Desktop\Dropbox.lnk" #Kill related processes taskkill /im dropbox.exe /f taskkill /im explorer.exe /f Get-ChildItem -name c:\users | foreach ($_) { Remove-Item -recurse -force $Dir$_$dropD -ErrorAction SilentlyContinue Remove-…
-
- 1 reply
- 14.4k views
-
-
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.3k views
-
-
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…
-
- 1 reply
- 5.9k views
-
-
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…
-
- 1 reply
- 6.2k views
- 1 follower
-
-
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
-
-
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.7k views
-
-
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
-
-
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
-
-
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
-
-
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
-
-
Here is a script for Powershell to set the pc to autologon one time [configurable] after restart, with a 15 sec delay Someone may find it handy Copy paste into Powershell ISE or txt and then rename to *.ps1 Tested on Windows 7 X64 $RegPath = "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" $DefaultUsername = "Insert Username Here" $DefaultPassword = "Insert Password Here" Set-ItemProperty $RegPath "AutoAdminLogon" -Value "1" -type String Set-ItemProperty $RegPath "DefaultUsername" -Value "$DefaultUsername" -type String Set-ItemProperty $RegPath "DefaultPassword" -Value "$DefaultPassword" -type String Set-ItemProperty $RegPath "Auto…
- 1 reply
- 7.2k views
- 1 follower
-
When entering the following, script, I get an error. The error message indicates that the script is adding a "$" character to the device name, and I can't figure out why. This script has been tested verbatim, working, as a locally-run script.. It will not work when pushed through Pulseway's Powershell automation. (generic PREFIX- inserted for relative anonymity) Screesnshots of Pulseway script Syntax attached, as well as identical, locally run syntax. #### $name = $env:UserName $oldName = $env:ComputerName $newPCName = "PREFIX-" + $name Rename-Computer -ComputerName $oldName -NewName $newPCName ### The error message viewed through Pulse…
- 1 reply
- 3.4k views
- 1 follower
-
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
-
-
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.3k views
-
-
Hi, I am trying to install GCPW (Google Credential Provider for Windows). I am running into issue where with it: <# This script downloads Google Credential Provider for Windows from https://tools.google.com/dlpage/gcpw/, then installs and configures it. Windows administrator access is required to use the script. #> <# Set the following key to the domains you want to allow users to sign in from. For example: $domainsAllowedToLogin = "acme1.com,acme2.com" #> $domainsAllowedToLogin = "" Add-Type -AssemblyName System.Drawing Add-Type -AssemblyName PresentationFramework <# Check if one or more domains are set #> if ($domainsAllowedToLogin.Equal…
-
- 1 reply
- 5.3k views
-
-
I made a basic script to run diskcleanup silently, I already configured it...and the script seems to execute the disk cleanup on the local machine but it runs indefinitely, meaning pulse way doesn't seem to know when the script is done. ..any help is appreciated cleanmgr /verylowdisk /sagerun:5
-
This will stop and restart EXPLORER.EXE for the currently logged in user. #By eDecisions $TasknameStop = "ExplorerStop" $TasknameStart = "ExplorerStart" $lastlogon = (New-Object -ComObject WScript.Shell).RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\LastLoggedOnUser") SCHTASKS /CREATE /sc ONCE /st 00:00 /TN $TasknameStop /RU $lastlogon /TR "taskkill /f /im explorer.exe" SCHTASKS /CREATE /sc ONCE /st 00:00 /TN $TasknameStart /RU $lastlogon /TR "explorer.exe" start-sleep -s 1 schtasks /Run /TN $TasknameStop start-sleep -s 1 schtasks /Run /TN $TasknameStart start-sleep -s 1 schtasks /delete /tn …
-
- 1 reply
- 4.7k views
-
-
Not my work, I took code form two locations and put them together to fit my needs, change the path to the path to your folder, change the filter to the file type to filter by, add as a script, run it, and then open your Last Executions to see the contents of the file. I was needing to check status of a log file on a server every so often, the log file name would change daily and be time stamped, this solved it for me. $dir = "C:\data\Sync_Reports" $filter="*.txt" $latest = Get-ChildItem -Path $dir -Filter $filter | Sort-Object LastAccessTime -Descending | Select-Object -First 1 $latest.name Get-Content $dir"\"$latest
-
- 1 reply
- 6.1k views
-
-
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.
-
- 1 reply
- 2.2k views
- 1 follower
-
-
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. …
-
- 1 reply
- 2.2k views
-
-
Need help in how to Force close Outlook and reopen and syn
-
- 1 reply
- 1.7k views
-