Remotely triggered build autherization required get user id

Hi,
Jenkins 2.308
I have a Jenkins job that is triggered remotely from powershell scripts. The job is limited to certain users. When it runs it does NOT display user id, instead it displays “Started by remote host ”
It is working fine, all I want is to log the user that triggered it. I have search and the closest I’ve found is the “&cause=” work around. I would like to get this information from the server and NOT depend on the user to include their userid.
It’s running on a Linux server (Ubuntu 18.04.5 LTS).
I have found user files apiTokenStats.xml and config.xml in
/var/lib/jenkins/users/_#########/
I was hoping there would be something in those config files I could use but haven’t figured it out yet.

This is a snip of the powershell script that calls the job:

encrypt credentials

$enc = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(“$($UserName):$($UserToken)”))

header

$header = @{‘Authorization’ = “Basic $enc”}

ur

$url = “https://$server/$job/buildWithParameters?token=$jobtoken&FILE=$file

kick off build

Invoke-RestMethod -Uri $url -Method ‘Post’ -Headers $header

From the url it looks as if you have configured your job to allow triggering it by a token that is configured in your job. I think in that case the user is not put in the cause. To overcome this, trigger the job without the token parameter. But this requires that the users that want to trigger the job need the “Build” permission on the job.

I have started using jenkins and I am attempting to create a powershell script that triggers job remotely but I am running into issues where it gives me a 401 or 403 error. Could we connect and you could help me take a look? Ive done tons of research and I have 14 different variations of this script but none seem to work.