Category Archives: Tips & Tricks

Advice, tips and Information.

Using OpenSSH and SSH on Windows

Published by:

Secure Shell software allowing connections between clients and servers for remote administration.

Related Powershell Commands:
Check the installation status
Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH*'

Start the service
Start-Service sshd

Change the service startup behaviour
Set-Service -Name sshd -StartupType 'Automatic'

Add/Install the service
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
Local Tunneling allows a port on your local client machine to act as a port on the remote server.
Jump to remote tunnel at 7m 43 secs
Useful Commands to show the logged in user account etc:

tasklist /s <pcname> /fi "imagename eq explorer.exe" /v

wmic /node: <pcname> computersystem get username

wmic /node: <pcname> computersystem get manufacturer, model, username

Or locally:
wmic computersystem get manufacturer, model, username

Change the Network Hostname (Requires Admin account)
Using CMD
wmic computersystem where name="%COMPUTERNAME%" rename "NewName"

Use Powershell and CMD to switch between sessions on either command line  

Using Powershell
Rename-Computer "NewName" -Restart

Windows cURL on the command line

Published by:

Command line and scripting tool for transferring data with URLs see the website Curl.se

curl -L -A "Mozilla" http://website.com

This follows re-directs and uses a dummy header to anticipate 406 Not Acceptable errors then returns the page content, you can use a full header string to represent other browsers

This YouTube video is presented by the cURL creator

Clearing & formatting a drive from the command line using Diskpart

Published by:

Run diskpart from the Commmand prompt – Run CMD from the Start Menu or Run dialogue box using WinKey + R to get to the command prompt

Then use the commands below in sequence within the diskpart interface

list disk

select disk [#] (adding the reference number from the list command above)

clean (permanent delete content)

create partition primary

format fs=ntfs

assign (gives a drive letter – unspecified)

exit to leave diskpart

Managing Windows Device Drivers with Powershell

Published by:

Exporting the third party device drivers from your running windows installation.

Export-WindowsDriver -online -Destination D:\path\folder

Exporting the third party device drivers from a windows image

Export-WindowsDriver -Path E:\ -Destination D:\path\folder

See Microsoft documentation

Add all device drivers from folder tree to a windows image

Add-WindowsDriver -Path "E:\offline" -Driver "D:\drivers" -Recurse

Add an unsigned device driver to a windows image

Add-WindowsDriver -Path "E:\offline" -Driver "D:\driver.inf" -ForceUnsigned

See Microsoft documentation

Windows Update Problem 20H2 on HP legacy machines

Published by:

During the course of 2021 as several machines updated to Windows 10 Version 202H2 both 32 bit and 64 bit they demonstrated catastrophic failures that mimicked other problems. These included Windows displaying a BSOD. Message ‘BAD SYSTEM CONFIG INFO’ refering to log files at ‘c:\windows\system32\logfiles\srt\SrtTrail.txt’. Other messages would be typical of those displayed when hard drives are really failing. After running automatic repair and disk checking – they would then repeat the process. The machines would re-boot repeatedly. Attempts to use the self-repair options or Windows boot drives would lead to User accounts disappearing from the options and failure to find Restore points (if available). One machine would lock on the dark start-up screen many times, then would successfully boot and run for days as long as it wasn’t powered down. Another machine was running normally then Outlook 2019 ‘disappeared’ before the machine started cycling through the other symptoms.

Machines affected included: HP dc7900, HP dc8200.

The resolution to all this, so far, was Windows 21H1 either by fresh installation or using the Windows update assistant if the machine was capable of running it.