Is there any way to add a code (bash), inside WorkspaceServer_usermods.sh script to capture the user and PID that starts the workspace server and save it on txt file?
The main shell script starts, as it's last action, the workspace server, so the process ID cannot be determined before that. To record the process ID of the WS, insert your code in the autoexec_usermods.sas file. SAS even provides automatic macro variables for this (SYSPROCESSID and SYSUSERID).
The SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment.