PowerShell Scripts, Tips, Expert Advices, Forums, and Resources

Geek Sync Live

Welcome to PowerShell.com, the educational and community site for Windows PowerShell People. Get a quick overview.


As a Powershell.com member you will have access to:

  • Daily PowerShell tips written by Microsoft MVPs and other leading Windows PowerShell experts
  • Free Windows PowerShell advice and training provided by Microsoft MVPs and other leading Windows PowerShell experts
  • Access to leading Windows PowerShell blogs
  • A free ebook, Mastering PowerShell, written by Microsoft MVP Dr. Tobias Weltner
PowerTip of the Day

Changing Local Administrator Account Password

To access local user accounts and assign a new password, you can use the low-level WinNT: namespace.

Note: you do need Administrator privileges to assign new passwords.

This script would assign a new password for the local Administrator account:

#requires -Version 1
$Password = 'P@ssw0rd'

$admin = [adsi]("WinNT://$env:computername/administrator, user")
$admin.psbase.invoke('SetPassword', $Password)

Twitter This Tip! ReTweet this Tip!

Copyright 2012 PowerShell.com. All rights reserved.