I have two objects from an AD query in two variables, when I echo them they always end up in the same table. Very anoying.
For example
Echo "Users:"
$InactiveUsers | select name
Echo "Computers:"
$InactiveComputers | select name, lastlogondate
This should give me this result
Users:
name
----
John
Computers:
name lastlogondate
---- -------------
JohnComputer 1.1.2011
But instead I get it like this
Users:
name
----
John
Computers:
JohnComputer
What am I doing wrong?
Your problem is your script is outputting more than one type of object (three in fact). If you truely want to throw out the objects and just want tables, do this.