Site criado para dúvidas, artigos sobre tecnologias, sistemas de apoio, estratégias de negócio e dicas úteis do nosso dia a dia no trabalho.
quarta-feira, 27 de fevereiro de 2019
quarta-feira, 20 de fevereiro de 2019
Resetar, Alterar Senha Windows
List Windows User accounts
The most simple one is obviously to list Windows users or groups, using the PowerShell Get- commands.
List all local Windows Users:
1
|
Get-LocalUser
|
List all local Windows Groups:
1
|
Get-LocalGroup
|
Create new Windows User account using PowerShell
There are three different account types you can add to Windows 10:
- Local Windows Users
- Microsoft Accounts
- Azure AD Accounts
The following part describes how you can add them to your Windows system using PowerShell
To create a new Windows User account you can simply use the following command:
1
2
3
|
$Password = Read-Host -AsSecureString
New-LocalUser "Tom" -Password $Password -FullName "Thomas Maurer" -Description "Description"
|
If you want to see that password you can also use this method, to create a new Windows User:
1
2
3
|
$Password= ConvertTo-SecureString "Password" -AsPlainText -Force
New-LocalUser "Tom" -Password $Password -FullName "Thomas Maurer" -Description "Description"
|
Create a new Windows User account connected to a Microsoft Account with PowerShell.
With Windows 10 you have the opportunity to login using Microsoft Accounts, for example with outlook.com or hotmail.com email aliases. For that you can use the folloing command to create a new Windows User connected to a Microsoft Account. In this case you will not need to configure a password for the account, since this is connected to the Microsoft Account.
1
|
New-LocalUser -Name "MicrosoftAccount\TomTheGreate@outlook.com" -Description "Description of this Microsoft account."
|
You can also add Azure Active Directory (Azure AD) accounts if your business is for example using Office 365. The following command adds an Azure AD account to the local Windows Users:
1
|
New-LocalUser -Name "AzureAD\TomMaurer@contoso.com" -Description "Description of this Azure AD account."
|
Remove Windows User account
You can also simply remove user accounts from Windows using PowerShell. The following command will delete the account:
1
|
Remove-LocalUser -Name "SomeUser"
|
Change password of a Windows User account
To change the password of a local Windows User account, you can use the Set-LocalUser cmdlet. This also has some other options as well, but one of the most common ones is to reset the password.
1
2
3
|
$Password = Read-Host -AsSecureString
Get-LocalUser -Name "SomeUser" | Set-LocalUser -Password $Password
|
Rename a Windows User account
To rename a Windows User account with PowerShell, you can use the following command:
1
|
Rename-LocalUser -Name "Tom" -NewName "Tom2"
|
Add Windows User account to group
This command for example adds users to the Windows Administrator group:
1
|
Add-LocalGroupMember -Group "Administrators" -Member "Admin02", "MicrosoftAccount\TomTheGreat@Outlook.com", "AzureAD\TomMaurer@contoso.com", "CONTOSO\Domain Admins"
|
I hope this gives you a quick overview how you can manage local Windows User accounts using PowerShell.
Assinar:
Postagens (Atom)
Como mover senhas e favoritos entre Microsoft Edge Chromium
Press Win + R keys to open up the Run dialog box. Type %LocalAppData%\Microsoft\Edge\User Data and press enter . Move the Default ...
-
No menu iniciar, digite Bloco de Notas e execute como administrador No bloco de notas, clique em Arquivo > Abrir e cole o caminho aba...
-
Se existe um processo que pode salvar nossos finais de semana, é a verificação de um DC após a promoção, muitas vezes não fazemos a checag...