Posted On September 21, 2022

Changing User Password Using Command Lines or PowerShell

kimconnect 0 comments
blog.KimConnect.com >> Windows >> Changing User Password Using Command Lines or PowerShell
# Command-line method
net user usernamehere newpasswordhere

# Powershell Method 1 - via ActiveDirectory module
$username="USERNAMEHERE"
$newPassword="NEWPASSWORDHERE"
$encryptedPass= ConvertTo-SecureString $newPassword -AsPlainText -Force 
Set-ADAccountPassword -Identity $username -NewPassword $encryptedPass -Reset

# Powershell method 2 - via ASDI
$userid = [ADSI]"LDAP://CN=USERNAME,OU=Users,DC=DOMAIN,DC=Local"
$userid.psbase.invoke("SetPassword",'NEWPASSWORDHERE')
$userid.psbase.CommitChanges()

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

Quick Command To Get Windows Version

To Get Windows Version as String: (Get-WmiObject -class Win32_OperatingSystem).Caption [deesee1]: PS C:\Users\kimconnect> (Get-WmiObject -class Win32_OperatingSystem).CaptionMicrosoft…

Bosch Security Camera System

How to access the IP camera software (Tonto)   Using Internet Explorer, go to this…

Install Microsoft FTP on Windows 2008 R2

1. Install IIS without FTP 2. Download FTP a. x64: b. x86: 3. Create FTP…
Other project: DragonCoin.com