Author: TheAdmin

  • Change password for Entra ID user account

    To change/reset password or a single Entra ID user account, open Powershell as admin and execute:

    Connect-MgGraph -Scopes “User.ReadWrite.All” -TenantId “yourtenantname.onmicrosoft.com”

    $UserId = “user01@yourtenantname.com”
    $NewPassword = “plaintextpassword”

    Update-MgUser -UserId $UserId -PasswordProfile @{
    ForceChangePasswordNextSignIn = $true
    Password = $NewPassword
    }

    Note:
    Script for native cloud user accounts or federated user accounts if Password writeback is enabled.

  • Certificate conversion from .CER to .PEM

    If you need to get PEM (Base64 text) format from DER (binary) format Certificate, then this might fix the situation:

    1. Open Powershell as admin and execute command:

    certutil -encode “C:\path\to\cert.cer” “C:\path\to\cert.pem”

    Note:
    “C:\path\to\cert.cer” – the location of .cer file you have
    “C:\path\to\cert.pem” – the output location for text based format

    1. Open converted .pem file with Notepad or Notepad++ and you will get ouput in text format

    example:
    —–BEGIN CERTIFICATE—–
    KLS1t…
    —–END CERTIFICATE—–

  • The trust relationship between this workstation and the primary domain failed.

    If you encounter an error on a domain joined Windows computer when trying to login with domain user account:

    The trust relationship between this workstation and the primary domain failed.

    This might fix the situation:

    1. Logon in Windows computer with local administrator account
    2. Open Powershell as admin and execute command:

    Reset-ComputerMachinePassword -Credential <sAMAccountName>

    examples:

    Reset-ComputerMachinePassword -Credential jsmith
    Reset-ComputerMachinePassword -Credential mydomain\jsmith
    Reset-ComputerMachinePassword -Credential jsmith@mydomain.com

    Note:
    jsmith account must have “Reset Computer Account” rights in Active Directory, typically this user must be a member of “Account Operators” or “Domain Admins” or “Enterprise Admins” group.

    1. Enter the credentials, restart the computer and you should be able to log back in with your regular user account
  • Screenshot of an active window

    If you need to take a screenshot of an active window, on your keyboard please press:

    alt + prt sc

    On a Apple mac computer, please press:

    Command + Shift + 4, Spacebar, and something else 🙂