>NULL

Wednesday 24 April 2024

Adding SQLSERVERAGENT permission on certificate private keys

The format to use is NT Service\SQLSERVERAGENT

Set the Location to the local machine rather than the domain.


Monday 22 April 2024

Scheduled Wake on LAN (WoL) via crontab on Mango router

I wanted my pc to boot up each workday at 08:50, so decided to use my Mango router as it's already on the network and runs OpenWRT.


  1. Install etherwake via: http://<mango-IP>/cgi-bin/luci/admin/system/opkg

  2. Use: https://crontab.guru/#50_8_*_*_1-5 to find the crontab timing.

  3. SSH to the Mango router and run the following command to find the name of your LAN interface that can see the target PC.
    IP a

  4. In http://<mango-IP>/cgi-bin/luci/admin/system/crontab add the following line.
    50 8 * * 1-5 etherwake -b -i br-lan <MAC address of target PC>





Thursday 21 March 2024

Cannot resize Azure VM due to Accelerated Networking being enabled

 You decide to drop the size of a D series Azure VM to B series and are told it's incompatible with Accelerated Networking, perhaps you don't care.

Here's how to disable Accelerated Networking, no reboot required!

In Azure Portal, find the relevant info for your VMs 'network interface name' and 'resource group name', use those in place of the <placeholders> and run the command in Azure CLI from the icon in the top-right of the portal. 

Your VM will continue to run and will not drop the network connection. Once the command has completed you can resize your VM.


az network nic update --accelerated-networking false --name <network interface name> --resource-group <resource group name>



Wednesday 20 March 2024

Outlook Room Finder does not load data/work

The error message: We can't open the Room Finder right now. Please try again later.

For Room Finder to load data in Outlook 'Edge Webview2' is required to be installed, this appears not to happen on RDS Session hosts.

Webview2 can be installed on a user-by-user basis or for all users if installed by a local admin. The Evergreen edition is recommended in most cases.

Friday 24 November 2023

Get a list of user SIDs in CMD

 There are plenty of complex queries for this task but the simplest way to get a user's SID is just to list them all. 

wmic useraccount get name,sid


 

Tuesday 21 November 2023

Start menu stops working in Windows Server 2019 & 2022

 You find that the Start button does nothing when left-clicked, you still get the Win+X menu when right-clicking.

This article has a great writeup. I have found the solution does work, although users will see a delay when logging off.

https://www.phy2vir.com/windows-server-2016-2019-rds-server-black-screen-or-start-menu-not-working/

If you are fully patched add the following reg key.

Add “DeleteUserAppContainersOnLogoff” (DWORD) in “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy” and set it to 1. 

It's worth reading the whole article linked above as it explains the issue better and there is a script which can help with removing extra firewall rules that contribute to the issue.


Monday 16 October 2023

Non RDS, RDP Certificate Install

To get rid of the yellow untrusted warning when connecting to RDP. 

1, Install the cert via MMC.

2, In PowerShell run the following.
Get-Childitem Cert:\LocalMachine\My

 

3, Copy the Thumbprint and run the following replacing the word 'Thumbprint' without spaces or extra character at the beginning.

wmic /namespace:\\root\CIMV2\TerminalServices PATH Win32_TSGeneralSetting Set SSLCertificateSHA1Hash="Thumbprint"

Monday 2 October 2023

Cannot replace TLS/SSL Certificate on Microsoft Dynamics BC or NAV

If you get the following error when setting a new thumbprint on a BC/NAV instance:
SSL Certificate add failed, Error: 183 Cannot create a file when that file already exists
The answer is to note down the port number in the error then use it with this command to remove the existing certificate mapping. (replace 443 with the port from the error message.)
netsh http delete sslcert ipport=0.0.0.0:443
You can now set and save the new thumbprint in your instance configuration.

Friday 25 August 2023

List installed certificates and their thumbprints in PowerShell

Enter the following to list installed certificates and their thumbprints in PowerShell
Get-ChildItem -Path Cert:LocalMachine\MY

Wednesday 16 August 2023

Find install dates of apps in Windows from CMD

Simply run the following.
wmic product get Description,InstallDate

Wednesday 26 April 2023

Clearing a stuck RDS session, session stuck logging off etc

On the session host, first I run query session to get a list of session IDs.

Then run query process /ID:XX where XX is the session ID number to find processes running in the session.

Then go to task manager and click the details tab look up the PID (process ID) and 'end task' on each process in the stuck session until it logs off.


Monday 6 February 2023

Using PowerShell to find when domain users last set their password

 A simple one, enter the following into PowerShell running as a domain admin to export a list of domain users with the date they last set a password and if their password is set to expire.


Get-ADUser -filter * -properties passwordlastset, passwordneverexpires | sort-object name | select-object Name, passwordlastset, passwordneverexpires | Export-csv -path c:\PassLastSet.csv


You can of course also use CMD. Which is much simpler and easy to remember.

Net User Username