Search the Community
Showing results for 'how to powershell'.
Found 436 results
-
issue running cmdlet
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
-
issue running cmdlet
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
-
PowerOfTheShell Plugin 1.5
Hi Community, I just want to share that I am soon going to release my first plugin on Pulseway forum. The plugin is all about PowerShell, that's why I have decided to call it "PowerOfTheShell" This plugin is for all those of you that want to run PowerShell script while you are on the go and get the results immediately from with in Pulseway directly on your device. I use Powershell and C# almost every day in my line of work, so it was just very clear to me that I just had to write a plugin, that I could use with this great software. Main features are: The menu of PowerOfTheShell including subpages with script commands is easy to configure through a simple layout found in a config XML file. Run any PowerShell script version 1.1, 2.0, 3.0, 4.0 and have the result(s) shown in Pulseway. Supports WINRM scripts, Execute remote commands on several machines/servers and have the results in one place. Last retrieved results including date and time, is always available while Pulseway is running. Select max results to be shown. Good if your script returns a lot of results and you want to control the amount visible. Information about script status Idle/running. Configure plugin impersonation settings from within Pulseway Manager. Support for Nested pages. Support for Pulseway API 3.0 Input Controls. Support for "partial" input control ( run scripts with or without all input values assigned ) Support for setting the log level in the plug-in configuration form. Hope this can be interesting to some. The possibilities is endless if you can script it Best Regards Johnni *Update* 1.5 is out. (28-06-2015) Download POTS Please Try it out and let me know what you think Changes: Upon request I have added support for parameters that have spaces in the input controls e.g a string containing firstname and lastname are now seen as one parameter and not two. Making it possible to ask for more complex inputs Build against System.Management.Automation 4.0 Code optimization and cleanup Read the "read me first file" in the zip for more information. *Script pack V1 is included in the zip. http://pcm-plugins.blogspot.com/ View this blog I have been setting up for "how to".
-
SNMP Configuration Script
I can give you some links to get started... Install SNMP on Windows: https://theitbros.com/snmp-service-on-windows-10/ It looks like both Group Policy and registry merge work for setting most of the parameters. You'll want to pay attention to the security issues, especially for laptops. Otherwise, this has lots of Powershell that should be pretty straightforward to assemble into a script for Win10 (and maybe Win11) Also worth reading, but less helpful than the link above: https://blog.paessler.com/how-to-enable-snmp-on-your-operating-system The best reason to read this one is if you support Linux or Mac and need SNMP on those systems.
-
SNMP Configuration Script
Hi, I work for a small IT business that is attempting to set up Network Glue (Basically a network information collector) which uses SNMP to collect information. I'm looking for a script that can install the SNMP service, and then adjust the settings to change startup to automatic, set the service to allow sending all possible information, (example shown in screenshot), set the community name to public, allow that community READ ONLY rights, and only accept SNMP packets from the Hostname "Twiz-PC". I've seen some stuff online but we are not fluent enough in Powershell to risk editing registry stuff ourselves, and having this automation will greatly help us in deploying to our clients. I was wondering if anyone on here already has a similar script that we could adjust for our needs. Thanks in advance!
-
Device Rename Error. (Locally tested fine)
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 Pulseway: Rename-Computer : Skip computer 'bpSurfacePro' with new name 'PREFIX-BPSURFACEPRO$' because the new name is not valid. The new computer name entered is not properly formatted. Standard names may contain letters (a-z, A-Z), numbers (0-9), and hyphens (-), but no spaces or periods (.). The name may not consist entirely of digits, and may not be longer than 63 characters. + Rename-Computer -ComputerName $oldName -NewName $newPCName + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (PREFIX-BPSURFACEPRO$:String) [Rename-Computer], InvalidOperationExcept ion + FullyQualifiedErrorId : InvalidNewName,Microsoft.PowerShell.Commands.RenameComputerCommand Attached screenshot of a different machine exhibiting the same issue. (Other remote user is not currently online.)
-
Discovery probe failing
Hi McHenry, In order to disable the desktop icon please run the following powershell line: Remove-Item 'C:\Users\*\Desktop\Pulseway Manager.lnk' Regarding your other query - lock one system and take a note of the following registry values: HKLM:\SOFTWARE\MMSOFT Design\PC Monitor\PreventChanges HKLM:\SOFTWARE\MMSOFT Design\PC Monitor\PreventChangesPassword HKLM:\SOFTWARE\MMSOFT Design\PC Monitor\PreventChangesPasswordCtrl Then put the values into this powershell script: Set-ItemProperty -Path "HKLM:\Software\MMSOFT Design\PC Monitor\" -Name PreventChanges -Value "Enter the saved PreventChanges from the machine you've just configured" Set-ItemProperty -Path "HKLM:\Software\MMSOFT Design\PC Monitor\" -Name PreventChangesPassword -Value "Enter the saved PreventChangesPassword from the machine you've just configured" Set-ItemProperty -Path "HKLM:\Software\MMSOFT Design\PC Monitor\" -Name PreventChangesPasswordCtrl -Value "Enter the saved PreventChangesPasswordCtrl from the machine you've just configured" Add the three powershell lines into an automation script, link it to a task and run it to set the configuration lock on your systems.
-
Update Computer Name with Logged on Username
Hey Fellow PW users, I've created a script which allows the system to change its name to %computername%-Current logged on username, which makes life a little easier when trying to remote to their computers on the remote control tool/Webapp. To get started, create your script in the script editor, in my example, Name: Update Computer Name with Logged on Username Windows/Powershell Code: $pwqusers = quser | Select-Object -skip 1 $pwquserfmt = $pwqusers.substring(1,22).Trim() -join "," Set-ItemProperty -Path "HKLM:\Software\MMSOFT Design\PC Monitor\" -Name ComputerName -Value "$env:computername-$pwquserfmt" Click Save. Next we create at new task, Name: Update Computer Name with Logged on Username Current Scope -> Windows Workstations Enable Scheduling -> (I've set it to run once a day) Every weekday (Monday to Friday), starting on 12 August 2018 at 09:00 (Australia/Brisbane) Scripts tab, Select/add your new script you just created and once that's done click save. You can now run the task on demand as well which will update all of the PC's in your windows workstations scope to Computer Name-Logged on usernames This works for RDSH hosts as well however it could get a bit of out hand if you have 5-10+ users logged in so I probably wouldn't recommend it to be used on servers. I Hope this helps you somehow, these scripts/suggestions come with no warranty and I bear no responsibility if this breaks anything, use at your own risk etc..etc.. Cheers, Quenten
-
Force local user account password change
I have been beating my head against this for a while. I can these commands locally and they work fine, but when I use Pulseway they throw errors on the variable for the username. I have tried running all in one script from powershell and I have broke it up in to two scripts the first 2 line being in powershell (which works as intended) and the second line in batch (also tried running manually from terminal). Im sure there is something small I am doing wrong and I would appreciate the help, thanks $user= get-wmiobject-class win32_computersystem | select-object username wmic UserAccount where name=$User set Passwordexpires=true net user $env:USERNAME /logonpasswordchg:yes I dont have a domain for GPO
-
Autologon One time and Restart
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 "AutoLogonCount" -Value "1" -type DWord Start-Sleep -Seconds 15 ; Restart-Computer -Force
-
Rename-Computer
Hi @AMC, Based on the documentation, the DomainCredential parameter says: We run PowerShell in a non-interactive mode, this prevents inputs from being triggered. You can provide a PSCredential object instead of the username and that should do the trick. $password = "ThisIsAPlaintextPassword" | ConvertTo-SecureString -asPlainText -Force $username = "contoso\Administrator" [PSCredential] $credential = New-Object System.Management.Automation.PSCredential($username, $password) Rename-Computer -NewName "NewComputerName" -DomainCredential $credential -Restart -Paul
-
Rename-Computer
Hi Folks, I'm new to Pulsewau scripting, please bear with me. I've tried to run the following PowerShell command, but it doesnt seem to run. Rename-Computer -NewName "Computer123" -DomainCredential MyDomain\Administrator -Restart Any advice on what I should do, to rename a computer?
-
Script to restart Pulseway on demand
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 thennnn.......... nothing! Because we stopped the service, it kills whatever user environment pulseway was using including the script and it never finishes the command. It's really weird. So I setup this wonderful little script that creates a scheduled task, that can be run on demand using another script. It keeps you from running a restart service task on all your end points and suddenly losing connection with them all.... not fun. So here is the first script you put in to pulseway. Read the comments and change the working directory, user account and password to match what you use. It also requires a universal user account on all your workstations that you want to use it on. # this script will create a scheduled task that runs a powershell script that restarts the pulseway service. # This line deletes the task if it already exists. That way if you make changes to the task it will create a fresh copy of it. schtasks /delete /F /tn "Restart Pulseway" # working directory path $workd = "c:\temp" # Check to see if working directory exists and create if it does not. If (!(Test-Path -Path $workd -PathType Container)) { New-Item -Path $workd -ItemType directory } # Create a variable with the entire contents of the XML file used to create the scheduled task $text = '<?xml version="1.0" encoding="UTF-16"?> <Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task"> <RegistrationInfo> <Date>2017-04-24T12:50:26.5825569</Date> <Author>ECHO-FAMILYPC\Echo</Author> <Description>this will restart the pulseway service, forcing it to check for and implement any updates.</Description> <URI>\Restart Pulseway</URI> </RegistrationInfo> <Triggers> <CalendarTrigger> <StartBoundary>2017-04-24T11:00:00</StartBoundary> <Enabled>true</Enabled> <ScheduleByDay> <DaysInterval>1</DaysInterval> </ScheduleByDay> </CalendarTrigger> </Triggers> <Principals> <Principal id="Author"> <UserId>S-1-5-21-3275926025-1642913270-681481828-1006</UserId> <LogonType>Password</LogonType> <RunLevel>HighestAvailable</RunLevel> </Principal> </Principals> <Settings> <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy> <DisallowStartIfOnBatteries>true</DisallowStartIfOnBatteries> <StopIfGoingOnBatteries>true</StopIfGoingOnBatteries> <AllowHardTerminate>true</AllowHardTerminate> <StartWhenAvailable>true</StartWhenAvailable> <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable> <IdleSettings> <StopOnIdleEnd>true</StopOnIdleEnd> <RestartOnIdle>false</RestartOnIdle> </IdleSettings> <AllowStartOnDemand>true</AllowStartOnDemand> <Enabled>true</Enabled> <Hidden>false</Hidden> <RunOnlyIfIdle>false</RunOnlyIfIdle> <WakeToRun>true</WakeToRun> <ExecutionTimeLimit>PT72H</ExecutionTimeLimit> <Priority>7</Priority> </Settings> <Actions Context="Author"> <Exec> <Command>Powershell.exe</Command> <Arguments>-ExecutionPolicy Bypass '+$workd+'\rstrtPulse.ps1</Arguments> </Exec> </Actions> </Task> ' # Create a variable containing the entire contents of the powershell script that will restart the pulseway service. $text2 = 'ReStart-Service "Pulseway"' # Pump the contents of the two variables into the actuall files to be used $text | Set-Content $workd\rstrtPulse.xml $text2 | Set-Content $workd\rstrtPulse.ps1 # Command that actually creates the scheduled task. You will need to change UserName and Password to the universal admin creds that you may use. schtasks.exe /create /xml "$workd\rstrtPulse.xml" /tn "Restart Pulseway" /ru UserName /rp Password #Wait a couple seconds Start-Sleep -s 2 # Delete the files when done. Dont need anyone knowing my secrets! del $workd\rstrtPulse.xml del $workd\rstrtPulse.ps1 Here is the second script that you will use to execute the scheduled task schtasks /run /tn 'Restart Pulseway' Have fun, stay safe, always test your scripts!
-
Q - Installing Pulseway during AutoPilot enrollment?
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.
-
Q - Installing Pulseway during AutoPilot enrollment?
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.
-
Windows Update PS Script Automation
Hi @Chris1992, If you have configured the PowerShell impersonation in Pulseway, then all PowerShell scripts via Pulseway will be executed using account Pulseway, which is shown into the image. Does that account has full access rights to the C:\Program Files\Pulseway\ folder on that particular system to execute the script?
-
Scripts
Hi @Spicy Support, Currently this option is available for PowerShell scripts if the PowerShell impersonation is configured from the Pulseway Manager -> Settings -> Runtime on the remote system on which this script will run. Note: this script will still be executed in session zero with no GUI. Alternatively you may deploy PsExec on your systems to interact with user session with GUI. For more details abut this, please check out this post:
-
Script to control pulseway agent
Each client has different implementations of a specific 'action', lets say action A. I have created batch scripts on each client to handle these implementations, so all clients have a C:\Scripts\StartActionA.bat file. These actions have to run in an existing user session with GUI, so I have set up a powershell script in Pulseway called StartActionA which contains: cmd.exe /c 'psexec -i 1 -d "C:\Scripts\StartScriptA.bat"' Through an agent, (phone or my.pulseway.com) I can run this script for a specific PC, and it works beautifully. It seems as if the windows-agent doesn't support launching scripts, which is in fact a secondary issue. My goal is now to have disctinct scripts (can be powershell, batch, ...) that sits on a PC (with an agent installed probably) that instructs pulseway to : run StartActionA on Client A run StartActionB on Client A run StartActionA on Client B run StartActionB on Client B ... After this is done, I can hook up an elgato streamdeck to launch these last scripts. That's the final goal. I've been struggling with the scripts that interface with Pulseway to instruct Pulseway to launch ScriptA on ClientA. Is this at all possible? Kind regards, Arne
-
Asset_Info Empty
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?
-
How to uninstall Pulseway when installer is not in Add/Remove programs?
You can use this Powershell script: try { $result = Get-WmiObject win32_product -filter "Name LIKE 'Pulseway'" | Select-Object IdentifyingNumber; [string]$a = $result.identifyingNumber; msiexec.exe /X $a /qn Remove-Item -Path "HKLM:\SOFTWARE\MMSOFT Design" -Recurse Write-Host "$a Uninstallation completed successfully" } catch { Write-Host "Uninstallation failed" Break }
-
Can't uninstal Kaspersky agent - uninstall option "disabled by policy"?
You can try this Powershell Line also: Start-Process -FilePath "$env:ProgramFiles\Pulseway\AV\setup.exe" -ArgumentList "/pKLLOGIN=KLAdmin /pKLPASSWD=rkutnuetnd /s /x" -Wait
-
Is there a way to create a VM checkpoint from a Hyper-V server via the app?
One method of achieving this, would be that you could write a PowerShell script that creates the checkpoint, and then you could call that from either a workflow (if something happens) or on demand (via a script).
-
How to uninstall Pulseway when installer is not in Add/Remove programs?
Put back the registry entry or use PowerShell to grab the uninstall string and script the uninstall.
-
Creata a Windows user account?
Via PowerShell through Pulseway. We have since tried it and it works fine.
-
Ask for user confirmation before allowing RDP
Hi, The remote desktop tab in the Pulseway manager displays greyed out options. I'm not able to tick or untick the "Enable remote desktop" despite being an admin. I managed to enable it using Powershell. However, I now have the problem where the "Ask for user confirmation before allowing any remote desktop session" is also greyed out and "deny the connection" is ticked. Is there a powershell command to change it to "allow the connection" please? Thanks in advance.