Forum Discussion
shadranok
Oct 18, 2022Copper Contributor
New_LocalUser not working
I'm trying to use powershell 7 to create a new local user on my computer and I always get an error message. PowerShell 7.2.6
Copyright (c) Microsoft Corporation.
https://aka.ms/powershell
Type 'he...
- Oct 24, 2022DESCRIPTION
The `New-LocalUser` cmdlet creates a local user account. This cmdlet creates a local user account or a local user account that is connected to a Microsoft account.
> [!NOTE] > The Microsoft.PowerShell.LocalAccounts module is not available in 32-bit PowerShell on a 64-bit > system
Have the same issue, does work in PowerShell v5. It does work after running import-module microsoft.powershell.localaccounts -UseWindowsPowerShell (Effectively running it in PowerShell v5 mode in PowerShell v7)
Oct 24, 2022
DESCRIPTION
The `New-LocalUser` cmdlet creates a local user account. This cmdlet creates a local user account or a local user account that is connected to a Microsoft account.
> [!NOTE] > The Microsoft.PowerShell.LocalAccounts module is not available in 32-bit PowerShell on a 64-bit > system
Have the same issue, does work in PowerShell v5. It does work after running import-module microsoft.powershell.localaccounts -UseWindowsPowerShell (Effectively running it in PowerShell v5 mode in PowerShell v7)
The `New-LocalUser` cmdlet creates a local user account. This cmdlet creates a local user account or a local user account that is connected to a Microsoft account.
> [!NOTE] > The Microsoft.PowerShell.LocalAccounts module is not available in 32-bit PowerShell on a 64-bit > system
Have the same issue, does work in PowerShell v5. It does work after running import-module microsoft.powershell.localaccounts -UseWindowsPowerShell (Effectively running it in PowerShell v5 mode in PowerShell v7)
- santiago_-_-Aug 04, 2023Copper ContributorHello, I am getting the same issue when I use the new-localuser on a Powershell version 7.3.6. I don't understand how to fix this.
- Aug 04, 2023
santiago_-_-
"it does work after running import-module microsoft.powershell.localaccounts -UseWindowsPowerShell (Effectively running it in PowerShell v5 mode in PowerShell v7)"Just tested it again, still works like that in PowerShell 7
- santiago_-_-Aug 05, 2023Copper Contributor
Hello and thank you for getting back to me so quickly! You are right it does work (second picture), however, I get this message after I run the cmdlets (first picture top). The problem is that after I close the Powershell terminal I get the same error (third picture), does that mean that I have to run the cmdlet import-module microsoft.powershell.localaccounts -usewindowspowershell every single time I open Powershell and want to create a new local user?