Home
Microsoft 365
Linux
Windows
Powershell
Cloud Computing
    Citrix Xendesktop
    Citrix XenApp
Useful links
About
  • Home
  • Microsoft 365
  • Linux
  • Windows
  • Powershell
  • Cloud Computing
    • Citrix Xendesktop
    • Citrix XenApp
  • Useful links
  • About
ajni.IT -
Windows Server

Reset Computer Secure Channel of a Domain Computer with one PowerShell command

November 14, 2020 by AJNI No Comments

You probably have stumbled upon this common problem: When logging into a Domain Computer with a Domain user, this error appears: The trust relationship between this workstation and the primary domain failed.

What does it mean? Well, it basically means that the Domain Computer cannot authenticate against Active Directory, because the Computer Account password on the workstation is not valid anymore (this can occur when using Sytem Restore or when restoring from a backup).

How do you solve this issue? Pretty easy. Just remove the computer from the Domain and re-join. That works, but there is a cleaner and faster solution with one line of PowerShell code:

Test-ComputerSecureChannel -Repair -Credential (Get-Credential)

You will need to enter domain user credentials that can create or modify computer accounts in the Active Directory Domain.

You can check if the password of the Domain computer changed by viewing the attribute pwLastSet in the Attribute Editor.

Reading time: 1 min
Windows Client OS•Windows Server

Perform a Domain Join with Powershell Remoting

June 11, 2020 by AJNI No Comments

So here is a challenge I had to face today: I created a virtual machine (VM) in Azure from a custom image that was previously Sysprep’d by me. The image contained several applications intended to run on a RDSH (Remote Desktop Session Host) for Citrix Virtual Apps and Desktops (former XenApp), so the RDS role was also installed. The VM was not part of the domain, it was in a Workgroup and it could not reach the RDS license server. Which meant: I could not RDP into the machine to perform Domain Join. And if you already have some experience with Microsoft Azure, you will know that there is no Remote Console like in VMware or Hyper-V.

The VM was still reachable over the network. So here are four PowerShell commands that allowed me to remotely perform a Domain Join on that particular machine. Nothing fancy, but it might come in handy.

$Server=”10.10.10.10″

Set-Item -Path WSMan:\localhost\Client\TrustedHosts -Value $Server -Confirm:$false -Force

This credential variable stores the local username and password of the computer. Something like computername\admin along with the password.

$Cred = Get-Credential

Add-Computer -DomainName “ajni.lab” -Restart

After executing the last command you will be prompted to insert domain credentials. The user obviously must have the right to create computers in the domain.

Reading time: 1 min
Cloud Computing•Hyper-V•VDI•Virtualization•VMware•Windows•Windows Server

Quick Tip: Task Manager in RDP Session

June 8, 2020 by AJNI No Comments

Here is a cool trick that not everyone might know (I didn’t).

If you want to open Task Manager inside an RDP session, CTRL+ALT+DEL won’t work, right? That key combination would trigger on your local computer.

For remote sessions, there is CTRL+SHIFT+ESC.

This shortcut directly opens Task Manager, no additional steps required!

Reading time: 1 min
Windows•Windows Client OS

Enabling Bitlocker Drive Encryption without a TPM chip

March 7, 2020 by AJNI No Comments

I was trying to enable Bitlocker on my C: drive, but unfortunately my PC does not have a physical TPM chip built-in. Turns out there is a way to enable Bitlocker Drive Encryption without the TPM chip with help of Group Policies.

Open Local Group Policies (gpedit.msc) > Administrative Templates > Windows Components > Bitlocker Drive Encryption > Operating System Drives > Require additional authentication at starutp

Enable this Policy and leave the default settings.

Now in Windows Explorer, Bitlocker can be turned on:

Because there is no TPM chip available, we either have the option to enter a password every time the OS boots or unlock the drive with a USB flash drive.

There are a few options for saving the recovery key. If you save it to your Microsoft Account, it can be accessed on this Microsoft site: https://account.microsoft.com/devices/recoverykey

Select the first option if you just re-installed Windows.

New should be better right?

Your PC will be restarted.

At boot, this is the prompt you’ll get:

Don’t forget to secure your Bitlocker Recovery Key just in case something breaks. You’ll need that long string.

Links:

https://support.microsoft.com/en-us/help/4530477/windows-10-finding-your-bitlocker-recovery-key

https://www.howtogeek.com/192894/how-to-set-up-bitlocker-encryption-on-windows/

Reading time: 1 min
Citrix XenApp•Citrix Xendesktop•Cloud Computing•Powershell•VDI•Windows Client OS•Windows Server

Quick tip: Set Windows language with five Powershell commands

February 17, 2020 by AJNI No Comments

A quick post on how to change the Windows display language with Powershell. You might use these commands based on any logic that determines the user’s location/language. For instance, I created a script that gets executed on logon and sets the language based on some criteria (maybe an Active-Directory group or attribute).

Set-Culture en-US
Set-WinSystemLocale -SystemLocale en-US
Set-WinUILanguageOverride -Language en-US
Set-WinUserLanguageList en-US -Force
Set-WinHomeLocation -GeoId 244

You can find the right GeoID on Microsoft’s website

Reading time: 1 min
Page 3 of 5« First...«2345»

Like what you are reading? Buy me a coffee.

Tip Of the Day

  • Add Alias to Windows Fileserver (Server 2019, 2022, 2025)

    1 month ago

Keep in touch

Oh hi there!
It’s nice to meet you.

Sign up to receive awesome content in your inbox, every month.

Check your inbox or spam folder to confirm your subscription.

Categories

  • AI & Deep Learning (1)
  • Azure (20)
  • Citrix XenApp (21)
  • Citrix Xendesktop (13)
  • Cloud Computing (40)
  • Coding (1)
  • Hyper-V (10)
  • Linux (8)
  • Microsoft 365 (26)
  • Powershell (21)
  • Security (7)
  • VDI (16)
  • Virtualization (21)
  • VMware (12)
  • Windows (21)
  • Windows Client OS (39)
  • Windows Server (92)

Archives

  • May 2025
  • April 2025
  • February 2025
  • January 2025
  • December 2024
  • November 2024
  • October 2024
  • September 2024
  • July 2024
  • June 2024
  • May 2024
  • April 2024
  • March 2024
  • February 2024
  • January 2024
  • December 2023
  • September 2023
  • August 2023
  • July 2023
  • June 2023
  • April 2023
  • March 2023
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • December 2020
  • November 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • November 2019
  • October 2019
  • September 2019
  • August 2019
  • July 2019
  • June 2019
  • May 2019
  • April 2019
  • March 2019

ajni IT © 2019