Hyper-v AVMA Key and related stuff

Just sharing some notes.
What is Microsoft AVMA? “AVMA lets you install virtual machines on a properly activated Windows server without having to manage product keys for each individual virtual machine, even in disconnected environments. AVMA binds the virtual machine activation to the licensed virtualization server and activates the virtual machine when it starts up. AVMA also provides real-time reporting on usage and historical data on the license state of the virtual machine. Reporting and tracking data is available on the virtualization server.”

When the AVMA key is not installed, your virtual systems will not activate.

Import Windows license key:

slmgr /IPK DBGBW-NPF86-BJVTX-K3WKJ-MTB6V

In our situation we need to report to our KMS server:
slmgr /SKMS tst.hosting.com

Activate Windows:

slmgr /ATO

Check the licensed status of your Windows Host.

slmgr /DLV or DLI

Or with PowerShell for checking your full scvmm managed environment:

The following AVMA keys can be used for Windows Server 2019.
Datacenter H3RNG-8C32Q-Q8FRX-6TDXV-WMBMW
Standard TNK62-RXVTB-4P47B-2D623-4GF74
Essentials 2CTP7-NHT64-BP62M-FV6GG-HFV28

The following AVMA keys can be used for Windows Server, version 1809.
Datacenter H3RNG-8C32Q-Q8FRX-6TDXV-WMBMW
Standard TNK62-RXVTB-4P47B-2D623-4GF74

The following AVMA keys can be used for Windows Server 2012 R2.
Datacenter Y4TGP-NPTV9-HTC2H-7MGQ3-DV4TW
Standard DBGBW-NPF86-BJVTX-K3WKJ-MTB6V
Essentials K2XGM-NMBT3-2R6Q8-WF2FK-P36R2

The following AVMA keys can be used for Windows Server 2016.
Datacenter TMJ3Y-NTRTM-FJYXT-T22BY-CWG3J
Standard C3RCX-M6NRP-6CXC9-TW2F2-4RHYD
Essentials B4YNW-62DX9-W8V6M-82649-MHBKQ

Generate CPU Load with PowerShell

In some situations you need to stress your system a little (for example: to check if your monitoring is functioning properly.)

Installing some random .exe files from some anonymous websites is not always a good idea. So hereby a little script for blowing your CPU to 100%.

The script creates a nice calculation for all of your “Windows Logical Processors”

WARNING: The names of some imported commands from the module “” include unapproved verbs that might make them less discoverable.

When you use one of the VERB types in your brand new function names, you get the following very annoying message:

WARNING: The names of some imported commands from the module ‘Set-ROBVIT-Function’ include unapproved verbs that might make them less discoverable. To find the commands with unapproved verbs, run the Import-Module command again with the Verbose parameter. For a list of approved verbs, type Get-Verb.

In this case “set” is our problem.
Tried to do with the -WarningAction:SilentlyContinue, -ErrorAction:SilentlyContinue, out-null parameters with no succes.
It costs me 5 Google’s to find the solution, thats why i created this little reminder to myself :).

How to solve the issue?

Fist option:
You can make some PowerShell module / function config files, with export functions etc.
To much work for my little function.

Second option (the easy one):
Just import the module with the -DisableNameChecking parameter.

If you have a better solution, dont hesitate to comment below.

Check DNS Entries with PowerShell

In a dynamic environment it’s hard to keep your DNS up-to-date. Updating the DNS server is a task which is mostly forgotten during server maintenance.
Created just a simple one-liner for checking the registered suffix and do a ping test.

Yeah I know this one is not dummy proof, but hey! t helped me checking 10.000 records in 2 minutes, so maybe i can help someone with sharing this. 🙂

 

Veeam backup copy to multiple offline external disks

Wondering how to create an offline disk back-up copy with more than one USB Disk? And not want to spend your IT budget on “Veeam cloud connect” This is originally not possible with the Veeam GUI because you can’t map 1 backup copy job against 2 USB disks. The job will fail because Veeam cant find one incremental which one is copied on the second USB disk which is on a safe place @home. I made a script for enabling and disabling the right copy job for each mapped USB disk.

 

Add new email alias Office365

One of our customers changed the company name. So the alias of all there SharedMailboxes on office365 needed to be changed. This script below contains 2 functions, the fist one is for adding an extra alias to the mailbox and the second one is for activating the new alias. This is the first time i scripted against office365, so it could be that the script is not faultyproof. But hey, its a beginning. Saved about 10 hours of manual clicking during the critical company name change.

 

Unattended SCOM Agent installation Windows

Command line is your friend when the SCOM Agent auto deploy functionality does not work for some reason. Because some firewall rules are disabled or something like that.
Or if you need to create a SCCM Package.

Unattended installation with system account:

Unattended installation with SCOM Action account:

 

Dynamic Group population and Role based Access PowerShell

For a customer i created a script which create new groups for all kind of unique jobtitles available in Active Directory. After the creation of all groups it loops through all users and add these to the created groups in the function above. This scripts help you to maintain for example role base access.

This scripts contains 3 functions:
1. Creating groups for all the unique jobtitle’s available.
2. Adding users with the same Jobtitle
3. Remove users after jobtitle change

 

 

ID: 2912 | Details: Service unavailable (503) (0x801901F7) | NO_PARAM NO_PARAM

During the deployment of a new resource or adding a new resource  there is a possibility that you can face the following error:

An internal error has occurred trying to contact the ” server: NO_PARAM: NO_PARAM.
WinRM: URL: [http://:5985], Verb: [INVOKE], Method: [GetError], Resource: [http://schemas.microsoft.com/wbem/wsman/1/wmi/root/microsoft/bits/BitsClientJob?JobId={1FAA84D0-C551-4410-AB54-0DE094840D37}]

Service unavailable (503) (0x801901F7)

Recommended Action

Check that WS-Management service is installed and running on server ”. For more information use the command “winrm helpmsg hresult”. If ” is a host/library/update server or a PXE server role then ensure that VMM agent is installed and running. Refer to http://support.microsoft.com/kb/2742275 for more details.

After some investigation this can happen due two circumstances:

1.The VMM Certificate has expired. Check this one in your certificate store.

If the certificate is expired, create a new one:

Then, refresh all VMM Infrastructure servers (including VMHosts) so they get the new certificate.

2.The port is used by another program.

After installing the newest product from Microsoft “Admin Center” on our Library server we faced the same issue.

To solve this: Go to the library server -> Open regedit -> Search for “BITSTcpPort” -> Change the value to an unused Port like (8500).
Restart the SCVMM Agent and refresh your Library share in SCVMM.

No mapping between account names and security IDs was done.

Last day’s very busy with a small DevOps project in our company. Automating “bare metal deployment” of new Hyper-V Servers. We deploy the software with a combination of MDT and the brand new HP (finally) PowerShell commands.

During the step of renaming and joining the new server we faced the following error:
Computer failed to join domain ” from its current workgroup ‘WORKGROUP’ with following error message: No mapping between account names and security IDs was done.

After some troubleshooting we found a solution, by adding the two options: JoinWithNewName and AccountCreate
Renaming computer PowerShell and Joining a domain with PowerShell