PowerCLI

 View Only
  • 1.  Remove entitlement via powershell

    Posted Aug 29, 2011 05:28 PM

    I just installed PowerCLI v5 and I'm having trouble finding what I need. My goal is to write a Powershell script I can run from my machine, which will take the sAMAccountName of a terminated employee and (among other things) delete their VM entitlement.

    Anyone know how I'd do that? Thanks.



  • 2.  RE: Remove entitlement via powershell

    Posted Aug 31, 2011 09:27 PM

    Hello, mhashemi-

    The short answer:  you would use the Remove-PoolEntitlement cmdlet that comes with the View cmdlets.  That cmdlet takes the pool ID and the AD user's SID (not the handiest, but just adds another step).  You can get that SID from the MS cmdlet Get-User, or the Quest AD cmdlet Get-QADUser.  So, something like:

    Remove-PoolEntitlement -pool_id myPoolId -sid (Get-User -name someUser).sid

    I put more info on the View cmdlets topic in the thread http://communities.vmware.com/message/1815678#1815678.  It has links to some View PowerCLI documentation, among other things (like, those cmdlets are available on the View Connection Server(s) only, currently).

    Enjoy.