Tuesday, September 3, 2024

How to get a list of installed programs on a Windows PC

Powershell 

get-package -ProviderName Programs,msi | export-csv c:\temp\InstalledApps.csv

Command line

wmic product get name,version

Export from Windows registry


  
## List 32bit installed programs

$regPath = 

'HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*'

Get-ItemProperty -Path $regPath |

Select-Object DisplayName, DisplayVersion, Publisher, InstallDate

## List 64bit installed programs

$regPath = 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*'

Get-ItemProperty -Path $regPath |

Select-Object DisplayName, DisplayVersion, Publisher, InstallDate


Sunday, June 9, 2024

How to manage users on a Cisco switch

switch# config t

List users
show user-account

Show particular user
show user-account user1

Add user
username user1 password abcd123AAA expire 2003-05-31

Delete user
no username user1 privilege 15 secret 5 $1$j5dF$8SGPjO2Um5mstBsvtA4cO/

Assign a role
username user1 role network-admin

Remove the user from a role
no username user1 role network-operator

Monday, February 12, 2024

Insert a horizontal line into Word or Outlook by typing a few characters

Place the cursor where you want to insert the horizontal line.

Type three of the characters shown below, and then press Enter.






The line is inserted for the full width of the page. When inserted into a column, the line is inserted to match the width of the column. To add text above the line, put your cursor where you want the text and begin typing.

Wednesday, July 19, 2023

Setting Global Git Username and Email

The global git username and email address are associated with commits on all repositories on your system that don’t have repository-specific values.

To set your global commit name and email address run the git config command with the --global option:

git config --global user.name "Your Name"

git config --global user.email "youremail@yourdomain.com"

Wednesday, July 5, 2023

How to unlock the ESXi root account from the console

Press CTRL+ALT+F1 to launch the ESXi Shell

At the ESXi shell login with root and the password

Run the following commands to show number of failed attempts:

pam_tally2 --user root

Run the following command to unlock the root account:

pam_tally2 --user root --reset

Sunday, February 12, 2023

Set time zone on Windows using PowerShell

Get-TimeZone

Set-TimeZone -Name 'Eastern Standard Time' -PassThru

Set-TimeZone -Name 'Coordinated Universal Time' -PassThru

Friday, November 18, 2022

Check and repair Windows file system

If some Windows functions aren't working or Windows crashes, use the System File Checker to scan Windows and restore your files.  

Open the command prompt as an administrator and run the following:

sfc /scannow

Additionally run Deployment and Imaging Tools Environment commands:

DISM /Online /Cleanup-Image /CheckHealth
DISM /Online /Cleanup-Image /ScanHealth
DISM /Online /Cleanup-Image /RestoreHealth

Monday, August 1, 2022

How to Extract Private Key From a Certificate using OpenSSL

Import new Cert PEM file into local SSL Cert store. Make sure you mark the key as exportable. Next, export the certificate as PFX and make sure to export the key along with the cert.

Take the file you exported (e.g. certname.pfx) and copy it to a system where you have OpenSSL installed. Note: the *.pfx file is in PKCS#12 format and includes both the certificate and the private key.

Run the following commands to extract the key:

Run the following command to export the private key: openssl pkcs12 -in certname.pfx -nocerts -out certame.key.pem -nodes

Optionally, run the following command to remove the passphrase from the private key: openssl rsa -in certname.pem -out certname.key 

Tuesday, July 26, 2022

Network Mapped Drives are Not Available to Administrators when application launched via Run As Administrator

When User Account Control (UAC) is enabled, if you run a program as Administrator (elevated), you cannot see the network drives that were mapped under the non-admin account.

In order to correct this behavior, you need to Enable Linked Connections in the registry.

Under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System, create or set the EnableLinkedConnections value (a DWORD 32-bit number) to 1.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System]
"EnableLinkedConnections"=dword:00000001