changing local admin password issue

Welcome Forums General PowerShell Q&A changing local admin password issue

Viewing 3 reply threads
  • Author
    Posts
    • #197450
      Participant
      Topics: 14
      Replies: 23
      Points: 220
      Rank: Participant

      hi all,

      In our network, we have about 9k workstations. As a security measure, we are changing the Local Admin account's password each 3 months.

      The actual script that does this job is an old vbs that I'm trying to get rid of, and re-do the job in PS.

      I tried this, but I get no error, and when I try to run as that local admin, I get an access denied, so it is obvious that the password was not changed.

      Can someone tell me what I'm doing wrong?

      Thanks!

      $pass = convertTo-secureString -string 'This is a test password' -asPlainText -force

      get-localUser -name 'xxxx' | set-localUser -password $pass

       

    • #197468
      Participant
      Topics: 0
      Replies: 8
      Points: 101
      Rank: Participant

      Hi,

      Did you run powershell as an administrator?

    • #197474
      Participant
      Topics: 14
      Replies: 23
      Points: 220
      Rank: Participant

      yes I did, sorry if I forgot to mention it.

    • #197483
      Participant
      Topics: 14
      Replies: 23
      Points: 220
      Rank: Participant

      ok forget it, it was a tough week and I had a brain fart. it works perfectly.

      thanks for trying.

Viewing 3 reply threads
  • You must be logged in to reply to this topic.