- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi LucD,
We have a few clusters where the hosts don't seem to have joined to a domain under authentication services.
Is there a script available where a it will join the domain by providing the domain, username and password.
At the moment we have over 100 hosts with this issue.
See attached picture of the settings.
Thanks in advance.
Mo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have found the following from a search:
Get-VMHost | Get-VMHostAuthentication | Set-VMHostAuthentication -JoinDomain "prod.cyberintegration.net/cis/computers/esxi" -Username myusername -Password "mypassword"
How can I edit the script to run against a host.csv file which has a list of all the hosts...?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In a loop, something like this
# Assume the CSV has a column with the name HostName
Import-Csv -Path host.csv -PipelineVariable row |
Foreach-Object -Process {
Get-VMHost -Name $row.HostName| Get-VMHostAuthentication |
Set-VMHostAuthentication -JoinDomain "prod.cyberintegration.net/cis/computers/esxi" -Username myusername -Password "mypassword"
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks LucD,
I will give the script a try and report back with feedback.
Another question, is there a script I can run against a vCenter to check all esxi authentication services settings and see what hosts are missing the domains.
Thanks
Mo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can refer to this posted by Luc D
$report = foreach($vc in $global:DefaultVIServers){
Get-VMHost -Server $vc | Get-VMHostAuthentication |
Select @{N='vCenter';E={$vc.Name}},
@{N='VMHost';E={$_.VMHost.Name}},
@{N='AD Domain';E={$_.DOmain}}
}
$report | Export-Csv VC-ESXi-AD.csv -NoTypeInformation -UseCulture
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, that's worked perfectly.
Many thanks wetnose...legend
Mo