Pages: [1]
Print
Author Topic: Powershell Script to Remove a console/shell user to all ESX servers in VI  (Read 1570 times)
dma0211
Newbie
*
Posts: 15


View Profile
« on: March 31, 2009, 07:40:39 AM »

You would think is was just Remove-VMHostAccount, almost.

Code:
$VIServer = Read-Host "Please enter a Virtual Center name"

connect-viserver $VIServer


foreach ($hostx in get-vmhost ) {
Connect-VIServer -server $hostx.name
Get-VMHostAccount -ID newuser | Remove-VMHostAccount -Confirm
}
Logged
esarakaitis
Administrator
Sr. Member
*****
Posts: 256


8223109 sack57@hotmail.com littleking57 rootinfortwayne
View Profile WWW Email
« Reply #1 on: March 31, 2009, 07:48:34 AM »

very nice!  one thing i've never had to do.... yet
Logged
Pages: [1]
Print
Jump to: