PowerShell
Share your PowerShell scripts
112 topics in this forum
-
After noticing the addition of Custom Fields to the Scripts section, I was testing it out and wanted to store a value in a Custom Field for each system. I have setup a powershell script that should save a variable value to the Custom Field and ran it against my computer. The script ran successfully, but I am not able to find the Custom Field to see if value was saved properly. Where can the Custom Field be found?
- 6 replies
- 5.5k views
- 1 follower
-
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
-
-
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.6k views
-
-
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.6k views
-
-
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.3k views
-
-
I don't think its possible to have more than one NINJARMM Agent installed, however if there are this script will likely fail, but for a clean ninja install will locate the correct uninstall path and uninstall the ninja agent. $UninstallString = (Get-ItemProperty HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\NinjaRMMAgent*).UninstallString Start-Process -FilePath "$UninstallString" -ArgumentList "--mode unattended"
- 5 replies
- 55.4k 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
-
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.2k views
-
-
This has been bugging the h ell out of me, I need to map a drive, or run a program that can only be run by the logged in user, and if I map the drive from session 0 the user does not see it. The below script works but wish Pulseway had better run as user features built in. This script will map a drive letter for the logged in user, change server and share name to your info. you can change the /TR "any commoand you want to run as the user" $Taskname = "MapX" $lastlogon = (New-Object -ComObject WScript.Shell).RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\LastLoggedOnUser") SCHTASKS /CREATE /sc ONCE /st 00:00 /TN $T…
-
- 5 replies
- 5k 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
-
-
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
-
-
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.7k views
-
-
Disable IPv6 All Network Adapters, the second line allows you to check status of all adapters after run. Carefull, suggest you run on workstations only. Disable-NetAdapterBinding -Name "*" -ComponentID ms_tcpip6 Get-NetAdapterBinding -ComponentID ms_tcpip6 Enable IPv6 All Network Adapters enable-NetAdapterBinding -Name "*" -ComponentID ms_tcpip6 Get-NetAdapterBinding -ComponentID ms_tcpip6
-
- 0 replies
- 2.8k views
-
-
Don't you hate it, turn on the computer and you got all this cra# that comes up before you can start using your computer, users had enough of it, and go figure Microsoft put the run commmand in HKCU rather than HKLM I can't take credit for this one, I added the remove the run item but the balance of the script I found on ChristopherKibble.com, this script loops thru every users of the computer and edit's their HKCU, you run the script once and its fixed for all users on that system. #******************************************************************************************************************************* #** All code is for demonstration only and s…
-
- 2 replies
- 3.4k views
-
-
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
-
-
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
-
-
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
-
So, I have this: Set-ItemProperty -Path "HKLM:\Software\MMSOFT Design\PC Monitor\" -Name ComputerName -Value "$env:UserName" Which works great from the local machine via PowerShell, However, when I try to run this as a script/task, the name just shows up as "HOSTNAME$" Any ideas why?
-
- 8 replies
- 6.8k views
- 1 follower
-
-
Good evening, I would like to use the standard script for windows that is in pulseway automation. But I get this error message: Checking for Windows updates Downloading updates Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) At C:\Program Files\Pulseway\automation_9fdca742_c373_41fb_80e3_ce2b245530ca.ps1:25 char:5 + $Downloader = $Session.CreateUpdateDownloader() + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : OperationStopped: (:) [], UnauthorizedAccessException + FullyQualifiedErrorId : System.UnauthorizedAccessException The user used to execute the script (Settings…
- 6 replies
- 7.6k 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.1k views
- 1 follower
-
I created a script to install an MSI installer. However is I point to a Mapped Drive such as Z:\Working Directory\Installer.MSI it does not execute. If I execute the script from the C:\Temp\Installer.MSI it installs successfully. I've even tried using a UNC Path \\SERVERNAMER\Working Directory\Installer.MSI and it does not execute. Why is this? Does Pulseway not have permission to see the network share? Is there an area when creating the task that I need to enter network credentials. I don't see this. Please advise what I am doing wrong or overlooking Greg
-
- 3 replies
- 7k views
-
-
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…
- 2 replies
- 2.6k views
- 1 follower
-
I created a simple script to update the Pulseway Manager settings. The script verifies if a directory exists, and if it doesn't then creates it. Afterwards, it downloads the file from the URL and saves it to the outpath. Then updates Pulseway Manager config with the file located in the outpath. This has been extremely useful for modifying settings and updating all agents with the new settings. The flow for this process is as follows: 1. Update settings on the Pulseway Manager application, export settings. 2. Upload the settings file to a cloud or web-based URL, I use AWS S3 buckets with a public URL. 3. Add the URL to the $url variable, and change the paths…
-
- 2 replies
- 3.4k views
-
-
Are any of you using Pulseway to install applications not currently installed by third party management? I have applications that I need to install on my network that I would like to use Pulseway Automation for. I'm currently using PDQ Deploy but would like to get rid of it. Any suggestions on how to use Pulseway in this way? I attempted to work with support because I am getting a 1619 error... I tried everything I could find online to resolve this issue, but continued to get this error... I reached out to Pulseway Support, but they were less than helpful. Any thoughts?
-
- 10 replies
- 13.2k views
- 1 follower
-
-
Hi, I'm trying to give all my users a new rdp icon on their desktop to log into our remote environment. How would I do so using powershell? I know .bat would work as well but Im not sure how I would go about it using pulseway.
-
- 3 replies
- 3.3k views
- 1 follower
-