wiki.getshifting.com

--- Sjoerd Hooft's InFormation Technology ---

User Tools

Site Tools


start

SHIFT-WIKI - Sjoerd Hooft's InFormation Technology

This WIKI is my personal documentation blog. Please enjoy it and feel free to reach out through blue sky if you have a question, remark, improvement or observation. See below for the latest additions, or use the search or tags to browse for content.


Change IP Address vCenter 5.1

Summary: How to change the IP address for your vCenter 5.1 and it's database.
Date: Around 2014
Refactor: 21 February 2025: Checked links and formatting.

With the introduction of vCenter 5.1 VMware introduced a scalable setup in which all components can be divided over different servers. This is a logical step considering the always growing infrastructure, and thus the always growing resource need of vCenter. However, this also means increased administration and in case of changes some more steps to be performed. Due to an oversight of one of my collegues I had to change the IP address of the vCenter server and the vCenter database server to a different address (as in, not being a DHCP address). After changing the IP address I also had to reregister several components of vCenter. This is the full report.

→ Read more...

2025/06/01 11:59

Scripts: PowerCLI: Detect and Change Guest Selected OS

Summary: How to bulk change the guest selected OS in your VMware VMs.
Date: Around 2017
Refactor: 21 February 2025: Checked links and formatting.

The Guest Selected OS is the VM value to determine how the VMware Tools should work. If this setting is not correct then weird issues may occur on your VMs from errors and BSOD to performance issues. These scripts will help you correct this issue:

Manually this can be done like this, but be aware that the VM needs to be turned off:

  1. In the vSphere Client inventory, right-click the virtual machine and select Edit Settings.
  2. Click the Options tab and select General Options.
  3. Select a guest operating system type and version.
  4. Click OK to save your changes and close the dialog box.

But scripted everything can be done automatically, which is useful when a lot of VMs are configured wrong.

→ Read more...

2025/06/01 11:59

Change Expired AD Password

Summary: How to change your own expired password when you can’t login to RDP.
Date: Around 2022
Refactor: 21 February 2025: Checked links and formatting.

I often have multiple accounts to keep track of, with various password policies. Sometimes a password just expires and I don't want to bother support staff to reset it to a temporary password which I have to reset then again. It's a lot of hassle. To prevent that, I became a big fan of the PowerShell function below. All credits go to Evotec, but I've used it a lot. If you're on a personal system, you could just simply do:

Install-Module PSSharedGoods -Force
Set-PasswordRemotely

But if you're on a server system without internet access or do not want to install form unknown sources you could simply paste the function into your powershell session and then run the function:

function Set-PasswordRemotely {
    [CmdletBinding(DefaultParameterSetName = 'Secure')]
    param(
        [Parameter(ParameterSetName = 'Secure', Mandatory)][string] $UserName,
        [Parameter(ParameterSetName = 'Secure', Mandatory)][securestring] $OldPassword,
        [Parameter(ParameterSetName = 'Secure', Mandatory)][securestring] $NewPassword,
        [Parameter(ParameterSetName = 'Secure')][alias('DC', 'Server', 'ComputerName')][string] $DomainController
    )
    Begin {
        $DllImport = @'
[DllImport("netapi32.dll", CharSet = CharSet.Unicode)]
public static extern bool NetUserChangePassword(string domain, string username, string oldpassword, string newpassword);
'@
        $NetApi32 = Add-Type -MemberDefinition $DllImport -Name 'NetApi32' -Namespace 'Win32' -PassThru
 
        if (-not $DomainController) {
            if ($env:computername -eq $env:userdomain) {
                # not joined to domain, lets prompt for DC
                $DomainController = Read-Host -Prompt 'Domain Controller DNS name or IP Address'
            } else {
                $Domain = $Env:USERDNSDOMAIN
                $Context = [System.DirectoryServices.ActiveDirectory.DirectoryContext]::new([System.DirectoryServices.ActiveDirectory.DirectoryContextType]::Domain, $Domain)
                $DomainController = ([System.DirectoryServices.ActiveDirectory.DomainController]::FindOne($Context)).Name
            }
        }
    }
    Process {
        if ($DomainController -and $OldPassword -and $NewPassword -and $UserName) {
            $OldPasswordPlain = [System.Net.NetworkCredential]::new([string]::Empty, $OldPassword).Password
            $NewPasswordPlain = [System.Net.NetworkCredential]::new([string]::Empty, $NewPassword).Password
 
            $result = $NetApi32::NetUserChangePassword($DomainController, $UserName, $OldPasswordPlain, $NewPasswordPlain)
            if ($result) {
                Write-Host -Object "Set-PasswordRemotely - Password change for account $UserName failed on $DomainController. Please try again." -ForegroundColor Red
            } else {
                Write-Host -Object "Set-PasswordRemotely - Password change for account $UserName succeeded on $DomainController." -ForegroundColor Cyan
            }
        } else {
            Write-Warning "Set-PasswordRemotely - Password change for account failed. All parameters are required. "
        }
    }
}
Set-PasswordRemotely

This wiki has been made possible by:

2025/06/01 11:59

Install and Configure Dokuwiki

Summary: This wiki page shows how I installed and configured this site using dokuwiki.
Date: 2 December 2024
Refactor: 10 July 2025: Updates after dokuwiki move and installation on AWS lightsail.

→ Read more...

2025/06/01 11:59

<< Newer entries | Older entries >>

This wiki has been made possible by:

start.txt · Last modified: by sjoerd