Add domain users to an local group on a remote pc

A simple script, but very handy!

 Any comments or questions are welcomeBig Smile

PS. Fill in your own domain!

Anonymous
Parents
No Data
Comment
  • in case you want to know whose already in there...

    Function Get-LocalAdmin {

    param(

       # computer name or IP

       $ComputerName

       )

    $objGroup = [ADSI]("WinNT://$ComputerName/Administrators")  

    $members = ( $objGroup.psbase.invoke(”Members”) | %{$_.GetType().InvokeMember(”Adspath”, ‘GetProperty’, $null, $_, $null)} ).TrimStart("WinNT://")

    $members

    }

Children
No Data