I tried to add a "User" lookup to this so I could report out who needs to log out and back in to get new images, but it didn't work... Perhaps I got the syntax wrong... Where can I find the reference...
See more...
I tried to add a "User" lookup to this so I could report out who needs to log out and back in to get new images, but it didn't work... Perhaps I got the syntax wrong... Where can I find the reference documentation for these kinds of queries? Here's what I tried. I didn't give an error, it just didn't add a user column at all. Any ideas? (xxxxx below in place of actual server name for this posting only) $viewServer = "xxxxx" $view = "dc=vdi,dc=vmware,dc=int" $domain = "LDAP://$viewServer/$view" $root = New-Object System.DirectoryServices.DirectoryEntry $domain $query = New-Object System.DirectoryServices.DirectorySearcher($root) $query.filter = "(&(objectClass=pae-VM))" $query.FindAll() | %{ New-Object PSObject -Property @{ Name = $_.Properties["pae-displayname"][0] BaseVM = $_.Properties["pae-svivmparentvm"][0] BaseSnapshot = $_.Properties["pae-svivmsnapshot"][0] User = $_.Properties["pae-sviuser"][0] } } | Select Name,BaseVM,BaseSnapshot,User | Sort BaseSnapshot,BaseVM,Name,User