Emailing vCloud Organization Users

June 11, 2013

Table of Contents

Due to a lot of requests I found necessary to show you guys who might be having a problem using the “notify users” function in the vCloud Director web UI through the vCloud API. Even though the functionality is not in the API , PowerCLI and Powershell make work easier with the vCloud snap-in and powershell’s send-MailMessage cmdlet.

This example is sending an email to all Org users reminding them of the number of VMs they have in particular organization. The good thing about this code it can be adapted to show; resource usage, IP addresses OS usage. It also has the ability to be used in either a system admin role or an organization admin role:

$mailServer = “mail.example.com”

$users = Get-CIUser # use -Org “OrgName” if connected to system Org

$VApps = Get-CIVApp # use -Org “OrgName” if connected to system Org

foreach ($user in $users)

{

 $counter = 0

 $ownerVApps = $VApps | where {$_.owner -eq $user}

 $vapps | ForEach-Object {$counter += $_.extensiondata.children.vm.count}

$mailbody = “Greetings, You currently have $counter virtual machines in Organization: $($user.Org)”

Send-MailMessage -SmtpServer $mailServer -To $user.email -From “[email protected]” -Body $mailbody

}

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.

VMware vCenter Server 5.1 Update 2

There are some new features in the new VMware released some days back a vCenter Server 5.1 update 2 build 1473063. This update enables the customization for windows 8.1, windows

Windows Update Cleanup Plugin

Here is some good news for windows 7 SP1 users and maybe for VDI admins running windows 7 desktops in their VDI environments. Windows update cleanup plugin allows to uninstall

Physical Memory Limits for Windows Releases

Physical Memory Limits: Windows 7 The following table specifies the limits on physical memory for Windows 7. Version Limit on X86 Limit on X64 Windows 7 Ultimate 4 GB 192 GB Windows 7 Enterprise

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