This article describes a means by which vCommander administrators can generate quota reporting for organizations, via the REST API.
This solution can be run on an ad-hoc basis, but the procedure below describes scheduling it to run on a daily basis using Windows Task Scheduler. The output file is generated with a date appended to the file name.
- vCommander Script
- PowerShell v4 installed on the vCommander application server
- Embotics® vCommander® 5.7.6 or later
- Embotics® vCommander® REST API PowerShell libraries (client 2.7 or later)
- Encrypted vCommander Credentials
Preparing the Script
- Download the script and extract to a location on the vCommander server. In this example, we use c:\scripts\quota\.
- Edit the file c:\scripts\quota\export_org_usage.ps1 as follows:
on line 10, enter the fully qualified domain name or IP address between the quotes.
on line 11, enter the full path to your encrypted credentials file between the quotes
on line 12, enter the full path to the directory where the output file should be created.
- Save the file.
Creating the Scheduled Task
- Login to the vCommander application server as a Windows administrator and launch Task Scheduler.
- In the Actions pane, click Create Basic Task.
- Provide a Name and Description. Click Next.
- Choose the Trigger. Click Next.
- Set additional scheduling options.
- Choose Start a program as your action. Click Next.
- Configure the next page as follows, then click Next:
Program/script: Click Browse... to locate the PowerShell executable.
Add arguments: & 'c:\scripts\quota\export_org_usage.ps1'
- Click Finish.
The csv file will be created on the schedule you set in the location you specified each day following, until the schedule is changed.