How to change local administrator password

This topic contains 5 replies, has 3 voices, and was last updated by  Max Kozlov 1 year, 2 months ago.

  • Author
  • #68229


    Hi everybody

    I want to know if somebody can help me to write a script which will force an administrator to change a local administrator password without known the older password.

    Thank's 🙂 .

  • #68244

    Max Kozlov

    something like this

    $user = [adsi]"WinNT://$ComputerName/$username"
    # may be it is needed too, can't remember. Or it need only for various user parameters
    # $user.SetInfo()
    • #68406


      Thank's. But when I try this, it's ask me the older password. Is it possible to change the password without knowing the older?

      Thank's and excuse me for my poor english 🙂

  • #68445

    Dan Franciscus

    If maintaining local admin passwords is your goal I recommend LAPS. Easy to setup and it works great in my experience.

    • #68476


      Thank's for your reply.

      But my goal is to use powershell to force a user to change the local administrator password without knowing the older.
      In fact, our VM machines when they are build are not directly in a domain. We use IaaS in fact. so the blueprint just have an account (local administrator), and i want with a powershell script to force user to change the password without knowing the older. I want to be the only to keep this old password.

      PS: Excuse me again for my poor english.

      Thanks everybody

  • #68491

    Max Kozlov

    May be you non-admin on comoputer where you try to change password ? It never ask me

You must be logged in to reply to this topic.