Defender Antivirus exclusion user variables

Craig Garland
236
Reputation points
Hi Guys,
I hope someone has an answer for this.
I am looking to exclude a folder in Defender endpoint. The issue is that I want to exclude a folder based on the login username. EG: c:\Folder\Username.
I assume that I could just you the variable %username% but it looks like this does not work. I found an article that says it is invalid, and if I run MpCmdrun -checkexclusion -path c:\Folder\Username. is not excluded.
Does anyone know how to exclude a folder based on the signed in username?
Regards
Craig