Once your script has created a web application log-on name as a string value, it must assign it to the LoginUser.Username property. The script can assign the user name string directly to the property.
LoginUser.Username
Doc Feedback
last updated: Feb 06, 2019