Create Domain Admins group on ESXI5.1 Host

For all those wanting to access the local host of ESXI with Domain credentials rather than root account, have a look at this script.

I have written a script that creates a domain group on the root of ESXI 5.1 so that admins can access ESXI hosts locally with domain credentials. For this to work, the ESXI host will need to be domain joined before running the script.



# VMware ESXI Script to create Domain group on Root of ESXI Host
# Created by Ryan Mangan on the 16/04/2014

param (
[Parameter(Mandatory=$TRUE, HelpMessage=”Enter the name of the ESXI Host FQDN”)]

[Parameter(Mandatory=$TRUE, HelpMessage=”Host Root Password Dual control”)]

$DomainAdmin   = “Domain Account”
$DomainPW      = “Password”
$ADGroup       = “Domain\group”
$Domain        = “Domain FQDN”

Add-PSSnapin VMware.VimAutomation.Core
Connect-VIServer SVMHost -User root -Password $HostPW
Get-VMHostAuthentication -VMHost $VMHost | Set-VMHostAuthentication -Domain $Domain -Username $DomainAdmin -Password $DomainPW -JoinDomain -Confirm:$false
Get-VMHost $VMHost | New-VIPermission -Principal $ADGroup -Role “Admin”
Disconnect-VIServer $VMHost -Confirm:$false

(Download here)

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Create a website or blog at

Up ↑

%d bloggers like this: