You need to nexec those commands – eg
Nexec –e cmd /c “net user xxx”
Nexec –e sh –c “userdel xxx”
From error message it seems its a permission issue.
How you are executing the script on target
Do you have proper permissions execute userdel command on Linux box?
echo "OS is Linux."
nexec –e sh "userdel -fr CLMTEST"
nexec: Error accessing host –e: Remote host is unknown
is this running as a nsh 'runscript' job ? otherwise replace the '-e' w/ the target name.
nexec -e sh -c "/usr/sbin/userdel -fr CLMTEST" is the correct answer