![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Changing password for a local user on a remote computer.... Hi, I've been looking for an PS script to change the password for a local user on a remote server. For WIN 2003 servers this works: $admin=[adsi]("WinNT://" + $strIP + "/" + $strUser + ", user") $admin.psbase.invoke("SetPassword", $strPWD) But when I run the script against a Win 2008 server I get the exception: Exception calling "Invoke" with "2" argument(s): "Exception has been thrown by the target of an invocation." At :line:40 char:22 + $admin.psbase.invoke <<<< ("SetPassword", $strPWD) Does anyone know how to fix the error or set the password for a local user - remotely??? Really need help - have over 300 servers that need password changes..... \\A. Mikkelsen |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Changing password for a local user on a remote computer.... Hello A. Mikkelsen (anders? ;-)) I have tested your issue and i found out that if i put a password that does not meet the password requirements, i get the same error as you. (was testing on a win2008 R2, but it should be the same ?). but if the password is acceptable, i have no errors with your code if you run it on a local powershell on the win2008 i get a more detailed error message. I hopt it helps! Best Regards Jakob Svendsen http://blog.coretech.dk/athors/jgs "A. Mikkelsen" <A. Mikkelsen@xxxxxx> wrote in message news:62341417-C645-4E94-88A6-CFE5210F1CD8@xxxxxx Quote: > Hi, > > I've been looking for an PS script to change the password for a local user > on a remote server. > > For WIN 2003 servers this works: > $admin=[adsi]("WinNT://" + $strIP + "/" + $strUser + ", user") > $admin.psbase.invoke("SetPassword", $strPWD) > > But when I run the script against a Win 2008 server I get the exception: > Exception calling "Invoke" with "2" argument(s): "Exception has been > thrown > by the target of an invocation." > At :line:40 char:22 > + $admin.psbase.invoke <<<< ("SetPassword", $strPWD) > > Does anyone know how to fix the error or set the password for a local > user - > remotely??? > > Really need help - have over 300 servers that need password changes..... > > \\A. Mikkelsen |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Changing password for a local user on a remote computer.... Hello A. Mikkelsen (anders? ;-)) I have tested your issue and i found out that if i put a password that does not meet the password requirements, i get the same error as you. (was testing on a win2008 R2, but it should be the same ?). but if the password is acceptable, i have no errors with your code if you run it on a local powershell on the win2008 i get a more detailed error message, describing the password complexity error. I hope it helps! Best Regards Jakob Svendsen http://blog.coretech.dk/athors/jgs "A. Mikkelsen" <A. Mikkelsen@xxxxxx> wrote in message news:62341417-C645-4E94-88A6-CFE5210F1CD8@xxxxxx Quote: > Hi, > > I've been looking for an PS script to change the password for a local user > on a remote server. > > For WIN 2003 servers this works: > $admin=[adsi]("WinNT://" + $strIP + "/" + $strUser + ", user") > $admin.psbase.invoke("SetPassword", $strPWD) > > But when I run the script against a Win 2008 server I get the exception: > Exception calling "Invoke" with "2" argument(s): "Exception has been > thrown > by the target of an invocation." > At :line:40 char:22 > + $admin.psbase.invoke <<<< ("SetPassword", $strPWD) > > Does anyone know how to fix the error or set the password for a local > user - > remotely??? > > Really need help - have over 300 servers that need password changes..... > > \\A. Mikkelsen |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Changing password for a local user on a remote computer.... HeY Jakob Yes - Anders Here :-) I just tested and it works when I: - log in as administrator and change the password for a local user - log in as a user that is member of the local administrator group, open powershell as administrator, then I can change the password for the user and the administrator. But it doesn't work when I: - log in as a user that is member of the local administrator group and try to change the password for the local administrator or the user it self. Seems that beeing member of the administrator group isn't the same as being administrator. Does anyone know how to run PS as Administrator on a remote system when you connect with a user that is only member of the administrator group? \\A. Mikkelsen "Jakob Svendsen" wrote: Quote: > Hello A. Mikkelsen (anders? ;-)) > > I have tested your issue > and i found out that if i put a password that does not meet the password > requirements, i get the same error as you. > > (was testing on a win2008 R2, but it should be the same ?). > > but if the password is acceptable, i have no errors with your code > if you run it on a local powershell on the win2008 i get a more detailed > error message, describing the password complexity error. > > > I hope it helps! > > Best Regards > > Jakob Svendsen > > http://blog.coretech.dk/athors/jgs > > > > > "A. Mikkelsen" <A. Mikkelsen@xxxxxx> wrote in message > news:62341417-C645-4E94-88A6-CFE5210F1CD8@xxxxxx Quote: > > Hi, > > > > I've been looking for an PS script to change the password for a local user > > on a remote server. > > > > For WIN 2003 servers this works: > > $admin=[adsi]("WinNT://" + $strIP + "/" + $strUser + ", user") > > $admin.psbase.invoke("SetPassword", $strPWD) > > > > But when I run the script against a Win 2008 server I get the exception: > > Exception calling "Invoke" with "2" argument(s): "Exception has been > > thrown > > by the target of an invocation." > > At :line:40 char:22 > > + $admin.psbase.invoke <<<< ("SetPassword", $strPWD) > > > > Does anyone know how to fix the error or set the password for a local > > user - > > remotely??? > > > > Really need help - have over 300 servers that need password changes..... > > > > \\A. Mikkelsen > |
My System Specs![]() |
| | #5 (permalink) |
| | Re: Changing password for a local user on a remote computer.... HeY Jakob Yes - Anders Here :-) I just tested and it works when I: - log in as administrator and change the password for a local user - log in as a user that is member of the local administrator group, open powershell as administrator, then I can change the password for the user and the administrator. But it doesn't work when I: - log in as a user that is member of the local administrator group and try to change the password for the local administrator or the user it self. Seems that beeing member of the administrator group isn't the same as being administrator. Does anyone know how to run PS as Administrator on a remote system when you connect with a user that is only member of the administrator group? \\A. Mikkelsen "Jakob Svendsen" wrote: Quote: > Hello A. Mikkelsen (anders? ;-)) > > I have tested your issue > and i found out that if i put a password that does not meet the password > requirements, i get the same error as you. > > (was testing on a win2008 R2, but it should be the same ?). > > but if the password is acceptable, i have no errors with your code > if you run it on a local powershell on the win2008 i get a more detailed > error message, describing the password complexity error. > > > I hope it helps! > > Best Regards > > Jakob Svendsen > > http://blog.coretech.dk/athors/jgs > > > > > "A. Mikkelsen" <A. Mikkelsen@xxxxxx> wrote in message > news:62341417-C645-4E94-88A6-CFE5210F1CD8@xxxxxx Quote: > > Hi, > > > > I've been looking for an PS script to change the password for a local user > > on a remote server. > > > > For WIN 2003 servers this works: > > $admin=[adsi]("WinNT://" + $strIP + "/" + $strUser + ", user") > > $admin.psbase.invoke("SetPassword", $strPWD) > > > > But when I run the script against a Win 2008 server I get the exception: > > Exception calling "Invoke" with "2" argument(s): "Exception has been > > thrown > > by the target of an invocation." > > At :line:40 char:22 > > + $admin.psbase.invoke <<<< ("SetPassword", $strPWD) > > > > Does anyone know how to fix the error or set the password for a local > > user - > > remotely??? > > > > Really need help - have over 300 servers that need password changes..... > > > > \\A. Mikkelsen > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Changing the local admin password base on the computer's OU | VB Script | |||
| renaming Local user account and Changing "Full Name" of same Local | VB Script | |||
| change user password on remote computer | VB Script | |||
| Re: changing password for a existing ad user | PowerShell | |||
| changing password for a existing ad user | PowerShell | |||