@Shaw69 so it's nothing related to MacOS!
SMB owner should edit his share : grant permission to guest and turn off login/password prompts.
Is that correct ?
I mean, technically disabling authentication would work. However I would love to see an organization that would allow un-authenticated access to a sharedrive. That is a massive security vulnerability.
I would approach this by also entering the password from CLI. Make a service account that has the necessary access to the server. Make a script to map the drive with the service account (have the user name and password in the script). To make things more secure look in to salting the password so it is obfuscated.
This should get the job done. I don't have a way to test this unfortunately as running this in my environment will flag a security finding since the password is in clear text. Open handles mounting the volume, and lets you hard pass a username and password. adding ./mntpoint to the end may be something you need to do.
open 'smb://user:password@server/folder'