Initial Release
This commit is contained in:
Родитель
5e128100c1
Коммит
3b9950e173
|
@ -0,0 +1,933 @@
|
|||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
# See LICENSE.txt in the project root for license information.
|
||||
<#
|
||||
.SYNOPSIS
|
||||
manage Infrastructure
|
||||
#>
|
||||
|
||||
Function get-AzureStackAlert{
|
||||
|
||||
[CmdletBinding(DefaultParameterSetName='GetAlert')]
|
||||
Param(
|
||||
|
||||
[Parameter(Mandatory=$true, ParameterSetName='GetAlert')]
|
||||
[ValidateNotNullorEmpty()]
|
||||
[String] $TenantId,
|
||||
|
||||
|
||||
[Parameter(Mandatory=$true, ParameterSetName='GetAlert')]
|
||||
[ValidateNotNullorEmpty()]
|
||||
[System.Management.Automation.PSCredential] $azureStackCredentials,
|
||||
|
||||
|
||||
[Parameter(ParameterSetName='GetAlert')]
|
||||
[string] $azureStackDomain = 'azurestack.local',
|
||||
|
||||
[Parameter(ParameterSetName='GetAlert')]
|
||||
[string] $region = 'local'
|
||||
|
||||
|
||||
|
||||
)
|
||||
|
||||
|
||||
|
||||
$endpoints = (Invoke-RestMethod -Uri https://api.$azureStackDomain/metadata/endpoints?api-version=1.0 -Method Get)
|
||||
$activeDirectoryServiceEndpointResourceId = $endpoints.authentication.audiences[0]
|
||||
$galleryEndpoint = $endpoints.galleryEndpoint
|
||||
$graphEndpoint = $endpoints.graphEndpoint
|
||||
$loginEndpoint = $endpoints.authentication.loginEndpoint
|
||||
$authority = $loginEndpoint + $tenantID + "/"
|
||||
|
||||
Add-AzureRmEnvironment -Name 'Azure Stack' -ActiveDirectoryEndpoint $authority -ActiveDirectoryServiceEndpointResourceId $activeDirectoryServiceEndpointResourceId -ResourceManagerEndpoint "https://api.$azureStackDomain/" -GalleryEndpoint $galleryEndpoint -GraphEndpoint $graphEndpoint |Out-Null
|
||||
|
||||
|
||||
$environment = Get-AzureRmEnvironment 'Azure Stack'
|
||||
|
||||
$profile = Add-AzureRmAccount -Environment $environment -Credential $azureStackCredentials
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$powershellClientId = "0a7bdc5c-7b57-40be-9939-d4c5fc7cd417"
|
||||
|
||||
$adminToken = Get-AzureStackToken -WarningAction Ignore `
|
||||
-Authority $authority `
|
||||
-Resource $activeDirectoryServiceEndpointResourceId `
|
||||
-AadTenantId $tenantID `
|
||||
-ClientId $powershellClientId `
|
||||
-Credential $azureStackCredentials
|
||||
|
||||
|
||||
$armEndpoint = 'https://api.' + $azureStackDomain
|
||||
$adminSubscription = Get-AzureRMTenantSubscription -AdminUri $ArmEndPoint -Token $admintoken -WarningAction Ignore
|
||||
$subscription = $adminSubscription.SubscriptionId
|
||||
|
||||
$headers = @{ Authorization = ("Bearer $adminToken") }
|
||||
|
||||
|
||||
$URI= "${ArmEndpoint}/subscriptions/${subscription}/resourceGroups/system/providers/Microsoft.InfrastructureInsights.Admin/regionHealths/$region/Alerts?api-version=2016-05-01"
|
||||
$Alert=Invoke-RestMethod -Method GET -Uri $uri -ContentType 'application/json' -Headers $Headers
|
||||
$Alerts=$Alert.value
|
||||
$Alertsprop=$alerts.properties
|
||||
$alertsprop |select alertid,state,title,resourcename,createdtimestamp,remediation |fl
|
||||
|
||||
}
|
||||
|
||||
Function get-AzureStackScaleUnit{
|
||||
|
||||
[CmdletBinding(DefaultParameterSetName='ScaleUnit')]
|
||||
Param(
|
||||
|
||||
[Parameter(Mandatory=$true, ParameterSetName='ScaleUnit')]
|
||||
[ValidateNotNullorEmpty()]
|
||||
[String] $TenantId,
|
||||
|
||||
|
||||
[Parameter(Mandatory=$true, ParameterSetName='ScaleUnit')]
|
||||
[ValidateNotNullorEmpty()]
|
||||
[System.Management.Automation.PSCredential] $azureStackCredentials,
|
||||
|
||||
|
||||
[Parameter(ParameterSetName='ScaleUnit')]
|
||||
[string] $azureStackDomain = 'azurestack.local',
|
||||
|
||||
[Parameter(ParameterSetName='ScaleUnit')]
|
||||
[string] $region = 'local'
|
||||
|
||||
|
||||
)
|
||||
|
||||
|
||||
|
||||
$endpoints = (Invoke-RestMethod -Uri https://api.$azureStackDomain/metadata/endpoints?api-version=1.0 -Method Get)
|
||||
$activeDirectoryServiceEndpointResourceId = $endpoints.authentication.audiences[0]
|
||||
$galleryEndpoint = $endpoints.galleryEndpoint
|
||||
$graphEndpoint = $endpoints.graphEndpoint
|
||||
$loginEndpoint = $endpoints.authentication.loginEndpoint
|
||||
$authority = $loginEndpoint + $tenantID + "/"
|
||||
|
||||
Add-AzureRmEnvironment -Name 'Azure Stack' -ActiveDirectoryEndpoint $authority -ActiveDirectoryServiceEndpointResourceId $activeDirectoryServiceEndpointResourceId -ResourceManagerEndpoint "https://api.$azureStackDomain/" -GalleryEndpoint $galleryEndpoint -GraphEndpoint $graphEndpoint |Out-Null
|
||||
|
||||
|
||||
$environment = Get-AzureRmEnvironment 'Azure Stack'
|
||||
|
||||
$profile = Add-AzureRmAccount -Environment $environment -Credential $azureStackCredentials
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$powershellClientId = "0a7bdc5c-7b57-40be-9939-d4c5fc7cd417"
|
||||
|
||||
$adminToken = Get-AzureStackToken -WarningAction Ignore `
|
||||
-Authority $authority `
|
||||
-Resource $activeDirectoryServiceEndpointResourceId `
|
||||
-AadTenantId $tenantID `
|
||||
-ClientId $powershellClientId `
|
||||
-Credential $azureStackCredentials
|
||||
|
||||
|
||||
$armEndpoint = 'https://api.' + $azureStackDomain
|
||||
$adminSubscription = Get-AzureRMTenantSubscription -AdminUri $ArmEndPoint -Token $admintoken -WarningAction Ignore
|
||||
$subscription = $adminSubscription.SubscriptionId
|
||||
|
||||
$headers = @{ Authorization = ("Bearer $adminToken") }
|
||||
|
||||
|
||||
$URI= "${ArmEndpoint}/subscriptions/${subscription}/resourceGroups/system/providers/Microsoft.Fabric.Admin/fabricLocations/$region/clusters?api-version=2016-05-01"
|
||||
$Cluster=Invoke-RestMethod -Method GET -Uri $uri -ContentType 'application/json' -Headers $Headers
|
||||
$Cluster.value |select name,location |fl
|
||||
|
||||
}
|
||||
|
||||
Function get-AzureStackNode{
|
||||
|
||||
[CmdletBinding(DefaultParameterSetName='GetNode')]
|
||||
Param(
|
||||
|
||||
[Parameter(Mandatory=$true, ParameterSetName='GetNode')]
|
||||
[ValidateNotNullorEmpty()]
|
||||
[String] $TenantId,
|
||||
|
||||
|
||||
[Parameter(Mandatory=$true, ParameterSetName='GetNode')]
|
||||
[ValidateNotNullorEmpty()]
|
||||
[System.Management.Automation.PSCredential] $azureStackCredentials,
|
||||
|
||||
|
||||
[Parameter(ParameterSetName='GetNode')]
|
||||
[string] $azureStackDomain = 'azurestack.local',
|
||||
|
||||
[Parameter(ParameterSetName='GetNode')]
|
||||
[string] $region = 'local'
|
||||
|
||||
|
||||
)
|
||||
|
||||
|
||||
|
||||
$endpoints = (Invoke-RestMethod -Uri https://api.$azureStackDomain/metadata/endpoints?api-version=1.0 -Method Get)
|
||||
$activeDirectoryServiceEndpointResourceId = $endpoints.authentication.audiences[0]
|
||||
$galleryEndpoint = $endpoints.galleryEndpoint
|
||||
$graphEndpoint = $endpoints.graphEndpoint
|
||||
$loginEndpoint = $endpoints.authentication.loginEndpoint
|
||||
$authority = $loginEndpoint + $tenantID + "/"
|
||||
|
||||
Add-AzureRmEnvironment -Name 'Azure Stack' -ActiveDirectoryEndpoint $authority -ActiveDirectoryServiceEndpointResourceId $activeDirectoryServiceEndpointResourceId -ResourceManagerEndpoint "https://api.$azureStackDomain/" -GalleryEndpoint $galleryEndpoint -GraphEndpoint $graphEndpoint |Out-Null
|
||||
|
||||
|
||||
$environment = Get-AzureRmEnvironment 'Azure Stack'
|
||||
|
||||
$profile = Add-AzureRmAccount -Environment $environment -Credential $azureStackCredentials
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$powershellClientId = "0a7bdc5c-7b57-40be-9939-d4c5fc7cd417"
|
||||
|
||||
$adminToken = Get-AzureStackToken -WarningAction Ignore `
|
||||
-Authority $authority `
|
||||
-Resource $activeDirectoryServiceEndpointResourceId `
|
||||
-AadTenantId $tenantID `
|
||||
-ClientId $powershellClientId `
|
||||
-Credential $azureStackCredentials
|
||||
|
||||
|
||||
$armEndpoint = 'https://api.' + $azureStackDomain
|
||||
$adminSubscription = Get-AzureRMTenantSubscription -AdminUri $ArmEndPoint -Token $admintoken -WarningAction Ignore
|
||||
$subscription = $adminSubscription.SubscriptionId
|
||||
|
||||
$headers = @{ Authorization = ("Bearer $adminToken") }
|
||||
|
||||
|
||||
$URI= "${ArmEndpoint}/subscriptions/${subscription}/resourceGroups/system/providers/Microsoft.Fabric.Admin/fabricLocations/$region/clusters?api-version=2016-05-01"
|
||||
$Cluster=Invoke-RestMethod -Method GET -Uri $uri -ContentType 'application/json' -Headers $Headers
|
||||
$Clusterprop=$cluster.value
$clusterprop.properties|select servers|fl
|
||||
|
||||
}
|
||||
|
||||
Function get-AzureStackStorageCapacity{
|
||||
|
||||
[CmdletBinding(DefaultParameterSetName='GetStorageCapacity')]
|
||||
Param(
|
||||
|
||||
[Parameter(Mandatory=$true, ParameterSetName='GetStorageCapacity')]
|
||||
[ValidateNotNullorEmpty()]
|
||||
[String] $TenantId,
|
||||
|
||||
|
||||
[Parameter(Mandatory=$true, ParameterSetName='GetStorageCapacity')]
|
||||
[ValidateNotNullorEmpty()]
|
||||
[System.Management.Automation.PSCredential] $azureStackCredentials,
|
||||
|
||||
|
||||
[Parameter(ParameterSetName='GetStorageCapacity')]
|
||||
[string] $azureStackDomain = 'azurestack.local',
|
||||
|
||||
[Parameter(ParameterSetName='GetStorageCapacity')]
|
||||
[string] $region = 'local'
|
||||
|
||||
|
||||
)
|
||||
|
||||
|
||||
|
||||
$endpoints = (Invoke-RestMethod -Uri https://api.$azureStackDomain/metadata/endpoints?api-version=1.0 -Method Get)
|
||||
$activeDirectoryServiceEndpointResourceId = $endpoints.authentication.audiences[0]
|
||||
$galleryEndpoint = $endpoints.galleryEndpoint
|
||||
$graphEndpoint = $endpoints.graphEndpoint
|
||||
$loginEndpoint = $endpoints.authentication.loginEndpoint
|
||||
$authority = $loginEndpoint + $tenantID + "/"
|
||||
|
||||
Add-AzureRmEnvironment -Name 'Azure Stack' -ActiveDirectoryEndpoint $authority -ActiveDirectoryServiceEndpointResourceId $activeDirectoryServiceEndpointResourceId -ResourceManagerEndpoint "https://api.$azureStackDomain/" -GalleryEndpoint $galleryEndpoint -GraphEndpoint $graphEndpoint |Out-Null
|
||||
|
||||
|
||||
$environment = Get-AzureRmEnvironment 'Azure Stack'
|
||||
|
||||
$profile = Add-AzureRmAccount -Environment $environment -Credential $azureStackCredentials
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$powershellClientId = "0a7bdc5c-7b57-40be-9939-d4c5fc7cd417"
|
||||
|
||||
$adminToken = Get-AzureStackToken -WarningAction Ignore `
|
||||
-Authority $authority `
|
||||
-Resource $activeDirectoryServiceEndpointResourceId `
|
||||
-AadTenantId $tenantID `
|
||||
-ClientId $powershellClientId `
|
||||
-Credential $azureStackCredentials
|
||||
|
||||
|
||||
$armEndpoint = 'https://api.' + $azureStackDomain
|
||||
$adminSubscription = Get-AzureRMTenantSubscription -AdminUri $ArmEndPoint -Token $admintoken -WarningAction Ignore
|
||||
$subscription = $adminSubscription.SubscriptionId
|
||||
|
||||
$headers = @{ Authorization = ("Bearer $adminToken") }
|
||||
|
||||
|
||||
$URI= "${ArmEndpoint}/subscriptions/${subscription}/resourceGroups/system/providers/Microsoft.Fabric.Admin/fabricLocations/$region/storagesubSystems?api-version=2016-05-01"
|
||||
$Storage=Invoke-RestMethod -Method GET -Uri $uri -ContentType 'application/json' -Headers $Headers
|
||||
$Storageprop=$storage.value
$storageprop.properties|select totalcapacityGB|fl
|
||||
|
||||
}
|
||||
|
||||
Function get-AzureStackInfraRole{
|
||||
|
||||
[CmdletBinding(DefaultParameterSetName='GetInfraRole')]
|
||||
Param(
|
||||
|
||||
[Parameter(Mandatory=$true, ParameterSetName='GetInfraRole')]
|
||||
[ValidateNotNullorEmpty()]
|
||||
[String] $TenantId,
|
||||
|
||||
|
||||
[Parameter(Mandatory=$true, ParameterSetName='GetInfraRole')]
|
||||
[ValidateNotNullorEmpty()]
|
||||
[System.Management.Automation.PSCredential] $azureStackCredentials,
|
||||
|
||||
|
||||
[Parameter(ParameterSetName='GetInfraRole')]
|
||||
[string] $azureStackDomain = 'azurestack.local',
|
||||
|
||||
[Parameter(ParameterSetName='GetInfraRole')]
|
||||
[string] $region = 'local'
|
||||
|
||||
|
||||
)
|
||||
|
||||
|
||||
|
||||
$endpoints = (Invoke-RestMethod -Uri https://api.$azureStackDomain/metadata/endpoints?api-version=1.0 -Method Get)
|
||||
$activeDirectoryServiceEndpointResourceId = $endpoints.authentication.audiences[0]
|
||||
$galleryEndpoint = $endpoints.galleryEndpoint
|
||||
$graphEndpoint = $endpoints.graphEndpoint
|
||||
$loginEndpoint = $endpoints.authentication.loginEndpoint
|
||||
$authority = $loginEndpoint + $tenantID + "/"
|
||||
|
||||
Add-AzureRmEnvironment -Name 'Azure Stack' -ActiveDirectoryEndpoint $authority -ActiveDirectoryServiceEndpointResourceId $activeDirectoryServiceEndpointResourceId -ResourceManagerEndpoint "https://api.$azureStackDomain/" -GalleryEndpoint $galleryEndpoint -GraphEndpoint $graphEndpoint |Out-Null
|
||||
|
||||
|
||||
$environment = Get-AzureRmEnvironment 'Azure Stack'
|
||||
|
||||
$profile = Add-AzureRmAccount -Environment $environment -Credential $azureStackCredentials
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$powershellClientId = "0a7bdc5c-7b57-40be-9939-d4c5fc7cd417"
|
||||
|
||||
$adminToken = Get-AzureStackToken -WarningAction Ignore `
|
||||
-Authority $authority `
|
||||
-Resource $activeDirectoryServiceEndpointResourceId `
|
||||
-AadTenantId $tenantID `
|
||||
-ClientId $powershellClientId `
|
||||
-Credential $azureStackCredentials
|
||||
|
||||
|
||||
$armEndpoint = 'https://api.' + $azureStackDomain
|
||||
$adminSubscription = Get-AzureRMTenantSubscription -AdminUri $ArmEndPoint -Token $admintoken -WarningAction Ignore
|
||||
$subscription = $adminSubscription.SubscriptionId
|
||||
|
||||
$headers = @{ Authorization = ("Bearer $adminToken") }
|
||||
|
||||
|
||||
$URI= "${ArmEndpoint}/subscriptions/${subscription}/resourceGroups/system/providers/Microsoft.Fabric.Admin/fabricLocations/$region/applications?api-version=2016-05-01"
|
||||
$Roles=Invoke-RestMethod -Method GET -Uri $uri -ContentType 'application/json' -Headers $Headers
|
||||
$Roleprop=$roles.value
$Roleprop.Name|fl
|
||||
|
||||
}
|
||||
|
||||
Function get-AzureStackInfraVM{
|
||||
|
||||
[CmdletBinding(DefaultParameterSetName='GetInfraVM')]
|
||||
Param(
|
||||
|
||||
[Parameter(Mandatory=$true, ParameterSetName='GetInfraVM')]
|
||||
[ValidateNotNullorEmpty()]
|
||||
[String] $TenantId,
|
||||
|
||||
|
||||
[Parameter(Mandatory=$true, ParameterSetName='GetInfraVM')]
|
||||
[ValidateNotNullorEmpty()]
|
||||
[System.Management.Automation.PSCredential] $azureStackCredentials,
|
||||
|
||||
|
||||
[Parameter(ParameterSetName='GetInfraVM')]
|
||||
[string] $azureStackDomain = 'azurestack.local',
|
||||
|
||||
[Parameter(ParameterSetName='GetInfraVM')]
|
||||
[string] $region = 'local'
|
||||
|
||||
|
||||
)
|
||||
|
||||
|
||||
|
||||
$endpoints = (Invoke-RestMethod -Uri https://api.$azureStackDomain/metadata/endpoints?api-version=1.0 -Method Get)
|
||||
$activeDirectoryServiceEndpointResourceId = $endpoints.authentication.audiences[0]
|
||||
$galleryEndpoint = $endpoints.galleryEndpoint
|
||||
$graphEndpoint = $endpoints.graphEndpoint
|
||||
$loginEndpoint = $endpoints.authentication.loginEndpoint
|
||||
$authority = $loginEndpoint + $tenantID + "/"
|
||||
|
||||
Add-AzureRmEnvironment -Name 'Azure Stack' -ActiveDirectoryEndpoint $authority -ActiveDirectoryServiceEndpointResourceId $activeDirectoryServiceEndpointResourceId -ResourceManagerEndpoint "https://api.$azureStackDomain/" -GalleryEndpoint $galleryEndpoint -GraphEndpoint $graphEndpoint |Out-Null
|
||||
|
||||
|
||||
$environment = Get-AzureRmEnvironment 'Azure Stack'
|
||||
|
||||
$profile = Add-AzureRmAccount -Environment $environment -Credential $azureStackCredentials
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$powershellClientId = "0a7bdc5c-7b57-40be-9939-d4c5fc7cd417"
|
||||
|
||||
$adminToken = Get-AzureStackToken -WarningAction Ignore `
|
||||
-Authority $authority `
|
||||
-Resource $activeDirectoryServiceEndpointResourceId `
|
||||
-AadTenantId $tenantID `
|
||||
-ClientId $powershellClientId `
|
||||
-Credential $azureStackCredentials
|
||||
|
||||
|
||||
$armEndpoint = 'https://api.' + $azureStackDomain
|
||||
$adminSubscription = Get-AzureRMTenantSubscription -AdminUri $ArmEndPoint -Token $admintoken -WarningAction Ignore
|
||||
$subscription = $adminSubscription.SubscriptionId
|
||||
|
||||
$headers = @{ Authorization = ("Bearer $adminToken") }
|
||||
|
||||
|
||||
$URI= "${ArmEndpoint}/subscriptions/${subscription}/resourceGroups/system/providers/Microsoft.Fabric.Admin/fabricLocations/$region/infraVirtualMachines?api-version=2016-05-01"
|
||||
$VMs=Invoke-RestMethod -Method GET -Uri $uri -ContentType 'application/json' -Headers $Headers
|
||||
$VMprop=$VMs.value
$VMprop|ft name
|
||||
|
||||
}
|
||||
|
||||
Function get-AzureStackStorageShare{
|
||||
|
||||
[CmdletBinding(DefaultParameterSetName='GetShare')]
|
||||
Param(
|
||||
|
||||
[Parameter(Mandatory=$true, ParameterSetName='GetShare')]
|
||||
[ValidateNotNullorEmpty()]
|
||||
[String] $TenantId,
|
||||
|
||||
|
||||
[Parameter(Mandatory=$true, ParameterSetName='GetShare')]
|
||||
[ValidateNotNullorEmpty()]
|
||||
[System.Management.Automation.PSCredential] $azureStackCredentials,
|
||||
|
||||
|
||||
[Parameter(ParameterSetName='GetShare')]
|
||||
[string] $azureStackDomain = 'azurestack.local',
|
||||
|
||||
[Parameter(ParameterSetName='GetShare')]
|
||||
[string] $region = 'local'
|
||||
|
||||
|
||||
)
|
||||
|
||||
|
||||
|
||||
$endpoints = (Invoke-RestMethod -Uri https://api.$azureStackDomain/metadata/endpoints?api-version=1.0 -Method Get)
|
||||
$activeDirectoryServiceEndpointResourceId = $endpoints.authentication.audiences[0]
|
||||
$galleryEndpoint = $endpoints.galleryEndpoint
|
||||
$graphEndpoint = $endpoints.graphEndpoint
|
||||
$loginEndpoint = $endpoints.authentication.loginEndpoint
|
||||
$authority = $loginEndpoint + $tenantID + "/"
|
||||
|
||||
Add-AzureRmEnvironment -Name 'Azure Stack' -ActiveDirectoryEndpoint $authority -ActiveDirectoryServiceEndpointResourceId $activeDirectoryServiceEndpointResourceId -ResourceManagerEndpoint "https://api.$azureStackDomain/" -GalleryEndpoint $galleryEndpoint -GraphEndpoint $graphEndpoint |Out-Null
|
||||
|
||||
|
||||
$environment = Get-AzureRmEnvironment 'Azure Stack'
|
||||
|
||||
$profile = Add-AzureRmAccount -Environment $environment -Credential $azureStackCredentials
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$powershellClientId = "0a7bdc5c-7b57-40be-9939-d4c5fc7cd417"
|
||||
|
||||
$adminToken = Get-AzureStackToken -WarningAction Ignore `
|
||||
-Authority $authority `
|
||||
-Resource $activeDirectoryServiceEndpointResourceId `
|
||||
-AadTenantId $tenantID `
|
||||
-ClientId $powershellClientId `
|
||||
-Credential $azureStackCredentials
|
||||
|
||||
|
||||
$armEndpoint = 'https://api.' + $azureStackDomain
|
||||
$adminSubscription = Get-AzureRMTenantSubscription -AdminUri $ArmEndPoint -Token $admintoken -WarningAction Ignore
|
||||
$subscription = $adminSubscription.SubscriptionId
|
||||
|
||||
$headers = @{ Authorization = ("Bearer $adminToken") }
|
||||
|
||||
|
||||
$URI= "${ArmEndpoint}/subscriptions/${subscription}/resourceGroups/system/providers/Microsoft.Fabric.Admin/fabricLocations/$region/fileShares?api-version=2016-05-01"
|
||||
$Shares=Invoke-RestMethod -Method GET -Uri $uri -ContentType 'application/json' -Headers $Headers
|
||||
$Shareprop=$Shares.value
$Shareprop.properties|select uncPath|fl
|
||||
|
||||
}
|
||||
|
||||
Function get-AzureStacklogicalnetwork{
|
||||
|
||||
[CmdletBinding(DefaultParameterSetName='Getlogicalnetwork')]
|
||||
Param(
|
||||
|
||||
[Parameter(Mandatory=$true, ParameterSetName='Getlogicalnetwork')]
|
||||
[ValidateNotNullorEmpty()]
|
||||
[String] $TenantId,
|
||||
|
||||
|
||||
[Parameter(Mandatory=$true, ParameterSetName='Getlogicalnetwork')]
|
||||
[ValidateNotNullorEmpty()]
|
||||
[System.Management.Automation.PSCredential] $azureStackCredentials,
|
||||
|
||||
|
||||
[Parameter(ParameterSetName='Getlogicalnetwork')]
|
||||
[string] $azureStackDomain = 'azurestack.local',
|
||||
|
||||
[Parameter(ParameterSetName='Getlogicalnetwork')]
|
||||
[string] $region = 'local'
|
||||
|
||||
|
||||
)
|
||||
|
||||
|
||||
|
||||
$endpoints = (Invoke-RestMethod -Uri https://api.$azureStackDomain/metadata/endpoints?api-version=1.0 -Method Get)
|
||||
$activeDirectoryServiceEndpointResourceId = $endpoints.authentication.audiences[0]
|
||||
$galleryEndpoint = $endpoints.galleryEndpoint
|
||||
$graphEndpoint = $endpoints.graphEndpoint
|
||||
$loginEndpoint = $endpoints.authentication.loginEndpoint
|
||||
$authority = $loginEndpoint + $tenantID + "/"
|
||||
|
||||
Add-AzureRmEnvironment -Name 'Azure Stack' -ActiveDirectoryEndpoint $authority -ActiveDirectoryServiceEndpointResourceId $activeDirectoryServiceEndpointResourceId -ResourceManagerEndpoint "https://api.$azureStackDomain/" -GalleryEndpoint $galleryEndpoint -GraphEndpoint $graphEndpoint |Out-Null
|
||||
|
||||
|
||||
$environment = Get-AzureRmEnvironment 'Azure Stack'
|
||||
|
||||
$profile = Add-AzureRmAccount -Environment $environment -Credential $azureStackCredentials
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$powershellClientId = "0a7bdc5c-7b57-40be-9939-d4c5fc7cd417"
|
||||
|
||||
$adminToken = Get-AzureStackToken -WarningAction Ignore `
|
||||
-Authority $authority `
|
||||
-Resource $activeDirectoryServiceEndpointResourceId `
|
||||
-AadTenantId $tenantID `
|
||||
-ClientId $powershellClientId `
|
||||
-Credential $azureStackCredentials
|
||||
|
||||
|
||||
$armEndpoint = 'https://api.' + $azureStackDomain
|
||||
$adminSubscription = Get-AzureRMTenantSubscription -AdminUri $ArmEndPoint -Token $admintoken -WarningAction Ignore
|
||||
$subscription = $adminSubscription.SubscriptionId
|
||||
|
||||
$headers = @{ Authorization = ("Bearer $adminToken") }
|
||||
|
||||
|
||||
$URI= "${ArmEndpoint}/subscriptions/${subscription}/resourceGroups/system/providers/Microsoft.Fabric.Admin/fabricLocations/$region/logicalNetworks?api-version=2016-05-01"
|
||||
$LNetworks=Invoke-RestMethod -Method GET -Uri $uri -ContentType 'application/json' -Headers $Headers
|
||||
$LNetworkprop=$LNetworks.value
$LNetworkprop|ft name
|
||||
|
||||
}
|
||||
|
||||
Function get-AzureStackUpdateSummary{
|
||||
|
||||
[CmdletBinding(DefaultParameterSetName='GetUpdateSummary')]
|
||||
Param(
|
||||
|
||||
[Parameter(Mandatory=$true, ParameterSetName='GetUpdateSummary')]
|
||||
[ValidateNotNullorEmpty()]
|
||||
[String] $TenantId,
|
||||
|
||||
|
||||
[Parameter(Mandatory=$true, ParameterSetName='GetUpdateSummary')]
|
||||
[ValidateNotNullorEmpty()]
|
||||
[System.Management.Automation.PSCredential] $azureStackCredentials,
|
||||
|
||||
|
||||
[Parameter(ParameterSetName='GetUpdateSummary')]
|
||||
[string] $azureStackDomain = 'azurestack.local',
|
||||
|
||||
[Parameter(ParameterSetName='GetUpdateSummary')]
|
||||
[string] $region = 'local'
|
||||
|
||||
|
||||
)
|
||||
|
||||
|
||||
|
||||
$endpoints = (Invoke-RestMethod -Uri https://api.$azureStackDomain/metadata/endpoints?api-version=1.0 -Method Get)
|
||||
$activeDirectoryServiceEndpointResourceId = $endpoints.authentication.audiences[0]
|
||||
$galleryEndpoint = $endpoints.galleryEndpoint
|
||||
$graphEndpoint = $endpoints.graphEndpoint
|
||||
$loginEndpoint = $endpoints.authentication.loginEndpoint
|
||||
$authority = $loginEndpoint + $tenantID + "/"
|
||||
|
||||
Add-AzureRmEnvironment -Name 'Azure Stack' -ActiveDirectoryEndpoint $authority -ActiveDirectoryServiceEndpointResourceId $activeDirectoryServiceEndpointResourceId -ResourceManagerEndpoint "https://api.$azureStackDomain/" -GalleryEndpoint $galleryEndpoint -GraphEndpoint $graphEndpoint |Out-Null
|
||||
|
||||
|
||||
$environment = Get-AzureRmEnvironment 'Azure Stack'
|
||||
|
||||
$profile = Add-AzureRmAccount -Environment $environment -Credential $azureStackCredentials
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$powershellClientId = "0a7bdc5c-7b57-40be-9939-d4c5fc7cd417"
|
||||
|
||||
$adminToken = Get-AzureStackToken -WarningAction Ignore `
|
||||
-Authority $authority `
|
||||
-Resource $activeDirectoryServiceEndpointResourceId `
|
||||
-AadTenantId $tenantID `
|
||||
-ClientId $powershellClientId `
|
||||
-Credential $azureStackCredentials
|
||||
|
||||
|
||||
$armEndpoint = 'https://api.' + $azureStackDomain
|
||||
$adminSubscription = Get-AzureRMTenantSubscription -AdminUri $ArmEndPoint -Token $admintoken -WarningAction Ignore
|
||||
$subscription = $adminSubscription.SubscriptionId
|
||||
|
||||
$headers = @{ Authorization = ("Bearer $adminToken") }
|
||||
|
||||
|
||||
$URI= "${ArmEndpoint}/subscriptions/${subscription}/resourceGroups/system/providers/Microsoft.Update.Admin/updatelocations/$region/regionUpdateStatus?api-version=2016-05-01"
|
||||
$USummary=Invoke-RestMethod -Method GET -Uri $uri -ContentType 'application/json' -Headers $Headers
|
||||
$USummaryprop=$USummary.value
$USummaryprop.properties|select locationName,currentversion,lastUpdated,lastChecked,state|fl
|
||||
|
||||
}
|
||||
|
||||
Function get-AzureStackUpdate{
|
||||
|
||||
[CmdletBinding(DefaultParameterSetName='GetUpdate')]
|
||||
Param(
|
||||
|
||||
[Parameter(Mandatory=$true, ParameterSetName='GetUpdate')]
|
||||
[ValidateNotNullorEmpty()]
|
||||
[String] $TenantId,
|
||||
|
||||
|
||||
[Parameter(Mandatory=$true, ParameterSetName='GetUpdate')]
|
||||
[ValidateNotNullorEmpty()]
|
||||
[System.Management.Automation.PSCredential] $azureStackCredentials,
|
||||
|
||||
|
||||
[Parameter(ParameterSetName='GetUpdate')]
|
||||
[string] $azureStackDomain = 'azurestack.local',
|
||||
|
||||
[Parameter(ParameterSetName='GetUpdate')]
|
||||
[string] $region = 'local'
|
||||
|
||||
|
||||
)
|
||||
|
||||
|
||||
|
||||
$endpoints = (Invoke-RestMethod -Uri https://api.$azureStackDomain/metadata/endpoints?api-version=1.0 -Method Get)
|
||||
$activeDirectoryServiceEndpointResourceId = $endpoints.authentication.audiences[0]
|
||||
$galleryEndpoint = $endpoints.galleryEndpoint
|
||||
$graphEndpoint = $endpoints.graphEndpoint
|
||||
$loginEndpoint = $endpoints.authentication.loginEndpoint
|
||||
$authority = $loginEndpoint + $tenantID + "/"
|
||||
|
||||
Add-AzureRmEnvironment -Name 'Azure Stack' -ActiveDirectoryEndpoint $authority -ActiveDirectoryServiceEndpointResourceId $activeDirectoryServiceEndpointResourceId -ResourceManagerEndpoint "https://api.$azureStackDomain/" -GalleryEndpoint $galleryEndpoint -GraphEndpoint $graphEndpoint |Out-Null
|
||||
|
||||
|
||||
|
||||
|
||||
$environment = Get-AzureRmEnvironment 'Azure Stack'
|
||||
|
||||
$profile = Add-AzureRmAccount -Environment $environment -Credential $azureStackCredentials
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$powershellClientId = "0a7bdc5c-7b57-40be-9939-d4c5fc7cd417"
|
||||
|
||||
$adminToken = Get-AzureStackToken -WarningAction Ignore `
|
||||
-Authority $authority `
|
||||
-Resource $activeDirectoryServiceEndpointResourceId `
|
||||
-AadTenantId $tenantID `
|
||||
-ClientId $powershellClientId `
|
||||
-Credential $azureStackCredentials
|
||||
|
||||
|
||||
$armEndpoint = 'https://api.' + $azureStackDomain
|
||||
$adminSubscription = Get-AzureRMTenantSubscription -AdminUri $ArmEndPoint -Token $admintoken -WarningAction Ignore
|
||||
$subscription = $adminSubscription.SubscriptionId
|
||||
|
||||
$headers = @{ Authorization = ("Bearer $adminToken") }
|
||||
|
||||
|
||||
$URI= "${ArmEndpoint}/subscriptions/${subscription}/resourceGroups/system/providers/Microsoft.Update.Admin/updatelocations/$region/updates?api-version=2016-05-01"
|
||||
$Updates=Invoke-RestMethod -Method GET -Uri $uri -ContentType 'application/json' -Headers $Headers
|
||||
$Updateprop=$Updates.value
$Updateprop.properties|select updateName,version,isApplicable,description,state,isDownloaded,packageSizeInMb,kblink|fl
|
||||
|
||||
}
|
||||
|
||||
Function get-AzureStackUpdateRun{
|
||||
|
||||
[CmdletBinding(DefaultParameterSetName='GetUpdateRun')]
|
||||
Param(
|
||||
|
||||
[Parameter(Mandatory=$true, ParameterSetName='GetUpdateRun')]
|
||||
[ValidateNotNullorEmpty()]
|
||||
[String] $TenantId,
|
||||
|
||||
|
||||
[Parameter(Mandatory=$true, ParameterSetName='GetUpdateRun')]
|
||||
[ValidateNotNullorEmpty()]
|
||||
[System.Management.Automation.PSCredential] $azureStackCredentials,
|
||||
|
||||
|
||||
[Parameter(ParameterSetName='GetUpdateRun')]
|
||||
[string] $azureStackDomain = 'azurestack.local',
|
||||
|
||||
[Parameter(ParameterSetName='GetUpdateRun')]
|
||||
[string] $region = 'local',
|
||||
|
||||
[Parameter(Mandatory=$true, ParameterSetName='GetUpdateRun')]
|
||||
[ValidateNotNullorEmpty()]
|
||||
[String] $vupdate
|
||||
|
||||
|
||||
)
|
||||
|
||||
|
||||
|
||||
$endpoints = (Invoke-RestMethod -Uri https://api.$azureStackDomain/metadata/endpoints?api-version=1.0 -Method Get)
|
||||
$activeDirectoryServiceEndpointResourceId = $endpoints.authentication.audiences[0]
|
||||
$galleryEndpoint = $endpoints.galleryEndpoint
|
||||
$graphEndpoint = $endpoints.graphEndpoint
|
||||
$loginEndpoint = $endpoints.authentication.loginEndpoint
|
||||
$authority = $loginEndpoint + $tenantID + "/"
|
||||
|
||||
Add-AzureRmEnvironment -Name 'Azure Stack' -ActiveDirectoryEndpoint $authority -ActiveDirectoryServiceEndpointResourceId $activeDirectoryServiceEndpointResourceId -ResourceManagerEndpoint "https://api.$azureStackDomain/" -GalleryEndpoint $galleryEndpoint -GraphEndpoint $graphEndpoint | Out-Null
|
||||
|
||||
|
||||
$environment = Get-AzureRmEnvironment 'Azure Stack'
|
||||
|
||||
$profile = Add-AzureRmAccount -Environment $environment -Credential $azureStackCredentials
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$powershellClientId = "0a7bdc5c-7b57-40be-9939-d4c5fc7cd417"
|
||||
|
||||
$adminToken = Get-AzureStackToken -WarningAction Ignore `
|
||||
-Authority $authority `
|
||||
-Resource $activeDirectoryServiceEndpointResourceId `
|
||||
-AadTenantId $tenantID `
|
||||
-ClientId $powershellClientId `
|
||||
-Credential $azureStackCredentials
|
||||
|
||||
|
||||
$armEndpoint = 'https://api.' + $azureStackDomain
|
||||
$adminSubscription = Get-AzureRMTenantSubscription -AdminUri $ArmEndPoint -Token $admintoken -WarningAction Ignore
|
||||
$subscription = $adminSubscription.SubscriptionId
|
||||
|
||||
$headers = @{ Authorization = ("Bearer $adminToken") }
|
||||
|
||||
|
||||
$URI= "${ArmEndpoint}/subscriptions/${subscription}/resourceGroups/system/providers/Microsoft.Update.Admin/updatelocations/$region/updates/$vupdate/updateRuns?api-version=2016-05-01"
|
||||
$UpdateRuns=Invoke-RestMethod -Method GET -Uri $uri -ContentType 'application/json' -Headers $Headers
|
||||
$Updaterunprop=$UpdateRuns.value
$Updaterunprop.properties|select updateLocation,updateversion,state,timeStarted,duration|fl
|
||||
|
||||
}
|
||||
|
||||
Function Apply-AzureStackUpdate{
|
||||
|
||||
[CmdletBinding(DefaultParameterSetName='ApplyUpdate')]
|
||||
Param(
|
||||
|
||||
[Parameter(Mandatory=$true, ParameterSetName='ApplyUpdate')]
|
||||
[ValidateNotNullorEmpty()]
|
||||
[String] $TenantId,
|
||||
|
||||
|
||||
[Parameter(Mandatory=$true, ParameterSetName='ApplyUpdate')]
|
||||
[ValidateNotNullorEmpty()]
|
||||
[System.Management.Automation.PSCredential] $azureStackCredentials,
|
||||
|
||||
|
||||
[Parameter(ParameterSetName='ApplyUpdate')]
|
||||
[string] $azureStackDomain = 'azurestack.local',
|
||||
|
||||
[Parameter(ParameterSetName='ApplyUpdate')]
|
||||
[string] $region = 'local',
|
||||
|
||||
[Parameter(Mandatory=$true, ParameterSetName='ApplyUpdate')]
|
||||
[ValidateNotNullorEmpty()]
|
||||
[String] $vupdate
|
||||
|
||||
|
||||
|
||||
|
||||
)
|
||||
|
||||
|
||||
|
||||
$endpoints = (Invoke-RestMethod -Uri https://api.$azureStackDomain/metadata/endpoints?api-version=1.0 -Method Get)
|
||||
$activeDirectoryServiceEndpointResourceId = $endpoints.authentication.audiences[0]
|
||||
$galleryEndpoint = $endpoints.galleryEndpoint
|
||||
$graphEndpoint = $endpoints.graphEndpoint
|
||||
$loginEndpoint = $endpoints.authentication.loginEndpoint
|
||||
$authority = $loginEndpoint + $tenantID + "/"
|
||||
|
||||
Add-AzureRmEnvironment -Name 'Azure Stack' -ActiveDirectoryEndpoint $authority -ActiveDirectoryServiceEndpointResourceId $activeDirectoryServiceEndpointResourceId -ResourceManagerEndpoint "https://api.$azureStackDomain/" -GalleryEndpoint $galleryEndpoint -GraphEndpoint $graphEndpoint |Out-Null
|
||||
|
||||
|
||||
$environment = Get-AzureRmEnvironment 'Azure Stack'
|
||||
|
||||
$profile = Add-AzureRmAccount -Environment $environment -Credential $azureStackCredentials
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$powershellClientId = "0a7bdc5c-7b57-40be-9939-d4c5fc7cd417"
|
||||
|
||||
$adminToken = Get-AzureStackToken -WarningAction Ignore `
|
||||
-Authority $authority `
|
||||
-Resource $activeDirectoryServiceEndpointResourceId `
|
||||
-AadTenantId $tenantID `
|
||||
-ClientId $powershellClientId `
|
||||
-Credential $azureStackCredentials
|
||||
|
||||
|
||||
|
||||
|
||||
$armEndpoint = 'https://api.' + $azureStackDomain
|
||||
$adminSubscription = Get-AzureRMTenantSubscription -AdminUri $ArmEndPoint -Token $admintoken -WarningAction Ignore
|
||||
$subscription = $adminSubscription.SubscriptionId
|
||||
|
||||
$headers = @{ Authorization = ("Bearer $adminToken") }
|
||||
|
||||
|
||||
|
||||
$URI= "${ArmEndpoint}/subscriptions/${subscription}/resourceGroups/system/providers/Microsoft.Update.Admin/updatelocations/$region/updates?api-version=2016-05-01"
|
||||
$Updates=Invoke-RestMethod -Method GET -Uri $uri -ContentType 'application/json' -Headers $Headers
|
||||
$Updateprop=$Updates.value
$Update=$updateprop |where-object {$_.name -eq "$vupdate"}
|
||||
|
||||
|
||||
$StartUpdateBody = $update | ConvertTo-Json
|
||||
$URI= "${ArmEndpoint}/subscriptions/${subscription}/resourceGroups/system/providers/Microsoft.Update.Admin/updatelocations/$region/updates/$vupdate ?api-version=2016-05-01"
|
||||
$Runs=Invoke-RestMethod -Method PUT -Uri $uri -ContentType 'application/json' -Headers $Headers -Body $StartUpdateBody
|
||||
$Startrun=$Runs.value
$Startrun
|
||||
|
||||
}
|
||||
|
||||
Function Close-AzureStackAlert{
|
||||
|
||||
[CmdletBinding(DefaultParameterSetName='closealert')]
|
||||
Param(
|
||||
|
||||
[Parameter(Mandatory=$true, ParameterSetName='closealert')]
|
||||
[ValidateNotNullorEmpty()]
|
||||
[String] $TenantId,
|
||||
|
||||
|
||||
[Parameter(Mandatory=$true, ParameterSetName='closealert')]
|
||||
[ValidateNotNullorEmpty()]
|
||||
[System.Management.Automation.PSCredential] $azureStackCredentials,
|
||||
|
||||
|
||||
[Parameter(ParameterSetName='closealert')]
|
||||
[string] $azureStackDomain = 'azurestack.local',
|
||||
|
||||
[Parameter(ParameterSetName='closealert')]
|
||||
[string] $region = 'local',
|
||||
|
||||
[Parameter(Mandatory=$true, ParameterSetName='closealert')]
|
||||
[ValidateNotNullorEmpty()]
|
||||
[String] $alertid
|
||||
|
||||
|
||||
|
||||
|
||||
)
|
||||
|
||||
|
||||
|
||||
$endpoints = (Invoke-RestMethod -Uri https://api.$azureStackDomain/metadata/endpoints?api-version=1.0 -Method Get)
|
||||
$activeDirectoryServiceEndpointResourceId = $endpoints.authentication.audiences[0]
|
||||
$galleryEndpoint = $endpoints.galleryEndpoint
|
||||
$graphEndpoint = $endpoints.graphEndpoint
|
||||
$loginEndpoint = $endpoints.authentication.loginEndpoint
|
||||
$authority = $loginEndpoint + $tenantID + "/"
|
||||
|
||||
Add-AzureRmEnvironment -Name 'Azure Stack' -ActiveDirectoryEndpoint $authority -ActiveDirectoryServiceEndpointResourceId $activeDirectoryServiceEndpointResourceId -ResourceManagerEndpoint "https://api.$azureStackDomain/" -GalleryEndpoint $galleryEndpoint -GraphEndpoint $graphEndpoint |Out-Null
|
||||
|
||||
|
||||
$environment = Get-AzureRmEnvironment 'Azure Stack'
|
||||
|
||||
$profile = Add-AzureRmAccount -Environment $environment -Credential $azureStackCredentials
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$powershellClientId = "0a7bdc5c-7b57-40be-9939-d4c5fc7cd417"
|
||||
|
||||
$adminToken = Get-AzureStackToken -WarningAction Ignore `
|
||||
-Authority $authority `
|
||||
-Resource $activeDirectoryServiceEndpointResourceId `
|
||||
-AadTenantId $tenantID `
|
||||
-ClientId $powershellClientId `
|
||||
-Credential $azureStackCredentials
|
||||
|
||||
|
||||
|
||||
|
||||
$armEndpoint = 'https://api.' + $azureStackDomain
|
||||
$adminSubscription = Get-AzureRMTenantSubscription -AdminUri $ArmEndPoint -Token $admintoken -WarningAction Ignore
|
||||
$subscription = $adminSubscription.SubscriptionId
|
||||
|
||||
$headers = @{ Authorization = ("Bearer $adminToken") }
|
||||
|
||||
|
||||
|
||||
$URI= "${ArmEndpoint}/subscriptions/${subscription}/resourceGroups/system/providers/Microsoft.InfrastructureInsights.Admin/regionHealths/$region/Alerts?api-version=2016-05-01"
|
||||
$Alert=Invoke-RestMethod -Method GET -Uri $uri -ContentType 'application/json' -Headers $Headers
|
||||
$Alerts=$Alert.value |where-object {$_.properties.alertid -eq "$alertid"}
|
||||
$alertname=$alerts.name
|
||||
|
||||
$Alerts.properties.state = "Closed"
|
||||
$AlertUpdateBody = $Alerts | ConvertTo-Json
|
||||
$URI= "${ArmEndpoint}/subscriptions/${subscription}/resourceGroups/system/providers/Microsoft.InfrastructureInsights.Admin/regionHealths/$region/Alerts/${alertname}?api-version=2016-05-01"
|
||||
$URI
|
||||
$Close=Invoke-RestMethod -Method PUT -Uri $uri -ContentType 'application/json' -Headers $Headers -Body $AlertUpdateBody
|
||||
$CloseRun=$Close.value
$closeRun
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,214 @@
|
|||
# Azure Stack Infrastructure Administration
|
||||
|
||||
Instructions below are relative to the .\Infrastructure folder of the [AzureStack-Tools repo](..).
|
||||
|
||||
```powershell
|
||||
Import-Module .\AzureStack.Infra.psm1
|
||||
```
|
||||
|
||||
##Retrieve Infrastructure Alerts
|
||||
|
||||
List active and closed Infrastructure Alerts
|
||||
|
||||
```powershell
|
||||
$credential=get-credential
|
||||
Get-AzureStackAlert -AzureStackCredentials $credential- TenantID "ID"
|
||||
```
|
||||
|
||||
Note: The cmdlet requires credentials to retrieve Alerts. Provide the administrator Azure Active Directory credentials, such as *<Admin Account>*@*<mydirectory>*.onmicrosoft.com, to the prompt.
|
||||
|
||||
The command does the following:
|
||||
- Authenticates to the Azure Stack environment
|
||||
- Retrieves Active & Closed Alerts
|
||||
|
||||
|
||||
##Close Infrastructure Alerts
|
||||
|
||||
Close any active Infrastructure Alert. Run Get-AzureStackAlert to get the AlertID, required to close a specific Alert.
|
||||
|
||||
```powershell
|
||||
$credential=get-credential
|
||||
Close-AzureStackAlert -AzureStackCredentials $credential- TenantID "ID" -AlertID "ID"
|
||||
```
|
||||
|
||||
Note: The cmdlet requires credentials to retrieve Alerts. Provide the administrator Azure Active Directory credentials, such as *<Admin Account>*@*<mydirectory>*.onmicrosoft.com, to the prompt.
|
||||
|
||||
The command does the following:
|
||||
- Authenticates to the Azure Stack environment
|
||||
- Close active Alert
|
||||
|
||||
|
||||
##Get Region Update Summary
|
||||
|
||||
Review the Update Summary for a specified region.
|
||||
|
||||
```powershell
|
||||
$credential=get-credential
|
||||
Get-AzureStackUpdateSummary -AzureStackCredentials $credential- TenantID "ID"
|
||||
```
|
||||
|
||||
Note: The cmdlet requires credentials to retrieve Alerts. Provide the administrator Azure Active Directory credentials, such as *<Admin Account>*@*<mydirectory>*.onmicrosoft.com, to the prompt.
|
||||
|
||||
The command does the following:
|
||||
- Authenticates to the Azure Stack environment
|
||||
- Retrieves Region Update Summary
|
||||
|
||||
|
||||
##Get Azure Stack Update
|
||||
|
||||
Retrieves list of Azure Stack Updates
|
||||
|
||||
```powershell
|
||||
$credential=get-credential
|
||||
Get-AzureStackUpdate -AzureStackCredentials $credential- TenantID "ID" -AlertID "ID"
|
||||
```
|
||||
|
||||
Note: The cmdlet requires credentials to retrieve Alerts. Provide the administrator Azure Active Directory credentials, such as *<Admin Account>*@*<mydirectory>*.onmicrosoft.com, to the prompt.
|
||||
|
||||
The command does the following:
|
||||
- Authenticates to the Azure Stack environment
|
||||
- List Azure Stack Updates
|
||||
|
||||
|
||||
##Apply Azure Stack Update
|
||||
|
||||
Applies a specific Azure Stack Update that is downloaded and applicable. Run Get-AzureStackUpdate to retrieve Update Version first
|
||||
|
||||
```powershell
|
||||
$credential=get-credential
|
||||
Apply-AzureStackUpdate -AzureStackCredentials $credential- TenantID "ID" -vupdate "Update Version"
|
||||
```
|
||||
|
||||
Note: The cmdlet requires credentials to retrieve Alerts. Provide the administrator Azure Active Directory credentials, such as *<Admin Account>*@*<mydirectory>*.onmicrosoft.com, to the prompt.
|
||||
|
||||
The command does the following:
|
||||
- Authenticates to the Azure Stack environment
|
||||
- Applies specified Update
|
||||
|
||||
|
||||
##Get Azure Stack Update Run
|
||||
|
||||
Should be used to validate a specific Update Run or look at previous update runs
|
||||
|
||||
```powershell
|
||||
$credential=get-credential
|
||||
Get-AzureStackUpdateRun -AzureStackCredentials $credential- TenantID "ID" -vupdate "Update Version"
|
||||
```
|
||||
|
||||
Note: The cmdlet requires credentials to retrieve Alerts. Provide the administrator Azure Active Directory credentials, such as *<Admin Account>*@*<mydirectory>*.onmicrosoft.com, to the prompt.
|
||||
|
||||
The command does the following:
|
||||
- Authenticates to the Azure Stack environment
|
||||
- Lists Update Run information for a specific Azure Stack update
|
||||
|
||||
|
||||
##List Infrastructure Roles
|
||||
|
||||
Does list all Infrastructure Roles
|
||||
|
||||
```powershell
|
||||
$credential=get-credential
|
||||
Get-AzureStackInfraRole -AzureStackCredentials $credential- TenantID "ID"
|
||||
```
|
||||
|
||||
Note: The cmdlet requires credentials to retrieve Alerts. Provide the administrator Azure Active Directory credentials, such as *<Admin Account>*@*<mydirectory>*.onmicrosoft.com, to the prompt.
|
||||
|
||||
The command does the following:
|
||||
- Authenticates to the Azure Stack environment
|
||||
- Lists Infrastructure Roles
|
||||
|
||||
|
||||
##List Infrastructure Virtual Machines
|
||||
|
||||
Does list all Infrastructure Role Instances (Note: Does not return Directory Management VM in One Node deployment)
|
||||
|
||||
```powershell
|
||||
$credential=get-credential
|
||||
Get-AzureStackInfraVM -AzureStackCredentials $credential- TenantID "ID"
|
||||
```
|
||||
|
||||
Note: The cmdlet requires credentials to retrieve Alerts. Provide the administrator Azure Active Directory credentials, such as *<Admin Account>*@*<mydirectory>*.onmicrosoft.com, to the prompt.
|
||||
|
||||
The command does the following:
|
||||
- Authenticates to the Azure Stack environment
|
||||
- Lists Infrastructure Role Instances
|
||||
|
||||
|
||||
##List Scale Unit
|
||||
|
||||
Does list all Scale Units in a specified Region
|
||||
|
||||
```powershell
|
||||
$credential=get-credential
|
||||
Get-AzureStackScaleUnit -AzureStackCredentials $credential- TenantID "ID"
|
||||
```
|
||||
|
||||
Note: The cmdlet requires credentials to retrieve Alerts. Provide the administrator Azure Active Directory credentials, such as *<Admin Account>*@*<mydirectory>*.onmicrosoft.com, to the prompt.
|
||||
|
||||
The command does the following:
|
||||
- Authenticates to the Azure Stack environment
|
||||
- Lists Scale Units
|
||||
|
||||
|
||||
##List Nodes
|
||||
|
||||
Does list Nodes in a Scale Unit
|
||||
|
||||
```powershell
|
||||
$credential=get-credential
|
||||
Get-AzureStackNode -AzureStackCredentials $credential- TenantID "ID"
|
||||
```
|
||||
|
||||
Note: The cmdlet requires credentials to retrieve Alerts. Provide the administrator Azure Active Directory credentials, such as *<Admin Account>*@*<mydirectory>*.onmicrosoft.com, to the prompt.
|
||||
|
||||
The command does the following:
|
||||
- Authenticates to the Azure Stack environment
|
||||
- Lists Nodes
|
||||
|
||||
|
||||
##List Logical Networks
|
||||
|
||||
Does list all logical Networks by ID
|
||||
|
||||
```powershell
|
||||
$credential=get-credential
|
||||
Get-AzureStackLogialNetwork -AzureStackCredentials $credential- TenantID "ID"
|
||||
```
|
||||
|
||||
Note: The cmdlet requires credentials to retrieve Alerts. Provide the administrator Azure Active Directory credentials, such as *<Admin Account>*@*<mydirectory>*.onmicrosoft.com, to the prompt.
|
||||
|
||||
The command does the following:
|
||||
- Authenticates to the Azure Stack environment
|
||||
- Lists logical Networks
|
||||
|
||||
|
||||
##List Storage Capacity
|
||||
|
||||
Does return the total capacity of the storage subsystem
|
||||
|
||||
```powershell
|
||||
$credential=get-credential
|
||||
Get-AzureStackStorageCapacity -AzureStackCredentials $credential- TenantID "ID"
|
||||
```
|
||||
|
||||
Note: The cmdlet requires credentials to retrieve Alerts. Provide the administrator Azure Active Directory credentials, such as *<Admin Account>*@*<mydirectory>*.onmicrosoft.com, to the prompt.
|
||||
|
||||
The command does the following:
|
||||
- Authenticates to the Azure Stack environment
|
||||
- Lists total storage capacity for the storage subsystem
|
||||
|
||||
|
||||
##List Storage Shares
|
||||
|
||||
Does list all file shares in the storage subsystem
|
||||
|
||||
```powershell
|
||||
$credential=get-credential
|
||||
Get-AzureStackStorageShare -AzureStackCredentials $credential- TenantID "ID"
|
||||
```
|
||||
|
||||
Note: The cmdlet requires credentials to retrieve Alerts. Provide the administrator Azure Active Directory credentials, such as *<Admin Account>*@*<mydirectory>*.onmicrosoft.com, to the prompt.
|
||||
|
||||
The command does the following:
|
||||
- Authenticates to the Azure Stack environment
|
||||
- Retrieves all file shares
|
18
README.md
18
README.md
|
@ -54,5 +54,23 @@ Manage plans and subscriptions in Azure Stack.
|
|||
Manage compute (VM) service in Azure Stack.
|
||||
- Add VM Image to the Azure Stack Marketplace
|
||||
|
||||
## [Azure Stack Infrastructure Administration](Infrastructure)
|
||||
|
||||
Manage Azure Stack Infrastructure
|
||||
- Get Infrastructure resolve
|
||||
- Get Infrastructure Virtual machines
|
||||
- Get Storage Capacity
|
||||
- Get Storage Shares
|
||||
- Get Scale Unit
|
||||
- Get Node
|
||||
- Get Logical network
|
||||
- Get Alert
|
||||
- Close Alert
|
||||
- Get Update Region Summary
|
||||
- Get Update
|
||||
- Apply Update
|
||||
- Get Update run
|
||||
|
||||
|
||||
---
|
||||
_This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments._
|
||||
|
|
Загрузка…
Ссылка в новой задаче