Windows Dc Renaming Error

Hi everyone

Today I wanted to talk an issue I seen, it’s not common, but it’s an error that can happen. It’s if you rename a DC like if it’s a normal computer, not the correct way. The problem after is it break your Active Directory Database.

After the reboot you will see that error on the login screen of the DC;

Security database on the server does not have a computer account for this workstation trust relation on domain controller.

To recover you need to use netdom the old way.

Please know it’s an issue with only one DC in a single forest. Don’t do those step if you have other working DC or a bigger forest.

  1. First we do a backup in case something bad happen.
  2. netdom computername <CurrentName> /enumerate
  3. netdom computername <CurrentName> /add:<NewGoodName>
  4. netdom computername <CurrentName> /makeprimary:<NewGoodName>
  5. Restart
  6. Check all service if OK, after we remove the old name
  7. netdom computername <NewGoodName> /Remove<CurrentName>
  8. Restart again.

That should do the trick to revert back to the good name, after that if you want to rename a DC, remember it’s not a good idea, but at that point it’s easier to promote another’s one to do the trick. If you need to keep the old server up, you can make sure you have another DC, and after you demote and re-promote with the good name the DC you wanted to change the name.

Reference for the post


Windows AutoPilot and QEMI / kvm-virtualization UUID issue

Hi everyone

Today I wanted to share a small bug you can encounter on QEMU / KVM if you are testing Windows 10’s machines. It’s something new I seen, so I wanted to discuss it.

The bug is simple to see, it’s in the Windows 10 setup at the start if you see a business login / portal that is not for your business then you must think the system UUID is probably taking one already registered online.

It’s something I never seen before, but it was reported there (or there), so it’s why I talk it.

In that case the user was seeing a login page from another business, as seen here when he used a normal ISO.

The QEMU command used to deploy the machine;

qemu-system-x86_64 -drive file=Windows.img,format=qcow2,if=virtio \
 -drive file="en-us_windows_10_enterprise_ltsc_2021_x64_dvd_d289cf96.iso",media=cdrom -drive file=virtio-win.iso,media=cdrom \
 -boot order=d -enable-kvm -machine type=q35 -cpu host,hv_vpindex,hv_runtime,hv_synic,hv_stimer,hv_reset,hv-relaxed,hv-vapic,hv-spinlocks=0x1fff,hv-time \
 -m 32G -smp sockets=1,cores=6,threads=1 \
 -device virtio-vga-gl -display sdl,gl=on \
 -netdev user,id=network0 -device e1000,netdev=network0,mac=52:54:00:12:34:56

In such case to bypass that problem make sure to change the UUID, that way to make QEMU use the system UUID;

 -enable-kvm -uuid $(dmidecode -s system-uuid)

In the OOBE make sure it’s offline too.

I will quote the answer from Aarad Prasad for that part;

Make sure the process is offline, by disabling your network adapter while in the OOBE process. Get an elevated prompt by pressing Shift+F10 and executing the following in powershell:

Disable-NetAdapter -Name "Adapter Name" -Confirm:$false

You may get the adapter name by


Add Domain Group to Local Admin Group – PowerShell

Hi everyone !

Today I will share a quick tip if you want to add a group to the locla admin group easily.

Sometime you need to use restricted group’s policy, but when the environement is already setup some time it’s easier to just do a batch.

The batch is nice as it target the OU you want, and it add the Domain Group you want to the local admin group. Please adjust the script for the Administrators groups name depending on the Windows language.

$DomainName = “CONTOSO”
$UserName = “Gestionnaire”
$User = [ADSI]”WinNT://$DomainName/$UserName,group”

$OUpath = ‘OU=Ordinateurs,DC=CONTOSO,DC=HQ,DC=qc,DC=ca’
$Computers = Get-ADComputer -Filter * -SearchBase $OUpath | Select-object

$Computers | ForEach {
$computerName = $_.Name
Write-Host $computerName
$AdminGroup = [ADSI]”WinNT://$computerName/Administrateurs,group”

Thanks everyone 🙂

List Installed Update WMI

Hi everyone

Today I wanted to share a small but handy tip to list all updates.

It come handy when you want to compare all updates on some machines for problems.

wmic qfe get hotfixid,installedon

The output look like that;

As you can see it’s easy after to compare server, or to know which update got installed when.

Remove Teams Auto Signin with Domain Account

Hi everyone !

Today I wanted to share a small tip if you want to disable team from using the domain upn when the session open for the first time.

The tip is nice as when the user open Team for the first time if you are hybrid / on-prem the users can have difficulty to open team as they need to select “use another email” in the windows footer. If the user don’t use the correct login then a loop happen, the sign-off seem impossible from Teams when it try to load an unexisting account. (Removing team and reisntalling it is the easiest workaround if it happen)

The tip can be easilly done by Group Policy.

The magic registry key to use in our case is SkipUpnPrefill (HCU\Software\Microsoft\Office\Teams)

You can create the settings are in GPP;

As you can see it’s a easy tip to do 🙂 (more read on the settings here;

Thanks everyone

Windows Server 2019 – Clean WSUS WID Database

Hi everyone

Today I wanted to share a tip to clean up your WSUS WID database.

The tip allow you to not remove and reinstall to achieve the same goal. You save 2 reboot in the least.

The first step is to close the services;

Stop-Service WSUSService, W3SVC

Make sure the service is stopped;

Get-Service WSUSService, W3SVC

Erase the database file;


After that we need to connect to the database service, as for it the data is still there yet;

We need to restart the service;

Start-Service WSUSService, W3SVC

Use HeidiSQL portable edition, (

Use named pipe and that to connect;


The connection might give you such error; just click OK and ignore it

From there use that command to reset the database;




Click to Run

Now technically speaking the WSUS is empty, but the console will fail to open at that point. We need to redo the WSUS wizard, which can be run that way;

Program Files\Update Services\Tools\Wsusutil.exe postinstall CONTENT_DIR=”e:\WSUS”

Make sure the folder you write in CONTENT_DIR is empty.

After the command, the WSUS’s console should open correctly, and it should ask you about what product and language you want 🙂

Force GPUpdate for all computers

Hi everyone !

Today I wanted to talk about a small tip if you need to refresh a computer gpo for some computer OU.

I will talk the powershell command let; Invoke-GPUpdate

The commad let is powerfull, as you can target a computer, and to update only user settings; that way;

Invoke-GPUpdate -Computer “DOMAIN\WORKSTATION-001” -Target “User”

The last command let I wanted to talk is a more complex’s one, like this one;

Get-ADComputer –filter * -Searchbase “ou=Site-A, dc=Domain,dc=com” | foreach{ Invoke-GPUpdate –computer $ -force}

That one will search a complete OU for all computer account, and invoke a gpupdate /force on them.

Before running it I suggest to try the Get-ADComputer command let to be sure it target computer you want;

Get-ADComputer –filter * -Searchbase “ou=Site-A, dc=Domain,dc=com” | fl

Make sure you know that the remote user will see a gpupdate’s windows, to have it hidden make sure you use -AsJob in your command let.

Thansk everyone for listening

Domain join hardening changes

Hi everyone

Today I wanted to talk a change that Microsoft did for domain join.

After the 11 October 2022 the KB5020276 introduce some concept change that will help a lot to make domain join error free.

I will quote the legacy behavior;

Before you install the October 11, 2022, or later cumulative updates, the client computer queries Active Directory for an existing account with the same name. This query occurs during domain join and computer account provisioning. If such an account exists, the client will automatically attempt to reuse it.

Note The reuse attempt will fail if the user who attempts the domain join operation does not have the appropriate write permissions. However, if the user has enough permissions the domain join will succeed.

There are two scenarios for domain join with respective default behaviors and flags as follows:

Domain Join (NetJoinDomain)

Defaults to account reuse (unless NETSETUP_NO_ACCT_REUSE flag is specified)

Account provisioning (NetProvisionComputerAccountNetCreateProvisioningPackage).

Defaults to NO reuse (unless NETSETUP_PROVISION_REUSE_ACCOUNT is specified.)

After the change there is an addional security check that is done.

  • Account reuse will be permitted if done by the account creator.
  • Account reuse will be permitted if done by a member of the domain admin’s group.

That way if you have delegated the domain join task it enforce more security for account name.

Following that change you can see that error message; which would be normal if the two conditions are not met.

Error 0xaac (2732): NERR_AccountReuseBlockedByPolicy: “An account with the same name exists in Active Directory. Re-using the account was blocked by security policy.”

Some more information on additional’s step that can be done;

Take Action
Review computer account provisioning workflows and understand if changes are required.

Perform the join operation using the same account that created the computer account in the target domain.

If the existing account is stale (unused), delete it before attempting to join the domain again.

Rename the computer and join using a different account that doesn’t already exist.

If the existing account is owned by a trusted security principal and an administrator wants to reuse the account, they might do so by temporarily setting the following registry key at the individual client computer level. Then immediately remove the registry setting after the join operation is complete. No restart is necessary for changes to the registry key to take effect.









Other values are ignored.

Important guidance for using option 4
Caution: If you choose to set this key to work around these protections, you will leave your environment vulnerable to CVE-2022-38042 unless your scenario is referenced below as appropriate. Do not use this method without confirmation that the Creator/Owner of the existing computer object is a secure and trusted security principal.

It is appropriate to use solution 4 in the following scenarios:

An IT admin with delegated permissions needs to rejoin a computer to the target domain for troubleshooting purposes and the original account creator is a trusted account.


A deployment scenario in which computer accounts are created before using a dedicated service account (such as SCCM or other software) and the domain join is performed by a second dedicated account with delegated domain-join permissions (for example, “This account is allowed to join this computer to the domain”).

Microsoft might remove support for the NetJoinLegacyAccountReuse registry setting in a future update and replace it with an alternative method. This article will be updated if and when such changes take place.

Do not add service accounts or provisioning accounts to the Domain Admins security group.

Do not manually edit the security descriptor on computer accounts in an attempt to redefine the ownership of such accounts. While editing the owner will enable the new checks to succeed, the computer account might retain the same potentially risky, unwanted permissions for the original owner unless explicitly reviewed and removed.

Do not add the NetJoinLegacyAccountReuse registry key to base OS images because the key should only be temporarily added and then removed directly after the domain join completes.

The article in reference is; KB5020276—Netjoin: Domain join hardening changes

Windows Update Error 80072F8F

Hi everyone

Today I wanted to talk about a error that can happen in Windows Update.

It’s the error 0x80072F8F.

That error is pointing to an error of the update client. There is two possible causes;

First: The update client is outdated, due possibly to a lack of update done over time. This tend to happen more on older OS like in Windows Server 2012 in example.

To resolve such case you can download a updated client from Microsoft;

Update to Microsoft Update client (

After the update just re-run Windows Update to have it work.

Second: An error in the time set inside the computer with a huge offset will cause the update client to fail to get any information. Make sure the computer time is correct.