Book Image

SQL Server 2014 with PowerShell v5 Cookbook

By : Donabel Santos
Book Image

SQL Server 2014 with PowerShell v5 Cookbook

By: Donabel Santos

Overview of this book

Table of Contents (21 chapters)
SQL Server 2014 with PowerShell v5 Cookbook
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Listing SSAS instance properties


We will list SSAS instance properties in this recipe.

How to do it...

Let's explore the code required to list SSAS instance properties:

  1. Open PowerShell ISE as an administrator.

  2. Import the SQLASCmdlets module as follows:

    Import-Module SQLASCmdlets -DisableNameChecking
  3. Add the following script and run it:

    #Connect to your Analysis Services server 
    $SSASServer = New-Object Microsoft.AnalysisServices.Server
    
    $instanceName = "localhost"
    $SSASServer.connect($instanceName)
    
    #get all properties
    $SSASServer | 
    Select-Object *

    You will see a result similar to this:

How it works...

To get SSAS instance properties, we first need to load the SQLASCmdlets module:

Import-Module SQLASCmdlets -DisableNameChecking

We then need to create an Analysis Server object and connect to our instance:

#Connect to your Analysis Services server 
$SSASServer = New-Object Microsoft.AnalysisServices.Server

$instanceName = "localhost"
$SSASServer.connect($instanceName)

Once we get a handle to our SSAS...