Lorky`s Blog - Techno ressources and general informations for everyone !

Important

To filter the blog, please use theses tag:
General news. Website related post website. parental-control about technology. technology post.

Note

All blog links are archived here.

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.

image-1.png?w=1022

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

Get-NetAdapter

Continue Reading...

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"
\$AdminGroup.Add(\$User.Path)
}

Thanks everyone :)

Continue Reading...

List Installed Update WMI

December 6, 2022, 3:58 pm technology

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;

image.png?w=438

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

Continue Reading...

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)

image-6.png?w=826

You can create the settings are in GPP;

image-7.png?w=681

As you can see it's a easy tip to do :) (more read on the settings here; https://learn.microsoft.com/en-us/microsoftteams/troubleshoot/authentication/teams-defaults-to-domain-joined-account)

Thanks everyone

Continue Reading...

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;

C:\windows\WID\Data\susdb.*

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, (https://www.heidisql.com/download.php)

Use named pipe and that to connect;

\.\pipe\MICROSOFT##WID\tsql\query

image-3.png?w=576

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

image-4.png?w=308

From there use that command to reset the database;

**ALTER DATABASE SUSDB** **SET OFFLINE WITH ROLLBACK IMMEDIATE;** **DROP DATABASE SUSDB;**

Click to Run

image-5.png?w=789

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.

image-2.png?w=946

After the command, the WSUS's console should open correctly, and it should ask you about what product and language you want :)

Continue Reading...