Search the Community
Showing results for tags 'powershell'.
-
Budget: Under $2000 United States My dad made the mistake of buying a dell computer that has horrid cooling and I can hear the fans ramping up full; he has only had this desktop for 3-4 years; it has a Xeon chip and Quadro graphics card with 64 gigs of ram and 2 m.2 nvme drives. He uses the computer for emails, thunderbird, web browsing, watching Netflix, communication through Microsoft teams, chrome and Microsoft edge open with lots of tabs, one note, etc. He uses visual studio, eclipse, powershell, copilot, esri ArcGIS pro; (spatial data, advanced mapping analytics, 2d 3d and 4d visualizations) IntelliJ idea; JavaScript, typescript, kotlin, react, vue, angular, node.js) He also programs in bash and C sharp He has all of these things open at once on a 4k monitor@60hz He was thinking of an i9-13900 with a score of 48,088 on cpubenchmark.net (passmark) and wants the next pc to be around 50,000 (but it can be lower as long as it can run everything he uses) I was hoping he would build his next computer but he is thinking of buying a dell alienware laptop :(. I told him it wouldn’t have as good cooling as building a desktop. So what parts (cpu) amd or intel would be good for his workload, also what gpu (he doesn’t game) but I was thinking like a cheap Radeon card; an all amd build with smart access memory (or intel build) would be good for his workload? Basically intel or amd with 64 gigs of ram a decent motherboard and would fit in a mAtx/mini itx like this one https://a.co/d/i01WITR And if he did buy a laptop what brand/model would be good for his work? (Please link a couple options)
-
I am making a new script for debloating Windows 10, I am into debloating Windows. Is there any advantage to using one over the other. My past scripts was written in PowerShell, but does Batch offer anything.
- 8 replies
-
- programming
- powershell
-
(and 4 more)
Tagged with:
-
Debloat Windows
- 6 replies
-
- debloat windows
- microsoft is evil
-
(and 4 more)
Tagged with:
-
Hi everyone! I'm struggling with some PowerShell script I'm making and I just can't get it to run through everything. So the idea is to import a CSV with the headers and referencing information as below: UserProfileName, ObjectID, Company, CountryOrRegion, Department, Title, Manager, ManagerObjectID I've made the below Powershell script based on the CSV headers: Connect-AzureAD # Get CSV content $CSVrecords = Import-Csv "C:\Book2.csv" -Delimiter "," # Create arrays for skipped and failed users $SkippedUsers = @() $FailedUsers = @() # Loop trough CSV records foreach ($CSVrecord in $CSVrecords) { $upn = $CSVrecord.UserPrincipalName $user = Get-AzureADUser -Filter $UserPrincipalName if ($user) { try{ $user | Set-AzureADUser -Company $CSVrecord.Company -Country $CSVrecords.CountryOrRegion -Department $CSVrecords.Department -Title $CSVrecords.Title Set-AzureADUserManager -ObjectId $CSVrecord.ObjectID -RefObjectId $CSVrecord.ManagerID } catch { $FailedUsers += $upnC Write-Warning "$upn user found, but FAILED to update." } } else { Write-Warning "$upn not found, skipped" $SkippedUsers += $upn } } # Array skipped users # $SkippedUsers # Array failed users # $FailedUsers I'm getting a failure where it picks up the user but fails to update them. Now I'm thinking It's the part I've highlighted in Blue that might be causing the issues... any help certainly welcome!
- 8 replies
-
- powershell
- azure
- (and 4 more)
-
Hi, I would like to run a powershell script where I can loop a command until it comes back false. tnc -ComputerName [Address] -port [port] Start-Sleep -s 5 The script is run every 5 seconds ComputerName : [Address] RemoteAddress : IP RemotePort : Port InterfaceAlias : WiFi SourceAddress : [Address] TcpTestSucceeded : True I need this to run every 5 seconds but only show on false then extract to a doc and continue running. I don't know if this is possible, but any help
-
So i'm relative new to powershellscripting... and i wonder if you can edit certain local security-policies like Applocker and such. If yes, does anyone got a good documentation?
- 3 replies
-
- powershell
- newbie
-
(and 1 more)
Tagged with:
-
Hello, I want to rename Widgets.exe to Widgets.exe.disabled so that windows can no longer find the process. I tried it via the cmd console (rename C:\Program Files\WindowsApps\MicrosoftWindows.Client.WebExperience_421.20050.505.0_x64__cw5n1h2txyewy\Dashboard\ Widgets.exe Widgets.exe.disabled), sadly without success. Can someone help me? Maybe with a script? Don't want to uninstall it. I simply want to rename it so i can activate it again whenever I want. Thanks for every attempt
-
Hi. Is there any way to send a beep to the motherboard beeper (not the soundcard) from Windows? Thanks!
- 4 replies
-
- cmd
- powershell
-
(and 1 more)
Tagged with:
-
I'm trying to re-install Waves MaxxAudio Pro (default audio manager for dell 3585). I had this app installed on my laptop before. Recently, when I used a Debloat Script to clean up junk, along with others it removed this MaxxAudio too. Following this article to re-install MaxxAudio Pro. add-appxpackage -path "C:\Microsoft.WavesAudio.MaxxAudioProforDell2019_2.0.54.70_neutral___fh4rh281wavaa.EAppxBundle" completer error :- add-appxpackage : Deployment failed with HRESULT: 0x80073CFD, A Prerequisite for an install could not be satisfied. Windows cannot install package WavesAudio.MaxxAudioProforDell2019_2.0.54.70_x64__fh4rh281wavaa because this package is not compatible with the device. The package can only be installed on the following device families: Windows.Xbox NOTE: For additional information, look for [ActivityId] 45370058-9063-0001-133f-37456390d701 in the Event Log or use the command line Get-AppPackageLog -ActivityID 45370058-9063-0001-133f-37456390d701 At line:1 char:1 + add-appxpackage -path "C:\Microsoft.WavesAudio.MaxxAudioProforDell201 ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (C:\Microsoft.Wa...rh281wavaa.Appx:String) [Add-AppxPackage], Exception + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.AddAppxPackageCommand Went to Dell driver support and downloads, they don't provide any direct installer for MaxxAudio, just a MS-Store link and I don't have MS-Store. Appreciate your efforts!
- 9 replies
-
- powershell
- windows10
-
(and 1 more)
Tagged with:
-
Hi ! Does anyone know why this doesn't work? $port= new-Object System.IO.Ports.SerialPort COM4,9600,None,8,one $port.Open() while($true) { $line = $port.ReadLine() echo $line If ($line -eq "1"){ echo "Hello" } } If it recieves a 1 it doesn't print Hello.
- 2 replies
-
- powershell
- windows
-
(and 1 more)
Tagged with:
-
Hello there, I wanted to limit the times the main account (Administrator account) of my PC can login. Because it's not a local user, I used the "net user [user] /time" command in PowerShell. The command didn't spit out any errors or something and when I checked back with "net user [user]", it showed the correct time intervals. However, I can still login to this account without any problems, as if the time restrictions didn't exist. I tried restarting my PC multiple times and even tried it on another, non-Admin account, but the command seems to be doing absolutely nothing. Any ideas why? Edit: I tried setting the time limits while being logged on to an Admin and a non-Admin account and setting the limits for Admin and non-Admin account, none of these combinations worked
-
Hey there, I've been trying to get the HardwareHash which is a property of the MDM_DevDetail_Ext01 class in the root/cimv2/mdm/dmmap namespace inside a WinPE instance. Problem is that WinPE even with all cab files installed doesn't have it. I tried working around that by including all .mof .mfl and .dll files from the webm folder. Then running regsvr32 for all dll files and mofcomp for all mof and mfl files to recompile the wmi library. Then I can find the MDM_DevDetail_Ext01 file with wbemtest, but trying to get the wmiobejct i receive a system.accessviolationexception: attempted to read or write protected memory. I'm clueless and any idea would be greatly appreciated. Kind Regards
-
Recently I updated windows 11 to 22h2, and after a reboot this error started to pop up. It appears again after closing it, also after restarting laptop.
-
Is there a way to change the lock screen through a script? I want to force the same lock screen image on every user. I tried this, but didn't work. function Set-MachinePermissions { $RegistryPathPersonalization = 'HKLM:\Software\Policies\Microsoft\Windows\Personalization' If (-NOT (Test-Path $RegistryPathPersonalization)) { New-Item -Path $RegistryPathPersonalization -Force } New-ItemProperty -Path $RegistryPathPersonalization -Name 'LockScreenImage' -Value 'C:\Windows\Web\CSImages\LockScreen.jpg' -PropertyType 'String' New-ItemProperty -Path $RegistryPathPersonalization -Name 'LockScreenOverlaysDisabled' -Value '1' -PropertyType 'DWORD' New-ItemProperty -Path $RegistryPathPersonalization -Name 'NoChangingLockScreen' -Value '1' -PropertyType 'DWORD' New-ItemProperty -Path $RegistryPathPersonalization -Name 'NoLockScreenSlideshow' -Value '1' -PropertyType 'DWORD' } Set-MachinePermissions
- 2 replies
-
- windows
- powershell
-
(and 1 more)
Tagged with:
-
Hi Guys. I have this code that will delete all my backup file in my NAS which are older than x days I am running this code directly from powershell and its works fine But my goal is to have this task run from task scheduler via the "ps1" file but it just not working Double click on this ps1 also not working I have change my ps1 script to always open with powershell, also set ecexution policy to unresricted (not really sure what this does anyway) here is my script Get-ChildItem -Path "Y:\SM Backup\DB Backup" -File -Recurse -Force | Where-Object {($_.LastWriteTime -lt (Get-Date).AddDays(-5))}| Remove-Item -Force Can anyone help? Thank you
-
I have an index.js file that I want to load in the Node REPL to try some stuff, but when I use .load index.js in the REPL, it goes in an infinite loop and keeps repeating the first line in the file. const mongoose = require('mongoose'); I found an alternative solution which works in Ubuntu 20.04.5 in WSL2, which is to use the command node -i -e "$(< index.js)" in the terminal which loads the file perfectly fine and I can interact with its contents. But when I try the same command in PowerShell it gives me this error: < : The term '<' 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:15 + node -i -e "$(< index.js)" + ~ + CategoryInfo : ObjectNotFound: (<:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException C:\Program Files\nodejs\node.exe: -e requires an argument The reason I'm asking about PowerShell "even though I use Ubuntu and things work there", is that I'm taking a web development course, and I provided the solution of using node -i -e "$(< index.js)" to people who were having the same issue, but other people can't get this to work in PowerShell, so I'm just trying to help. and I couldn't find any solution online to this .load issue, or to using an alternative to the node -i -e "$(< index.js)" command in PowerShell. index.js contents: const mongoose = require('mongoose'); mongoose.set('strictQuery', false); mongoose.connect('mongodb://localhost:27017/movieApp', { useNewUrlParser: true, useUnifiedTopology: true }) .then(() => { console.log("CONNECTION OPEN!!!") }) .catch(err => { console.log("OH NO ERROR!!!!") console.log(err) }) const movieSchema = new mongoose.Schema({ title: String, year: Number, score: Number, rating: String }); const Movie = mongoose.model('Movie', movieSchema); const amadeus = new Movie({ title: 'Amadeus', year: 1986, score: 9.2, rating: 'R' });
-
- javascript
- powershell
-
(and 2 more)
Tagged with:
-
I'm pretty new to powershell and im trying to get a good understanding to code but I have no clue what this line does. Is it good or bad?: # Set performance options [System.Environment]::SetEnvironmentVariable("PROCESSOR_5_LEVEL_CACHE", "DISABLED", "User") [System.Environment]::SetEnvironmentVariable("PROCESSOR_CORE_PARKING_CONCURRENCY_THRESHOLD", 0, "User") [System.Environment]::SetEnvironmentVariable("PROCESSOR_IDLE_ALLOW_SCALING", 0, "User") [System.Environment]::SetEnvironmentVariable("PROCESSOR_IDLE_DISABLE", 1, "User") [System.Environment]::SetEnvironmentVariable("PROCESSOR_IDLE_STATE_MAXIMUM", 100, "User") [System.Environment]::SetEnvironmentVariable("PROCESSOR_IDLE_TIME_THRESHOLD", 0, "User") [System.Environment]::SetEnvironmentVariable("PROCESSOR_THROTTLE_MAXIMUM", 100, "User") [System.Environment]::SetEnvironmentVariable("PROCESSOR_THROTTLE_MINIMUM", 100, "User") [System.Environment]::SetEnvironmentVariable("SYSTEM_ADAPTIVE_THRESHOLDS_CONTROL", 0, "User")
-
Hi Guys, I was searching all over the web but couldn't find any simple update scripts for Plex. So I made my own. I hope I can save someone the trouble of writing there own The Script is based on PowerShell [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls -bor [Net.SecurityProtocolType]::Tls11 -bor [Net.SecurityProtocolType]::Tls12 $json = Invoke-RestMethod -Uri "https://plex.tv/api/downloads/1.json" $dl_url = $json.computer.Windows.releases.url $checksum = $json.computer.Windows.releases.checksum $Latest_Version = $json.computer.Windows.version $PlexServerIP = "localhost:32400" $XPlexToken = "YOUR_PLEX_TOKEN" #example: _aBcDEf_12g3hijkL4Mn $Status_url = "http://$PlexServerIP/status/sessions?X-Plex-Token=$XPlexToken" $PlexServerPath = "C:\Program Files (x86)\Plex\Plex Media Server\Plex Media Server.exe" $PMSUpdate_Path = "C:\Users\Administrator\AppData\Local\Plex Media Server\Updates" $Server_Version = (Get-ChildItem -Path $PMSUpdate_Path | sort LastWriteTime | select -last 1).Name $Latest_Pkg_Path = "$PMSUpdate_Path\$Latest_Version\packages" If($Latest_Version -ne $Server_Version) {#Update Required New-Item -Path $Latest_Pkg_Path -ItemType Directory | Out-Null $dl_FilePath = "$Latest_Pkg_Path\PlexMediaServer-$Latest_Version-x86.exe" (New-Object System.Net.WebClient).DownloadFile($dl_url, $dl_FilePath) $dl_FileHash = (Get-FileHash -Algorithm SHA1 $dl_FilePath).Hash If($dl_FileHash -eq $checksum) { #Install Update do { $data = Invoke-WebRequest -Uri $Status_url $isStreaming = !($data -match '<MediaContainer size="0">') if($isStreaming){Start-Sleep -Seconds 10} } while($isStreaming) Start-Process -FilePath $dl_FilePath -ArgumentList "/install","/quiet" -Wait Start-Process -FilePath $PlexServerPath } } What it does: It checks for the newest version of Plex online, compairs it with the latest update-installer your server has. If the file on your server is older it will download the newest one, validates the checksum and Installs it. Why do I need a X-Plex-Tolken? - It is not required, but if you enter your tolken the script can check if a user is still streaming and the script will wait with the install until the stream is closed. (If you dont want to use this function you have to remove the "do-while".) So have fun with it and if you have Ideas to improve it share them with us
- 3 replies
-
- plex
- powershell
-
(and 4 more)
Tagged with:
-
Morning, Do we have a Powershell wiz in the forum who could help me out with creating a couple of scripts, I have just started learning the basics but would like some help. Thanks James.
-
- powershell
- help
-
(and 1 more)
Tagged with:
-
Disclaimer: there are still issues with it that need to be resolved but in general it should work Ever wondered how to change wallpaper to a Christmas theme during Christmas but keeps forgetting? Want to remind yourself of something but sticky/notes is not your thing and you'd rather have a big wallpaper on the screen? Here is how! PART 1: The code First off, open up Windows PowerShell ISE (with Admin rights) Start>All Apps>Windows Powershell ISE C:\Windows\System32\WindowsPowerShell\v1.0\powershell_ise.exe (64-bit) C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell_ise.exe (32-bit) Once the program is open make sure script pane is enabled View > Show Script Pane Next, copy paste the following code to the script pane (the white space) LINK to original code: http://poshcode.org/491 Now edit the very last line [Wallpaper.Setter]::SetWallpaper( 'location', 2 ) Location is where your actual wallpaper is located, example T:\WallpaperTest\blue.jpg Change number 2 to one of the following to match the style you wish 0: Tile 1: Center 2: Stretch 3: No change Since the options are limited to these 4 it is best to find wallpaper that are same resolution or same aspect ratio at least My real life example [Wallpaper.Setter]::SetWallpaper( 'T:\WalllpBackground\harbinger2k914ktv.jpg', 2 ) Save the PowerShell script file to a location convenient to you. We now try to run the script to see if it works or not. Before running the script make sure you can run the script. Type the following to the console pane get-executionpolicy If the result shown as RemoteSigned proceed with next step, if not type this (you can only do that if you have admin rights). This is a security measurement made by Microsoft to prevent malicious scripts that came from the internet to be executed. set-executionpolicy remotesigned Press the green play icon on top to run it or press F5 on your keyboard If no error shown then your wallpaper background should be changed instantly to the one you specify! PART 2: Task scheduler First, open Task Scheduler C:\Windows\System32\taskschd.msc Start > All Apps > Windows Administrative Tools > Task Scheduler Next, press create task on the right Action pane Name it whatever you feel you wish it to be named, Run with highest privileges should be checked. Now go to Triggers tab, select New... and choose what triggers you most in your life (TRIGGGGGEEEERRRRED). In all seriousness, this is where you set your date. If you wish the wallpaper to be changed on Valentine's day then select the time and date for it to be changed (Begin the task should be On a schedule for you to change to a specific time). You can also set it to be repeated too. It's Feb 14 FYI. For now if you have doubt your script will run as intended, change Begin the task to At log on. It will start changing after your computer restarted. Then if you see the wallpaper has been changed for you after the restart you can then change to a specific date **** You have to do this for each wallpaper unfortunately, there is no way to group them for convenience. So far it only changes to one wallpaper but you can set to change to a different wallpaper after a specific time (just make a new task with new wallpaper and set the time to let's say 30mins later) Now go to Actions tab Press New... Under program/script type powershell.exe Under arguments type -executionpolicy bypass location Execution policy bypass allow you to run your script, it will be set temporarily for this script only so the rest execution policy should remain the same Change location to the location of your script, not your wallpaper Conditions, Settings and History tab has nothing much to do, if you are on laptop you can disable Power stuff. The task itself runs within few seconds**** only so no need to stop it (as an option in Settings tab). Hit OK. You are finished! I hope the stars I put out are big enough to see **** still working on a way to see why the script takes time to work through task scheduler. Turning Windows fast startup seems to speed things up (Control Panel > Hardware & Sound > Power Options > Choose what the power buttons do > Change settings that are currently unavailable > Turn on fast startup). It takes time, even on an SSD. So your previous wallpaper will stay for a while.
- 3 replies
-
- wallpaper
- task scheduler
-
(and 2 more)
Tagged with:
-
I have tried to gain remote access through computer management, yet it says that "You do not have access rights to Logical Disk Manager on 'COMPUTERNAME'." I have also tried to gain access with psexec,but the error message Access is denied to 'computername'. I have tried with powershell to get this error message "The WinRM client cannot process the request. If the authentication scheme is different from Kerberos, or if the client computer is not joined to a domain, then HTTPS transport mus t be used or the destination machine must be added to the TrustedHosts configuration set ting. Use winrm.cmd to configure TrustedHosts. Note that computers in the TrustedHosts l ist might not be authenticated. You can get more information about that by running the f ollowing command: winrm help config. For more information, see the about_Remote_Troubles hooting Help topic." Any help on this would be appreciated.
- 1 reply
-
- cd
- remote access
-
(and 3 more)
Tagged with:
-
Hello People, Looking to create a script to do the following in Reg Edit. 1. Load a specific users hive 2. search for HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.lnk\UserChoice 3. If the folder exists, remove it. 4.Unload the hive. I am very very new to PowerShell and so the most I have been able to find that I may be able to modify or use is the following : $regkeypath= "hklm:\Software\Testkey" $value1 = (Get-ItemProperty $regkeypath).test -eq $null If ($value1 -eq $False) {Remove-ItemProperty -path HKLM:\SOFTWARE\Testkey -name test} Else {Write-Host "The value does not exist"} Any help would be greatly appreciated. Jim. *Mods : not sure if this is the correct place for this Topic, understand if its moved*
-
OK so I've been working on learning PowerShell and as it's Daddy weekend I decided to show my kids some fun things that you can do with PowerShell and naturally it didn't work... Lol What I'm trying to do seems like it would be pretty basic but I'm either making it too difficult or missing something. Lol The goal is to have a script or text file that I can enter my children's information in to like this: #Daughter's Information $daughterInfo = @( $firstName = "Sarah" $lastName = "Marshall" $birthday = "October 12th, 2006" $gender = "Her" ) #Son's Information $sonInfo = @ ( $firstName = "Shaun" $lastName = "Marshall" $birthday = "January 30th, 2010" $gender = "His" ) On the second script I would like to write-Host and then write out a bunch of text that will list all the information from the first script but I want to just be able to change one thing so that it pulls information from the correct area. [In PowerShell] Please Select a Child 1. Sarah 2. Shaun [Here you would choose a child, Let's say I chose Shaun] Write-Host "This is some information about $sonInfo.FirstName" Write-Host "Full Name - $sonInfo.firstName $sonInfo.LastName" Write-Host "$sonInfo.gender birthday is $sonInfo.birthday" [PowerShell Output] This is some information about Shaun Full Name - Shaun Marshall His birthday is January 30th, 2010 So obviously I want it to list out more than that but if someone can show me the basic way I should be able to figure out the rest (hopefully) Lol I did Google but I wasn't sure exactly how to word the search... Thanks, Ryan
-
Hi I am looking to write a script that will delete all files in a folder that has a date last modified older that a set file. The best way to match this file is by it name as the date will change based on the last transaction it processes.
- 4 replies
-
- powershell
- bat script
-
(and 1 more)
Tagged with:
-
I am trying to start google chrome with a power shell script but everything that i have tried has not worked. An example of what I have tried is: Start-Process -FilePath "C:\Program Files(x86)\Google\Chrome\Application\chrome" -ArgumentList '--start-maximized' This however throws the error that it can't find the specified application even though it is the default install location and I have checked multiple times that it is correct. I want it to also start so that it full-screens the tab (usually done by pressing f11)
- 14 replies
-
- powershell
- chrome
-
(and 2 more)
Tagged with: