I've queried certain information from an SQL database and put it into a variable named $tablevalue
. Now I want add new column on the output and that requires querying active directory for the status of a computer object
$tablevalue
has a typename System.Data.DataRow
Sample query:
$tablevalue | select netbios_name0, client0, @{n='ADComputer_Enabled';e={
(Get-ADComputer -Filter {name -like {$_.netbios_name0} | select Enabled)
}}
Desired output:
netbios_name0, client0, ADComputer_enabled computer1 version1 True computer1 version1 False