VMware: Install PowerCLI
KB ID 0001606 Problem There was a time you had to go to VMware and download PowerCLI then install it, that’s no longer the case, any machine with a, (reasonably new) version of PowerShell can simply pull the commandlets down from a repository and you are ready to go. Solution Firstly if you have the ‘old version’ of PowerCLI you can uninstall it from Add/Remove programs (appwiz.exe). Before installing, you need to be...
PowerCLI: Connect-VIServer Certificate Errors
KB ID 0001603 Problem When attempting to connect to a vCenter or ESXi host, you see the following error; Connect-VIServer : {Date} {Time} Connect-VIServer Error: Invalid server certificate. Use Set-PowerCLIConfiguration to set the value for the InvalidCertificateAction option to Prompt if you’d like to connect once or to add a permanent exception for this server. Additional Information: Could not establish trust relationship...
Forcing Azure AD Connect Sync
KB ID 0001590 Problem If you are using Azure AD Connect, (AAD Connect) to sync your on-premise Active Directory with Azure AD (i.e. for Office 365), then there may be times when you need to manually ‘force a replication’ because by default it’s going to take 30 minutes between each normal ‘delta replication’ Solution If you are directly on the server that’s running Azure AD connect, then use the...
PowerShell: Add All Members of an OU to a Security Group
KB ID 0001589 Problem I’ve written in the past about ‘Bulk Adding Users from CSV files, into Groups’. But what if you want to add ALL users in a particular OU into a security group? Solution The syntax is; Get-ADUser -SearchBase ‘OU=Source-OU,OU=PNL,DC=pnl,DC=com’ -Filter * | ForEach-Object {Add-ADGroupMember -Identity ‘SG-Test-Group’ -Members $_ } Here I’ve got 20 users that need adding to a group, in this...
PowerCLI: vMotion Multiple VMs
KB ID 0001585 Problem vMotioning one VM is pretty simple to do; Get-VM VM1 | Move-VM -Destination (Get-VMHost ESX-02.pnl.com) And moving ALL the VMs on one host, to another is pretty straight forward also; Get-VMHost ESX-01.pnl.com | Get-VM | Move-VM -Destination (Get-VMHost ESX-02.pnl.com) But what if you have a list of VMs you want to move, and you are too lazy, (sorry too skilled), do do them manually or one at a time? Solution...