Hi All! I've been working on this script for quite a while and I seem to have run into a roadblock where I just cannot figure out what is going wrong. It's likely something to do with my $Userfound statement but I'm not sure how to fix it, so I am turning to the Spiceworks community to help. I am relatively new to Powershell so please keep that in mind.

Powershell

$path=Read-Host-Prompt'Input full file path and name of the file you wish to analyze'$foundenabled=New-ObjectSystem.Collections.ArrayList$founddisabled=New-ObjectSystem.Collections.ArrayList$notfound=New-ObjectSystem.Collections.ArrayListImport-Csv$path|Foreach-Object{try{$UserFound=Get-ADUser-Identity$_.UserName-PropertiesipPhone,EmailAddress-ErrorActionStop}catch{}if($UserFound){if($UserFound.Enabled-eq$true){$foundenabled.Add(($UserFound|Select-ObjectSAMAccountName,ipPhone,EmailAddress))|Out-Null}else{$founddisabled.Add(($UserFound.Enabled-eq$false|Select-ObjectSAMAccountName,ipPhone,EmailAddress))|Out-Null}}else{$notfound.Add(($_))|Out-Null}}$founddisabled|Export-Csv-PathC:\Users\[redacted]\Desktop\Credparser2019\Results\disabled.csv-NoTypeInformation$foundenabled|Export-Csv-PathC:\Users\[redacted]\Desktop\Credparser2019\Results\enabled.csv-NoTypeInformation$notfound|Export-Csv-PathC:\Users\[redacted]\Desktop\Credparser2019\Results\notfound.csv-NoTypeInformation