HI All,
Just curious to know if we have already created a Script which can give details if the Host is in AD or not.
I have many 10+ vCenter would like to have script which can scan all the host from 10+ vCenter and give the result in excel.
Thanks a ton in Advance.
Try something like this
$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
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Try something like this
$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
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks LucD for help as always
if am missing something here. I tried with the script line but didn't gave any output. Do I need to create any text file and show the hosts or vcenters.
The script assumes that you are already connected to the all the vCenters you want to check.
It starts from $global:defaultviservers, that holds all the vCenter connections.
You can add a one or more Connect-VIServer lines at the beginning.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
That worked ..thanks LucD