Created
November 9, 2015 13:17
-
-
Save istairbn/5f9892143e6f6f5fec27 to your computer and use it in GitHub Desktop.
HPC Server 2012 Powershell that collects all the Cluster Information and exports it to JSON
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#------------------------------------------------------------------------------ | |
#Script: Get-HPCData.ps1 | |
#Author: Benjamin Newton - Excelian | |
#Version 1.0.0 | |
#Keywords: HPC,Environment Management | |
#------------------------------------------------------------------------------- | |
<# | |
.Synopsis | |
This script | |
.Parameter Scheduler | |
Controls which scheduler is used. Assumes the default | |
.Parameter Destination | |
Where the JSON Output should be sent. Defaults to local file | |
.Parameter FetchServices | |
If True, will fetch service names as well. If false, will not. | |
.Parameter ServiceConfigLocation | |
If collecting the Services, the Service location on the scheduler. Set to the default. | |
.Example | |
.\Get-HPCData.ps1 -Scheduler HOSTNAME -Destination D:\MyDirectory\MyGrid\ClusterSettings.txt -FetchServices $True | |
.Notes | |
The prerequisite for running this script is the Microsoft HPC Server 2012 Client Utilities - It needs the Powershell Commands | |
.Link | |
www.excelian.com | |
#> | |
Param( | |
[CmdletBinding()] | |
[Parameter (Mandatory=$False)] | |
[string[]] | |
$Scheduler=$Env:CCP_SCHEDULER, | |
[Parameter (Mandatory=$False)] | |
[string] | |
$Destination=".\HPCClusterElements.txt", | |
[Parameter (Mandatory=$False)] | |
[bool] | |
$FetchServices=$True, | |
[Parameter (Mandatory=$False)] | |
[string] | |
$ServiceConfigLocation="HpcServiceRegistration" | |
) | |
Add-PSSnapin Microsoft.Hpc | |
Import-Module -name .\HPCServer_AutoScaleTools.psm1 -Force | |
Get-HPCClusterElements -Logging $False -Scheduler $Scheduler -FetchServices $FetchServices -ServiceConfigLocation $ServiceConfigLocation | ConvertTo-JSON | Out-File -FilePath $Destination |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment