Sharing vApps in vCloud with PowerCLI

June 11, 2013

Table of Contents

Some times vCloud Directors give the organization users grainy control over the the level of access users have to vApps , this is all controlled through the the vCloud API and powerCLI. The code below takes vApps‘ current settings and allow the user to modify the vApp:

# Get our required Objects

$vapp = Get-CIVApp “My vApp”

$user = Get-CIUser “UserToBeAdded”

# Access Level can be one of: ReadOnly,Change,FullControl

$accessLevel = “Change”

# Get current access policy from vApp

$access = $vapp.ExtensionData.GetControlAccess()

if (!$access.AccessSettings)

{

 $access.AccessSettings = New-Object VMware.VimAutomation.Cloud.Views.AccessSettings

}

# New Access object

$newAccess = new-object VMware.VimAutomation.Cloud.Views.AccessSetting

$newAccess.Subject = New-Object VMware.VimAutomation.Cloud.Views.Reference

# Set our access level

$newAccess.AccessLevel = $accessLevel

# Insert user href

$newAccess.Subject.Href = $user.ExtensionData.Href

$newAccess.Subject.Type = “application/vnd.vmware.admin.user+xml”

# Add new access to vApp access settings object

$access.AccessSettings.AccessSetting += $newAccess

#Send new Access config

$vapp.ExtensionData.ControlAccess($access)

A user is also able to control the default access policyand the level-using:

$access.IsSharedToEveryone and $access

Home

Share on
Facebook
Twitter
LinkedIn
Pinterest
More posts

Dedicated Servers Quick Guide

What is a Dedicated Servers? Why bother using a dedicated server over a VPS or Shared Hosting?A dedicated server is a server 100% dedicated to your website/project or business needs.

Fast Easy Manual cPanel Install

Installation Guide – cPanel Install Use operating system Centos 64bit with 4GB Ram and at least 50GB Disk. Login to your server using SSH and using port 22 user: root

RVTools 3.3 Now Available

Good news: RVTools 3.3 from Rob de Veij is now generally available to the public.  Release notes for this build: GetWebResponse time-out value changed from 5 minutes to 10 minutes

Hacking the vCloud Director browser support warning

I came upon this article where some guy was explaining how to Hacking the vCloud Director to work on other browsers like chrome. So when he ran this: Invoke-RestMethod “https://vcloud.example.com/cloud/org/jake”

vMA 5.1 Patch 1 Released

Expendable news item here too good not to be posted.  For those who may have missed it, VMware has released an update to the vSphere Management Assistant (vMA) 5.1 appliances

Understand How DNS servers work!

Many of use wonder how DNS works, quite frankly it needs a bit of an understanding the background process of a DNS Query to have the overall idea of the

Get 90% Discount

First 3 People gets the Bonus!
Don't Miss Out Our Big Sale

Get 0-90% On All
247Rack Services

247Rack

The Sale Is Until The End Of March