Home > Developement, MS: Client OS (XP, Win7) > Remove Users From Local Administrators group On Servers Remotely

Remove Users From Local Administrators group On Servers Remotely


https://gallery.technet.microsoft.com/scriptcenter/Remove-Users-From-Local-bd4abe33

http://powershell.com/cs/media/p/2332.aspx

$List = Import-CSV File.CSV

ForEach($Item in $List)

{ $objUser = [ADSI]("WinNT://domain/$($Item.UserName)")

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

$objGroup.PSBase.Invoke("Remove",$objUser.PSBase.Path)

}

  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: