VMware Cloud Community
Zsoldier
Expert
Expert
Jump to solution

Username in Events

Two questions:

  1. VMware - Any plans to capture UPN of user rather than classic netbios\username?
  2. Anyone know of a way to convert domain netbios name to it's equivalent DNS name?

The issue I'm running into is w/ several vCenters and several different domains now.  The script I use captures the username from events and uses that to search for their e-mail address.  Problem now is that some people have multiple accounts on multiple domains, so only one will have a valid email associated.

Since I'm running script under context of one domain, I can no longer simply just parse out the username w/ the get-aduser cmdlet.  Soooo, yeah, that's where I'm at.  Any thoughts/ideas?

Chris Nakagaki (中垣浩一)
Blog: https://tech.zsoldier.com
Twitter: @zsoldier
Tags (3)
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

1) +1, but in a new property please. Otherwise a lot of existing scripts will fail :smileydevil:

2) Does this help ?

From the Name and DNSRoot you should be able to compose the full DNS name

Get-ADDomain | Select Name,NetBIOSName,DistinguishedName,DNSRoot


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

View solution in original post

4 Replies
LucD
Leadership
Leadership
Jump to solution

1) +1, but in a new property please. Otherwise a lot of existing scripts will fail :smileydevil:

2) Does this help ?

From the Name and DNSRoot you should be able to compose the full DNS name

Get-ADDomain | Select Name,NetBIOSName,DistinguishedName,DNSRoot


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

Zsoldier
Expert
Expert
Jump to solution

Ahh, yeah.  That looks like it will work.  I'm able to pass that cmdlet the netbios name and get the domain information I'm looking for.  Thanks LucD‌!

So it would look something like this:

get-aduser -server (get-addomain NETBIOSNAME).infrastructuremaster "usernameinthatdomain"

Chris Nakagaki (中垣浩一)
Blog: https://tech.zsoldier.com
Twitter: @zsoldier
Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Not sure if you can do this cross-forest, but you can always do a remote session


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

Reply
0 Kudos
Zsoldier
Expert
Expert
Jump to solution

it appears to work as long as a trust is in place.  Luckily for my scenario, there is one, so this'll work as a stop gap for me.

Chris Nakagaki (中垣浩一)
Blog: https://tech.zsoldier.com
Twitter: @zsoldier
Reply
0 Kudos