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.

vCheck6 Utility Commands

There is a new release of the vCheck6 and those with need for more info they can visit the vCheck 6 release page and ensure to visit the vCheck plugins

Managing Amazon EC2 VMs from the vSphere client

Automation and mulitplatformsupport is gaining more and more popularity. We already a multihypervisor management tool from VMware for Hyper-V and VMware. From vCloud Automation Center you can create workloads in

VMware trademark guide

VMware trademark guide a very important resource for bloggers, technical writer .VMware employees and partners who have less interest in blogs .the guide is intended to provide guidance regarding the

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

🎉 New Year’s Special🎉
50% OFF for Life!

🔥 DELL Bare-metal Dedicated Server in New York

🔹  Intel Gold 80 Cores
🔹  23TB SSD Flash +
🔹1TB NVMe (W RAID)
🔹 1TB DDR4 RAM 
🔹 10Gbps Redundant Uplinks 
🔹 10 IPv4 + IPv6 Addresses Included 

💲 Just $699/month – 50% OFF FOR LIFE! (Reg $1399/month)
🚀 Zero Setup Costs | Flexible OS: Ubuntu, Proxmox, ESXi, Windows, etc.

✅ Reserve Risk-Free! 30-Day Money-Back Guarantee
💡 100% Uptime Assurance – Enterprise-Grade Hardware 

🖥 Ideal for Virtualization, Data-Intensive Apps, & High Traffic Sites

Use coupon code at checkout for the discount to apply FBHEO3023EJFB
⚡ Limited Availability – Don’t Miss Out!

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