New-LocalUser Not Working

I get the error message below when I try to create a new local user.

Michael,
Welcome to the forum. :wave:t4:

Please do not post images of code or console output. Instead post the plain text and format it as code.

When you post code, sample data, console output or error messages please format it as code using the preformatted text button ( </> ). Simply place your cursor on an empty line, click the button and paste your code.

Thanks in advance

How to format code in PowerShell.org <---- Click :point_up_2:t4: :wink:

Have you tried to run the command in Windows PowerShell?

Greetings Olaf:

My apologies for my violation. I tried clicking the “How to format code in Powershell.org” and I got an error 403.
regards

PowerShell 7.2.6
Copyright (c) Microsoft Corporation.

https://aka.ms/powershell
Type 'help' to get help.

PS C:\Windows\System32> new-localuser -name 'bob'

cmdlet New-LocalUser at command pipeline position 1
Supply values for the following parameters:
Password:
New-LocalUser: Could not load type 'Microsoft.PowerShell.Telemetry.Internal.TelemetryAPI' from assembly 'System.Management.Automation, Version=7.2.6.500, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
PS C:\Windows\System32>

I quote myself:

Does it need to run in version 7?

Yes, it needs to run in version 7.

I cannot reproduce your error. I just tried it and it works just as expected. It may be an issue with your particular system. You may try it on another system. :man_shrugging:t4:

1 Like