Tag Archives: how to

[PS] Top Ten Simple Powershell commands every IT-admin should know

Welcome everyone!

Today i’m going to share my top 10 (beginner-friendly) Powershell commands that i use quite frequently.

I hope that you will find these commands useful.

 1. Connect to a remote computer:

Enter-PSSession -ComputerName "Computer1"

 

2. Get events from EventViewer:

Get-WinEvent -computername "Computer1" -FilterHashTable @{ LogName = "System"; StartTime = "2020-02-12"}

 

3. Get OS BuildNumber:

Get-WmiObject -Class Win32_OperatingSystem -ComputerName "Computer1" | Select BuildNumber

 

4. Get OS ReleaseID:

(Get-ItemProperty -Path ‘HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion’).ReleaseId

 

5. Get values from the registry:

Get-ChildItem -Path 'HKLM:\PATH\TO\KEY'

 

6. Set values in the registry:

New-ItemProperty -Path "Registry::\HKEY_CURRENT_USER\PATH\TO\KEY\" -Name 'Flags' -PropertyType DWORD -Value "1337"

 

7. Show the latest installed updates (KB’s):

(Get-Hotfix | sort installedon)

 

8. Get serialnumber (CimInstance):

(Get-CimInstance -ClassName Win32_BIOS).Serialnumber

 

9. Get Bios version (CimInstance):

(Get-CimInstance -ClassName Win32_BIOS).SMBIOSBIOSVersion

 

10. Get computer model (CimInstance):

(Get-WmiObject Win32_Computersystem).Model

 

Comment down below if you have any questions! 🙂

How to Reset the Color of the Command Prompt in Windows 10

Hi everyone!

Recently bumped into an issue regarding the classic command prompt (CMD).

 

Problem:

CMD colors are changed so that you are unable to see the text, and cannot change back (for whatever reason)

 

Solution:

Change the REG_DWORD DefaultColor to “7

HKEY_CURRENT_USER\Software\Microsoft\Command Processor
Set-ItemProperty -Path 'HKCU:\Software\Microsoft\Command Processor' -Name DefaultColor -Value "7"

 

Voila!

Procmon saves the day!

 

Retrieve full download URL in Google Chrome

Hello geeks!

What do you do when the Copy link address button isn’t there?

Today i’m going to show you how to retrieve the full download URL (with file extension) for any download in Google Chrome. WGET for example requires the “true” download url, with file extension in order to download the file.

I’m guessing that you’ve already know that you can press “Copy link address” on many Download buttons to retrieve the download URL, if not, know you know.

 

But what if you’re not seeing the “Copy link address” button, like this?

Or what if the link you get when pressing Copy link address is a redirect or just not the direct download path to the file?

Then you simply do this:

  1. Press the Download button
  2. Open Downloads (CTRL + J)
  3. Right click the downloaded file, and press copy link address

 

Or if you want to dig down deeper, you could extract the URL using inspect-mode:

    1. Start Google Chrome, and have your download button ready, don’t press it yet.
    2. Open Inspect-mode (CTRL + SHIFT + I)
    3. In Inspect-mode, select Network
    4. Press your Download button
    5. Now immediately after, press Stop recording network log (CTRL + E)
    6. Now you should see the raw file under Name, in this example ChromeSetup.exe
    7. Right click on ChromeSetup.exe -> Copy -> Copy link address (see picture below)
    8. Now you should have copied something like this https://website.com/file.exe

I hope that this was helpful & feel free to comment down below if you have any questions 🙂

 

1 0