So I am haven’t worked with objects to terrible much I have searched around for a way to do this but can’t seem to find anything to terribly useful.
My problem is I want to create a custom object from Get-VM and grab the selected like Name, PowerState and ProvisionedSpaceGB properties. Then use Get-ADUser to grab a few select properties like SamAccountName, DisplayName, and Enabled…
I am trying to create one object that would contain all the infomation and format it like the following:
VirtualMachine PowerState ProvisionedSpace DisplayName SamAccountName AccountEnabled
VM1 PoweredOff 103.03 name1 user1 false
and so on…
I am able to create two separate objects but my trouble is with combining them to create one obj that can easily be exported to a csv file or other format. If any one would like to see what I have so far I will gladly post my code. And if anyone has any ideas one how to perform the above any help is greatly appreciated. Thanks in advance.