Monday, June 21, 2021

My Next Book is Announced!


I am pleased that my publisher, Packt, have announced my next book on PowerShell. The new book is entitled Windows Server Automation with PowerShell Cookbook and it should be released in July.

You can pre-order it from Amazon - in the UK, use the Smile.Amazon.Co.UK site. In the US, use the Smile.Amazon.Com site

I am looking for a few good books reviewers - you get a copy of the book in exchange for a review. If you are interested, send me some email at DoctorDNS@Gmail.Com.

Tuesday, June 01, 2021

Resolving Hyper-V issues with WIn10 Insiders builds

 I have been a member of the Windows Insiders group since 2014, and have enjoyed testing out the updates and looking at some of the new features coming to a new Win10 release in due course. A very few Insiders builds were bad - and just did not work. But that was rare and for the most part, the new builds work well.

I recently encountered an issue whereby after the upgrade, no Hyper-V VM would start. The error log shows an error message about MCompute faults - which looks like this in the event log.

Faulting application name: vmcompute.exe, version: 10.0.21354.1, time stamp: 0x1aa49b37

Faulting module name: vmcompute.exe, version: 10.0.21354.1, time stamp: 0x1aa49b37

Exception code: 0xc0000005

Fault offset: 0x00000000001c065a

Faulting process ID: 0x23a8

Faulting application start time: 0x01d72d3e4d15903d

Faulting application path: C:\WINDOWS\system32\vmcompute.exe

Faulting module path: C:\WINDOWS\system32\vmcompute.exe

Report ID: f8375064-c2fc-4a89-a8f1-af662c551008

Faulting package full name: 

Faulting package-relative application ID:

I reported this error multiple times, but to no avail. Every week, Windows Update would offer a new build that would fail to restart Hyper-V.. I'd revert to a working build, report the issue - then wait a week and repeat. Despite multiple reports, I never got any response from MSFT. 

I decided to take a near-nuclear option - which worked! In hopes that someone else who encounters this issue and, using their search engine, finds this post - here is my solution:

  1. Start, then shut down all VMs.
  2. Took an inventory of the VMs.
  3. Remove all the un-needed VM snapshots - there were too many and all are now gone! 
  4. Export all the VMs to a backup drive (removing the snapshots helped reduce the time).
  5. Remove the Windows 10 Hyper-V feature - all of it.
  6. Reboot.
  7. Accept the latest Insiders update and let it install.
  8. Once the upgrade is complete, add the Hyper-V feature back in.
  9. Reboot.
  10. Open up the Hyper-V console and install the necessary VM switches (two in my case).
  11. Import the VMs specifying the location on the VM location on the host's disk of the VM (and not the backup!).
  12. For some VMs< i need to specify where the virtual hard disks were stored (I use a non-standard location).
  13. Start the VMs and enjoy.
Here is what I see now!




Once you are up and running, make sure to remove the backups.

From start to finish, it took me a couple of days elapsed time (the backup to an external USB2 drive was slow!). 

In step 2, I took inventory (including identifying the snapshots and working out how much data had to be backed up. One useful step wasn running this query and saving the output. 
PS C:\Foo> Get-VM | Format-Table -Property Name, Path

Name           Path
----           ----
***Cookham1    D:\VMs\Cookham1
CH1            D:\V8\CH1
DC1            d:\v8\DC1
DC2            d:\v8\DC2
HV1            D:\V8\HV1
HV2            d:\v8\HV2
Hyper-V Server D:\V7\HyperVServer\Hyper-V Server
Old - Bridge   D:\V7\Bridge
PSRV           D:\V8\PSRV
SMTP-2019      D:\V8\SMTP-2019\SMTP-2019
SRV1           D:\V8\SRV1
SRV2           D:\V8\SRV2
SS1            D:\V8\SS1

After all the updating, in step 11, I pointed the MMC's import wizard at the path noted above and most of the VMs came in fine. For the "V8" VMs, I had to specify the same path to let the wizard know where each of the disks was stored. 

Hope you never encounter this issue but if you do the is a workaround. 








Monday, January 11, 2021

Packt Publishers Sale on Through Jan 13 2021

In my morning email was a message from the publishers of two (and soon three) books. My books are on PowerShell, but as many of you know, they publish books, ebooks, and videos across the IT Spectrum. In my experience, some of their books are better than others. I'd like to think that some books, including mine, are in the 'good' category - but as ever Caveat Emptor.

Their reason for writing to me is that they currently have a sale on at the moment. This sale, which is on through Jan 13th 2021 offers certain WIndows/Linux books and ebooks for sale. 

I apologise for the short notice, but I only heard about this from a mail I got this morning.

Mastering Windows Server 2019 - https://www.packtpub.com/product/mastering-windows-server-2019-second-edition/9781789804539?utm_source=4sysops&utm_medium=&utm_campaign=5dollar2020&utm_term=system-administrators

Mastering Windows Security and Hardening - https://www.packtpub.com/product/mastering-windows-security-and-hardening/9781839216411?utm_source=4sysops&utm_medium=&utm_campaign=5dollar2020&utm_term=system-administrators

Windows Server 2019 Administration fundamentals, Second Edition - https://www.packtpub.com/product/windows-server-2019-administration-fundamentals-second-edition/9781838550912?utm_source=4sysops&utm_medium=&utm_campaign=5dollar2020&utm_term=system-administrators

Mastering Linux Security and Hardening - https://www.packtpub.com/product/mastering-linux-security-and-hardening-second-edition/9781838981778?utm_source=4sysops&utm_medium=&utm_campaign=5dollar2020&utm_term=system-administrators

Windows Subsystem for Linux 2 (WSL 2) Tips, Tricks, and Techniques -https://www.packtpub.com/product/windows-subsystem-for-linux-2-wsl-2-tips-tricks-and-techniques/9781800562448?utm_source=4sysops&utm_medium=&utm_campaign=5dollar2020&utm_term=system-administrators

And what list of great books on offer would be incomplete without my latest book: 

Windows Server 2019 Automation with PowerShell Cookbook - Third Edition -https://www.packtpub.com/product/windows-server-2019-automation-with-powershell-cookbook-third-edition/9781789808537







Sunday, January 10, 2021

My Wiley PowerShell Book - Issues with the code samples

I recently posted (https://tfl09.blogspot.com/2020/12/my-latest-powershell-book-copies.html) about my latest PowerShell book, published by Wiley. I am proud of this book for many reasons. Most of the writing was done after the start of the Covid pandemic. Frankly, the writing helped keep me sane (well saner). 

Writing a book involves a lot of people. I write stuff  and then a good team of others help to turn this into a finished product. In particular, I was very happy with the excellent editing done by the Wiley team. The development process was laborious and my editors were a pedantic nightmare - but all in the Best Possible Way! I appreciated the almost anal nitpicking done and the total focus on quality. Everyone involved has my gratitude for their excellent work.

But...

Today I received a mail from a wonderful reader in Italy. He complained that cutting and pasting from the e-book failed. He provided me with some examples. Yes, he is right that what he showed me is NOT what I wrote and submitted.

My apologies for this to him, and everyone reading my book. I can assure you that I did everything I could to avoid this very issue. Jim, my TE, was totally focused on helping me to avoid issues like this - every missing capital letter, every missing parameter name, and every other minor error was flagged and resolved. I did what I could, and am sorry for the resulting issues.

With that said, one of the things I insisted on was that I could publish these scripts on GitHub. You do not have to buy my book (although I hope you will) to use the scripts. You canfindt the scripts at GitHub account - https://github.com/doctordns/Wiley20.

So if you want to try out the book and the scripts contained in it, please do NOT cut/paste from an electronic version - use the scripts on Github. If you find errors there, PLEASE file an issue at https://github.com/doctordns/Wiley20/issues. I will do my best to fix anything that might be broken and republish the updated script.  You are welcome to fork this repo and I'll accept PRs that fix errors in the scripts.

Thanks for everyone who either both my book or uses my scripts.