2021-11-21

PowerShell Class

With PowerShell 5 we were given the possibility to create more "real" custom classes.

I have some notes, trials and personal examples in SQLAdmin Github (link).

2021-11-20

Short name of file or directory

 Some situations still require a short name like a 8.3 name of a file. This will often be on not only the name of the object but on the entire path. Back in the days of the Windows Shell we would use the command dir /x.

I have looked into getting the short name in a PowerShell script to make it available in a more complex script. 

Unfortunately .NET does not have such a method to a FileInfo or DirectoryInfo object. So I have used the Win32 function GetShortPathName().

The script is in SQLAdmin Github (link) with some technical notes in the associated markdown file.

2021-05-13

Recovery Point Objective with a time perspective

 Usually the Recovery Point Objective (RPO) is only discussed as the data loss in the time between the last backup and the incident. But on most systems a point-in-time restore is not relevant after some time. After some time and backup generations most backups are becoming irrelevant, and can be deleted to save storage. A few backup are then kept for audit purpose and long term investigations.

A RPO plan could look lige this:

  1. 0 to 42 days: Point-in-time
  2. 42 days to 3 years: Week
  3. 3 years to 10 years: Month
  4. 10 years to 20 years: Quarter
Cleaning up backup data is also called remediation  of backup data.

Cleaning up data is not only the backup sets but also the metadata on the backups. But the metadata on the backup duration, size of backup set etc. could be useful with a high degree of detail for a longer time that the backup sets.

2021-03-10

Windows Server 2022 preview on VMware Workstation

 If you want to try Windows Server 2022 preview on VMware Workstation there are a few steps you have to go through.

  1. Sign up for Windows Insider (link).
  2. Download Windows Server Insider Preview (link). Do it as a ISO-file.
  3. Install a new VM on the ISO. I configured the VM for 8 GiB memory, 4 processors each with one core and a 64 GB NVMe disk. I have disabled USB and removed printer on the VM.
  4. Get the product key in the blog entry "Announcing Windows Server Preview Build 20308". This you will have to use to get updates, which are frequent on a preview.
Do the updates and select to not transfer settings until you are up-to-date. Then you can start installing VMware Tools and configure the Windows Server installation.

I have chosen to install the complete set of VMware Tools, but I am sure that is not a requirement to get a decent installation.

Now you can start working on the Windows Server 2022 with your favorite applications. My favorite is SQL Server ;-)

Some initial steps could be to install PowerShell 7, disable Print Spooler service and other trivials.

FYI - I am running VMware workstation 16 Pro on Windows 10 (Pro for Workstations) on a i7-6700 with 64 GiB memory  and 1 TB SATA for VMs.

2021-02-08

SQL Server troubleshooting

Microsoft has moved the SQL Server troubleshooting documentation to a new and dedicated location:

https://docs.microsoft.com/en-us/troubleshoot/sql/welcome-sql-server

The documentation is moved from Knowledge Base articles. These articles still exists but are now focused on release notes.

See more details on the new SQL Server trouble shooting dokumentation site:

https://techcommunity.microsoft.com/t5/sql-server-support/new-home-for-sql-server-troubleshooting-kb-articles-and-for/ba-p/2113331

2021-01-04

Top-ten posts 2020

 When I look back on the rather unusual year 2020 and my activities on this blog there are two opposite factors. One is the pandemic that send me to work from home (#WFH). The other is that just when the pandemic first hit I switched job. The result is that I have written far less on this blog than planned. The reduced productivity might also be a result of us buying another another home and moving during the pandemic.

But back to the statistics:

  1. SqlBulkCopy with PowerShell (2017-07-30)
  2. ISO 8601 date formatting using PowerShell (2008-08-14)
  3. DBCC CHECKDB with PowerShell (2014-10-9)
  4. xp_instance_regwrite syntax (2013-09-10)
  5. Installing Ola Hallengren Maintenance Solution (2019-02-03)
  6. VMware VIX API (2019-10-20)
  7. Audit Log for Analysis Services (2014-01-08)
  8. PowerShell MessageBox (2014-03-15)
  9. Windows Storage Spaces (2019-03-27)
  10. Could not load file or assembly Microsoft.AnalysisServices (2011-03-14)
The date on each post is the creation date. I might have updated the post since creation, and then it is described in the post itself.

I do not have many readers, but still the difference in the number of readers on each post is big. Number ten item on the list has 20 times less readers than number one on the list.

When I look at top-ten posts of 2019 (link) there are some new posts on the list. But most are on both top-ten lists. I will have to find new and more interesting subjects...