On our company network, Windows user names are like DomainXX\U12312, however our Windows accounts have actual names and surnames attached to them.
In my previous .NET Framework 4.6 projects, I could use System.DirectoryServies.AccountManagement as in the answer below:
However, when converting to .NET 7-windows and adding System.DirectoryServices.AccountManagement (8.0.0, which should be compatible), every single property is throwing a PlatformNotSupportedException.
What could an alternative route be to obtain actual Windows first name and surname?
I've read other replies that updating System.DirectoryServies.AccountManagement to match target framework and also make sure that target framework has the -windows suffix
<TargetFramework>net7.0-windows</TargetFramework>
however this is not solving anything