VMware Cloud Community
drivera01
Enthusiast
Enthusiast

Getting the CNAME

Hi,

So is it possible to get the CNAMEs on VM's. not the A-record.

I was using this inpiece in my script but it appears to only get the A-record. I would not mind having both A-Record and CNAME.

$vm.DnsAliases =  [string]$lookup=nslookup $vm | Select-String "Name"

thanks!!

0 Kudos
1 Reply
LucD
Leadership
Leadership

You can use the Quest AD snapin cmdlets to query Active Directory, in this case with Get-QadUser.

Or you can query ADSI natively, see for example PowerShell Script: Finding A Distinguished Name of a Group/User or PowerShell Script: Finding A Distinguished Name of a Group/User: Function Find-DN


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos