Windows Users/Groups

Show Current User

Powershell

$env:UserName

$env:UserDomain

Change Password

Use one of the following methods...

net user myuser mynewpass

To be prompted for the password (more secure)...

net user myuser *

Ctrl + Alt + Del

There will be an option to "Change password"

In a remote desktop session Ctrl + Alt + Del is often replaced by Ctrl + Alt + End.

If this doesn't work (as is often the case if you login to nested remote desktop connections) use the On Screen Keyboard....

Search for OSK and run On-Screen Keyboard then press Ctrl + Alt on your physical keyboard whilst clicking the Del key in the OSK.

Local Users

Server Manager

Server Manager - Tools - Computer Management - Local Users and Groups

Powershell

Requires the LocalAccounts module (installed by default in Windows Server 2016 and above)

To create the user...

$Password = Read-Host -AsSecureString

New-LocalUser -Name username -Description "description" -Password $Password

To make the user an administrator...

Add-LocalGroupMember -Group "Administrators" -Member "username"

username can be a local user, a domain user, a domain group or a Microsoft Account

To remove the user from the Administrators group (i.e. to undo the change above)...

Remove-LocalGroupMember -Group "Administrators" -Member "username"

To see a list of users...

Get-LocalUser

Groups


Powershell

Requires the LocalAccounts module (installed by default in Windows Server 2016 and above)

To show groups...

Get-LocalGroup

Show group membership...

Get-LocalGroupMember -Group "Administrators"

Bibliography