Get monitor make and serial number command line

The following powershell command will return make and serial number of a monitor connected to the computer.

gwmi WmiMonitorID -Namespace root\wmi | ForEach-Object {($_.UserFriendlyName -ne 0 | foreach {[char]$_}) -join ""; ($_.SerialNumberID -ne 0 | foreach {[char]$_}) -join ""}

Reference: WmiMonitorID class – Win32 apps | Microsoft Docs

Get and Install Windows Updates via PowerShell

Using the following package PSWindowsUpdate you can Get-WindowsUpdate and Install-WindowsUpdate.

install-module pswindowsupdate
DESCRIPTION
Use Get-WindowsUpdate (aka Get-WUList) cmdlet to get list of available or installed updates meeting specific
criteria.

Use Download-WindowsUpdate alias to get list of updates and download it. Equivalent Get-WindowsUpdate -Download.

Use Install-WindowsUpdate (aka Get-WUInstall) alias to get list of updates and install it. Equivalent
Get-WindowsUpdate -Install.

Use Hide-WindowsUpdate alias to get list of updates and hide it. Equivalent Get-WindowsUpdate -Hide.

Use Show-WindowsUpdate (aka UnHide-WindowsUpdate) alias to get list of updates and unhide it. Equivalent
Get-WindowsUpdate -Hide:$false.

There are two types of filtering update: Pre search criteria, Post search criteria.

- Pre search works on server side, like example: (IsInstalled = 0 and IsHidden = 0 and CategoryIds contains
'0fa1201d-4330-4fa8-8ae9-b877473b6441' )

- Post search work on client side after get the pre-filtered list of updates, like example $KBArticleID -match
$Update.KBArticleIDs

Status info list:\r\n[A|R]DIMHUB\r\nA-IsAccetped\r\nR-IsRejected\r\n D-IsDownloaded\r\n F-DownloadFailed\r\n
?-IsInvoked\r\n I-IsInstalled\r\n F-InstallFailed\r\n ?-IsInvoked\r\n R-RebootRequired\r\n M-IsMandatory\r\n
H-IsHidden\r\n U-IsUninstallable\r\n B-IsBeta

Install Windows Admin Console on a Domain Controller

WARNING:
Doing this may damage your system. Microsoft has no documentation as to why WAC is not supported on a domain controller. Please only use this for educational/lab purposes. You’ve been warned!

The installer sets the MsiNTProductType property for Windows NT, Windows 2000, and later operating systems. This property indicates the Windows product type.

For Windows 2000 and later operating systems, the installer sets the following values. Note that values are the same as of the wProductType field of the OSVERSIONINFOEX structure.

Value Meaning
1 Windows 2000 Professional and later
2 Windows 2000 domain controller and later
3 Windows 2000 Server and later

For operating systems earlier than Windows 2000, the installer sets the following values.

Value Meaning
1 Windows NT Workstation
2 Windows NT domain controller
3 Windows NT Server

With that being said, I started up Orca MSI Editor. I found the MsiNTProductType by doing a search and changed the condition of the Action SetSUPPORTED_SERVER_SKU to the following.

WIN_10 AND (MsiNTProductType = 3 OR MsiNTProductType = 2)

I also came across LaunchCondition task and in this there is a check that I removed:

Installed OR (MsiNTProductType <> 2)

Another Sage 50 user or Workstation is Accessing this Company…

Another Sage 50 user or workstation is accessing this company area or performing a similar company process. Please wait a moment and try again. If you believe you received this message in error, have all users exit Sage 50 and try again.

We are experiencing this exact issue.  I’ll be looking more in-depth to see if I can narrow it down.  A cursory Google search for:  sage “pt.lck” brought me to this forum post and the post you replied to about a month ago.  These problems began after the upgrade to 2020 for all15 users here.  Sporadic.  Sometimes the backups fail as well.  The backups are supposed to get everyone out, from my understanding, but it doesn’t seem to work properly.  I have gone as far as total (complete) reinstall on the server, and workstations, with no luck.  So there’s something else going on.  Maybe it’s a simple problem, and I’m overcomplicating it but I am going to start looking into why Sage just disappears.  The hint is probably in that.

I have a PT.LCK that is owned by a different user than the user that created the SUA00021.LCK file.  I checked the user that created the SUA00021.LCK file to see if Sage was running and it was not “visible” on the desktop.  I terminated (taskkill /f /im peachw.exe) on the workstation.  Did not let go of the SUA00021.LCK so I then had to terminate forcefully Actian (taskkill /f /im w3dbsmgr.exe) and restart it (net start psqlwge).  Once Actian/Pervasive was restarted, the lock on the SUA00021.LCK file was let go and as soon as I renamed it, users were able to launch Sage again.

Another Sage 50 user or workstation is accessing this company area or performing a similar company process. Please wait a moment and try again. If you believe you received this message in error, have all users exit Sage 50 and try again.

— Sage 50 Accounting

'wc -l' equivelant for Windows… kinda

Came across a cool find today that I can implement in Windows to replicate wc -l. When wanting to count how many lines in a file on Windows, I can use the following.

type test.txt | find /v /c ""

This is saying to count /c all the lines not containing /v nothing "".

test.txt

a
b
c
d
e
g
type test.txt | find /v /c ""
8

Note that it counts the empty line between e and g in test.txt. It would also count any extra lines that do not contain data (carriage returns).