Solution for adding user mariyam in an non-interactive shell

HI,

I had added a user using a script which I thought would be a non-interactive way to add it. Please
advise of the right way to achieve this task.

Thanking You,
Faisal Bin Basha

Here, we are talking about non-interactive shell (e.g. /sbin/nologin) not the non-interactive way of creating a user account.
So, to resolve the task you have to create a user with a non-interactive shell (/sbin/nologin).