Comments on: Manage Local Windows User with PowerShell https://www.thomasmaurer.ch/2018/07/manage-local-windows-user-powershell/ Cloud and Datacenter Blog focusing on Microsoft Azure Wed, 10 Feb 2021 11:34:49 +0000 hourly 1 https://wordpress.org/?v=6.4.1 By: Josh https://www.thomasmaurer.ch/2018/07/manage-local-windows-user-powershell/#comment-847047 Wed, 10 Feb 2021 11:34:49 +0000 http://www.thomasmaurer.ch/?p=7958#comment-847047 Hello,
Nice post, thanks.
I am having the following problem and wondering if you would have any idea please?

We are in full Azure AD (therefore no physical AD).
when i add AZURE AD admin user from computer, his local username becomes John.DOE instead of John DOE space. And if we add an additional particle within the framework of the partners, it is truncated: John DOE (Conso Partners) becomes JohnDoe (Cons

i would like to know if i can using powershel script for replace the current value with what I want and that it matches in the registry and all the parameters of the station? and by the same time remove also user firstname accents.

in your Get-LocalUser example I only see AzureAD users:

PS C: \ windows \ system32> Get-LocalUser

Name Enabled Description
—- ——- ———–
Administrator False Administration user account
DefaultAccount False User account managed by the system.
Guest False Guest user account
WDAGUtilityAccount False User account managed and used by the system for Windows Defender A scenarios …

PS C:\windows\system32> Get-LocalGroup

Name Description
—- ———–
Administrateurs Les membres du groupe Administrateurs disposent d’un accès complet et il…

Thanks for your help

]]>
By: Da_Apprentice https://www.thomasmaurer.ch/2018/07/manage-local-windows-user-powershell/#comment-819701 Wed, 07 Oct 2020 12:45:09 +0000 http://www.thomasmaurer.ch/?p=7958#comment-819701 Hello Mr. Maurer, I tried your suggestion above for using plain text password in the script:
If you want to see that password you can also use this method, to create a new Windows User:
$Password= ConvertTo-SecureString “Password” -AsPlainText -Force
New-LocalUser “Tom” -Password $Password -FullName “Thomas Maurer” -Description “Description”

I saved this script to a usb thumb drive and tried to run it on another computer in a workgroup environment and I got this error:
New-LocalUser : Access denied.
At D:\TEST-UserAccountCreation.ps1:7 char:1
+ New-LocalUser $StaffUser -Password $password -Description $NewUserDes …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : PermissionDenied: (test-user:LocalUser) [New-LocalUser], AccessDeniedException
+ FullyQualifiedErrorId : AccessDenied,Microsoft.PowerShell.Commands.NewLocalUserCommand

Any suggestions? I have a large number of computers that are in a workgroup environment (not in a domain) that I need to set up with similar accounts. I am trying to find a way to better automate local user account creation without being prompted for a password everytime a user account is created from the script. It gets to be exhausting–3 to 4 local user account creations times 20 computers in a workgroup. Please help! :)

Thanks to all who can lend me a hand with this obstacle.

]]>
By: Aaron https://www.thomasmaurer.ch/2018/07/manage-local-windows-user-powershell/#comment-774950 Thu, 16 Apr 2020 12:43:00 +0000 http://www.thomasmaurer.ch/?p=7958#comment-774950 Possilbe to remove an AzureAD\username account previously signed into the OS?

I’ve tried AzureAD\UserName, AzureAD\UserName@company.net, or AzureAD\User.Name@company.net (real email address) and all not found.

]]>