Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - How do I change domain account password

Reply
 
Old 05-31-2009   #1 (permalink)
DBAdan


 
 

How do I change domain account password

I have service accounts that I use to run SQL Server services.

I run powershell from my local machine using my login USERDOMAIN\myid

I want to change the password for the service accounts that reside in a
different domain PRODDOMAIN\svc_account1. I have permissions to change the
service account passwords, and I am able to change the password using the
windows server tool "Active Directory Users and Computers" . I cannot get
the password change to work using Powershell.

I want to avoid having to install the quest cmdlets.

I have searched quite a while and this code snippet seems close to what I
need.

$password='NewPWValue1'
$user = [ADSI]"LDAP://CN=svc_account1,OU=Service Accounts,OU=User
Data,DC=proddomain,DC=mycompany,DC=com"
$user.Invoke("SetPassword", $password)
$user.pwdLastSet = 0
$user.SetInfo()

I get this errormessage when I run that code:

Exception calling "Invoke" with "2" argument(s): "Member not found.
(Exception from HRESULT: 0x80020003 (DISP_E_MEMBERN
OTFOUND))"
At line:1 char:13
+ $user.Invoke( <<<< "SetPassword", "NewPassword123")
If I do end up using the ADSI, is there a way to translate t he PRODDOMAIN
to the FQDN as in PRODDOMAIN.mycompany.com

If you have a better script that works that would be fine.

Please help if you can.

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Users are unable to change domain password Vista security
domain user account UAC without domain admin id/password?? Vista security
Solved User Account Password - Change from Win RE Tutorials
Vista machine cannot change domain password Vista account administration
Removed Functionality - Change a password for a domain account from a workgroup machine. Vista account administration


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46