I am very new to Powershell and I'm trying to export three attributes found in multiple groups. Lets say these are Attribute A, Attribute B, and Attribute C.
Attribute A and B are present in all groups returned by the Get-ADGroup query I've written. However, Attribute C is only present in 1/3 of the groups, and for the remainder of these groups the Attribute C field is 'null'.
When I try to export this data to excel (using Export-Csv), Attribute A and B are correctly exported as columns, however Attribute C is not there. How do I include Attribute C as a column for the groups that have that field filled in, when exporting this query results as csv?
The query that I am using is:
Get-ADGroup -LDAPFilter "(name=IT-*)" -SearchScope Subtree -SearchBase "DC=KRFT, DC=Net"
-Properties Attribute A, Attribute B, Attribute C | Export-Csv
"C:\Users\user1\Desktop\Powershell\groups.csv"
Thanks :)