0

I tried to get Azure Stack identity health report according to the below document. But getting error if the packages are installed on power shell. Link

Get-AzsHealthReport : The term 'Get-AzsHealthReport' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, 
verify that the path is correct and try again.
At line:3 char:17
+ $healthReport = Get-AzsHealthReport -AdminResourceManagerEndpoint $Ad ...
+                 ~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Get-AzsHealthReport:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
AmanGarg-MSFT
  • 1,123
  • 6
  • 10
vish
  • 671
  • 2
  • 7
  • 15
  • Did you install the module follow this [link](https://learn.microsoft.com/en-us/azure-stack/operator/azure-stack-powershell-install?view=azs-1908)? Use the correct commands depends on your Azure Stack version, https://learn.microsoft.com/en-us/azure-stack/operator/azure-stack-powershell-install?view=azs-1908#install-azure-stack-powershell – Joy Wang Nov 07 '19 at 05:30
  • @JoyWang Yes. Then I reinstalled them and getting the same error. AzS version 1908 – vish Nov 07 '19 at 06:21
  • Did you confirm the installation?https://learn.microsoft.com/en-us/azure-stack/operator/azure-stack-powershell-install?view=azs-1908#confirm-the-installation-of-powershell-1 And if you run `Get-Command -Name Get-AzsHealthReport`, what's the result? – Joy Wang Nov 07 '19 at 06:25

1 Answers1

1

Follow the steps provided in this document on powershell as Admin.

Start Powershell in Admin mode and run the below steps:

Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass

# Install the AzureRM.BootStrapper module. Select Yes when prompted to install NuGet
Install-Module -Name AzureRM.BootStrapper

# Install and import the API Version Profile required by Azure Stack into the current PowerShell session.
Use-AzureRmProfile -Profile 2019-03-01-hybrid -Force
Install-Module -Name AzureStack -RequiredVersion 1.7.2

Now install Azure Stack Tools:

https://github.com/Azure/AzureStack-Tools/tree/master/Identity#download-azure-stack-tools

cd C:
mkdir Azure-Stack
cd .\Azure-Stack\
# Download the tools archive.
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
invoke-webrequest `...
# Expand the downloaded files.
expand-archive master.zip `...
# Change to the tools directory.
cd AzureStack-Tools-master
cd .\Identity\
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
Import-Module ..\Connect\AzureStack.Connect.psm1
Import-Module ..\Identity\AzureStack.Identity.psm1
Get-AzsHealthReport

You should now be able to run the command.

Hope this helps!

AmanGarg-MSFT
  • 1,123
  • 6
  • 10