What is vCheck for Exchange and how should I use it?
vCheck for Exchange is a set of Exchange PowerShell health check scripts that you run daily upon your Exchange 2010 environment; everything that you could think of is already included and then some, with the results being emailed to you. Be aware that vCheck currently has four variants: vSphere, vCD Audit, Exchange 2010 and SCVMM.
- You get vCheck-Exchange from here: Virtu-al.net’s vCheck for Exchange.
- Unzip the vCheck-Exchange package to your PowerShell scripts directory on your Exchange CAS, HUB or Mail server.
- Make sure that the service account you use has Exchange Administrator Read privileges.
- Open PowerCLI and change directory to vCheck-Exchange-master.
- You configure vCheck by typing “.\vCheck.ps1 -config” and answering the prompts.
- To disable vCheck plugins, just type “.\vCheck-Plugins.ps1” and disable the modules you are not interested in.
- Execute the script manually by typing “.\vCheck.ps1” and wait for the script to execute, check for any error messages that may need to be resolved and verify you get the vCheck report emailed to you.
- Now you can create a daily task in Task Scheduler (procedure described above).
How do I Run a PowerShell Script Automatically?
This is the real magic of PowerCLI, using sophisticated scripts with program logic to perform scheduled tasks within vCenter:
- You have manually executed the script and tested that it works.
- Go to the Administration Tools folder and execute “Task Scheduler”.
- Select the “Task Scheduler Library” and you will see the existing tasks.
- Select “Create Task”.
- Select the “General” tab and enter the “Name” of the task.
- Select “Run whether the user is logged in or not”.
- Select “Run with highest privileges”.
- Select “Change User or Group” and enter the PowerCLI service account name and password. Select “OK”.
- Select the “Trigger” tab and configure the schedule (eg. hourly, daily, weekly, monthly, yearly). Then press “OK”.
- Select the “Action” tab and press “New”.
- Set the “Action” to “Start a program”.
- For “Program/script”, press “Browse” and select “powershell.exe” in the “C:\Windows\System32\WindowsPowerShell\v1.0\” directory.
- In the “Add arguments (optional)” field, enter the PowerShell script path, eg. “E:\vCheck-Exchange-master\vCheck.ps1”. Press “OK”.
- Select the “Conditions” tab and deselect “Start the task only if the computer is on AC power”. Press “OK”.
- Select the “Settings” tab and select “Allow this task to be run on demand”.
- Select “Stop this task if it runs longer than” and set the period slightly longer than it takes to execute.
- Select “If the running task does not end when requested, force it to stop”.
- For “If the task is already running, then the following rule applies” select “Do not start a new instance”.
- Press “OK” to complete the configuration of the new task.
- Select the new task from the “Task Scheduler Library” and right mouse click and press “Run”. Verify that the task executes correctly.
- The PowerShell script will now execute automatically on the defined schedule.
- Be mindful of updating your operational procedures to reflect this automated task.