Windows powershell - missing argument parameter

YAEL ELIAS 1 Reputation point
2022-09-16T16:34:50.313+00:00

net user Game Account /time:M-F,6am-8am;M-F,3pm-5pm;M-F,8pm-10pm

error:
At line:1 char:44

  • net user Game Account /time:M-F,6am-8am;M-F,3pm-5pm;M-F,8pm-10pm
  • ~
    Missing argument in parameter list.
    At line:1 char:56
  • net user Game Account /time:M-F,6am-8am;M-F,3pm-5pm;M-F,8pm-10pm
  • ~
    Missing argument in parameter list.
  • CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
  • FullyQualifiedErrorId : MissingArgument
Windows for business Windows Server User experience PowerShell
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. MotoX80 36,291 Reputation points
    2022-09-16T17:33:04.213+00:00

    You need to put quotes around the times in addition to the account name (if you have spaces in the account name".

    net user "Game Account" /times:"M-F,6am-8am;M-F,3pm-5pm;M-F,8pm-10pm"  
    
    3 people found this answer helpful.

  2. Dillon Silzer 57,826 Reputation points Volunteer Moderator
    2022-09-16T16:46:27.497+00:00

    Hi @YAEL ELIAS

    1) Try running this from an Administrator cmd prompt.

    241869-image.png

    2) Try adding "" around Game Account (i.e. net user "Game Account" /time:M-F,6am-8am;M-F,3pm-5pm;M-F,8pm-10pm)


    If this is helpful please accept answer.

    0 comments No comments

  3. Andreas Baumgarten 123.4K Reputation points MVP Volunteer Moderator
    2022-09-16T16:51:38.73+00:00

    Hi @YAEL ELIAS ,

    please run the command in a Command Prompt with elevated permission. It looks like in PowerShell it's not possible to run the command this way.

    ----------

    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Regards
    Andreas Baumgarten

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.