In PS v2, I have a simple script obtain some info via Get-ADUser, and write that out to a CSV file.
The script works, and returns what I’m after. The only issue is one of the fields(Enabled) is being reflected in my csv file as Upper Case, while it should be mixed case.
When I remove the Export-CSV, the field values are corecctly displayed as True or False. However with the Export-CSV in place, they are returned as TRUE or FALSE.
Any idea why that would be?
$Users = Get-Content ‘C:\TEMP\Users.txt’
Define cumulative array to be used later
$Merged = New-Object System.Collections.ArrayList
Query AD to see if the User exists, and if that User is Disabled or not.
I may have experienced this issue today at work. PowerShell and the Export-Csv cmdlet were working fine, but if you open the CSV file with Excel, it displays the values as TRUE and FALSE (and will save them that way, if you save the file back to disk from Excel.)