Delete a Local User Account With PowerShell

I need to delete a user from the PowerShell terminal and I don’t know how to do it. Well, fear no more, let’s have a quick read on Remove-LocalUser on how to do this. The command to delete the user is Remove-LocaUser. Remove-LocalUser [-InputObject] <LocalUser[]> [-WhatIf] [-Confirm] [<CommonParameters>] Remove-LocalUser [-Name] <String[]> [-WhatIf] [-Confirm] [<CommonParameters>] Remove-LocalUser [-SID] <SecurityIdentifier[]> [-WhatIf] [-Confirm] [<CommonParameters>] Here is an example of deleting a local user called simba....

April 22, 2020 · 1 min · 132 words · kenno

Create a User Account with PowerShell

Today I learned how to create a user account on Windows 10 using PowerShell. Let’s create a small exercise to demonstrate how can this be easily done. Task: “Create a local user account named ’localaccount’ with the password BlueHat. This new user should have admin privilege.” First, launch the PowerShell (terminal?), by running as Administrator. The password will be stored in a variable called $Password: $Password = Read-Host -AsSecureString ******* Now we’re ready to create a new local account:...

October 24, 2019 · 1 min · 161 words · kenno