Changing Local Admin with PowerShell

Author Message
lstech

  • Total Posts : 2
  • Scores: 0
  • Reward points : 0
  • Joined: 7/9/2010
  • Status: offline
Changing Local Admin with PowerShell Friday, July 09, 2010 4:54 AM (permalink)
0
I've played around with a coulple of PowerShell scripts to change the local admin on a group pc's but I haven't had 100% sucess.  Out of 500 pc's 350 are updated.  Most of what I've seen use the following code method.
$admin=[adsi]("WinNT://" + $strComputer + "/administrator, user")
$admin.psbase.invoke("SetPassword", "Whatever1")
 
What I get back from a csv report is Yes, No or not on because not able to ping.   
 
My question is on some pc's it works fine but on others it doesn't. 
 
Is there a better method of updating the local administrator account using Powershell?  What are the requirements to run Powershell against a remote machine?
 
Thanks
 
#1
    TomRiddle

    • Total Posts : 620
    • Scores: 12
    • Reward points : 0
    • Joined: 2/7/2008
    • Location: Australia
    • Status: offline
    Re:Changing Local Admin with PowerShell Saturday, July 17, 2010 12:49 AM (permalink)
    0
    Hi did you work this out?
    I think the only requirements to run powershell against a remote machine is that remote machine has no firewall, you can ping it and you are local admin on it. 

    -join([int[]][char[]]'Ut|jwXmjqq%Wzqjx'|%{[char]($_-5)})
     
    #2
      ginolard

      • Total Posts : 1347
      • Scores: 23
      • Reward points : 0
      • Joined: 8/11/2005
      • Status: offline
      Re:Changing Local Admin with PowerShell Sunday, July 18, 2010 7:45 PM (permalink)
      0
      Do all the machines have Powershell installed on them?  If so, you could use Remoting to do it.
      Author of ManagePC - http://managepc.net

       
      #3
        nirvana

        • Total Posts : 16
        • Scores: 4
        • Reward points : 0
        • Joined: 3/29/2009
        • Status: offline
        Re:Changing Local Admin with PowerShell Saturday, February 12, 2011 11:32 PM (permalink)
        0
        Are all computers in the same OU?
         
        #4

          Online Bookmarks Sharing: Share/Bookmark

          Jump to:

          Current active users

          There are 0 members and 1 guests.

          Icon Legend and Permission

          • New Messages
          • No New Messages
          • Hot Topic w/ New Messages
          • Hot Topic w/o New Messages
          • Locked w/ New Messages
          • Locked w/o New Messages
          • Read Message
          • Post New Thread
          • Reply to message
          • Post New Poll
          • Submit Vote
          • Post reward post
          • Delete my own posts
          • Delete my own threads
          • Rate post

          2000-2012 ASPPlayground.NET Forum Version 3.9