You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/2014/analysis-services/analysis-services-powershell.md
+41-43Lines changed: 41 additions & 43 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -76,11 +76,11 @@ For more information about syntax and examples, see [Analysis Services PowerShel
76
76
77
77
3. The user name and password provided by the credential object resolves to a Windows user identity. Analysis Services uses this identity as the current user. If the user is not a Windows user, or lacks sufficient permissions to perform the requested operation, the request will fail.
78
78
79
-
To create a credential object, you can use the Get-Credential cmdlet to collect the credentials from the operator. You can then use the credential object on a command that connects to Analysis Services. The following example illustrates one approach. In this example, the connection is to a local instance configured for HTTP access.
79
+
To create a credential object, you can use the Get-Credential cmdlet to collect the credentials from the operator. You can then use the credential object on a command that connects to Analysis Services. The following example illustrates one approach. In this example, the connection is to a local instance (`SQLSERVER:\SQLAS\HTTP_DS`) configured for HTTP access.
When using Basic authentication, you should always use HTTPS with SSL so that username and passwords are sent over an encrypted connection. For more information, see [Configure Secure Sockets Layer in IIS 7.0](https://go.microsoft.com/fwlink/?linkID=184299) and [Configure Basic Authentication (IIS 7)](https://go.microsoft.com/fwlink/?LinkId=230776).
Some operations, such as backup and restore, support encryption options that are activated when you provide a password in the command. Providing the password signals Analysis Services to encrypt or decrypt the backup file. In Analysis Services, this password is instantiated as a secure string object. The following example provides an illustration of how to collect a password from the operator at run time.
You can now backup or restore an encrypted database file, passing the $pwd variable to the password parameter. To view a complete example that combines this illustration with other cmdlets, see [Backup-ASDatabase cmdlet](/powershell/module/sqlserver/backup-asdatabase) and [Restore-ASDatabase cmdlet](/powershell/module/sqlserver/restore-asdatabase).
102
100
103
101
As a follow up step, remove both the password and variable from the session.
- Run the Import-module cmdlet to load SQLPS that includes all of the Analysis Services PowerShell functionality. If you cannot import the module, you can temporarily change the execution policy to unrestricted for the purpose of the loading the module. For more information, see [Import the SQLPS Module](../../2014/database-engine/import-the-sqlps-module.md).
129
127
130
-
```
131
-
Import-module "sqlps"
128
+
```powershell
129
+
Import-Module "sqlps"
132
130
```
133
131
134
132
Alternatively, use `import-module "sqlps" -disablenamechecking` to suppress the warning about unapproved verb names.
135
133
136
134
- To load just the task-specific Analysis Services cmdlets, without the Analysis Services provider or the Invoke-ASCmd cmdlet, you can load the SQLASCmdlets module as an independent operation.
8. On the local computer that has the client tools, use the following cmdlets to verify remote administration, substituting the actual server name for the *remote-server-name* placeholder. Omit the instance name if Analysis Services is installed as the default instance. You must have previously imported the SQLPS module in order for the command to work.
160
158
161
-
```
162
-
PS SQLSERVER:\> cd sqlas
159
+
```
160
+
PS SQLSERVER:\> cd sqlas
163
161
PS SQLSERVER:\sqlas> cd <remote-server-name\instance-name>
164
162
PS SQLSERVER:\sqlas\<remote-server-name\instance-name> dir
165
163
```
166
164
167
165
In some cases, additional configuration might be necessary. You might need to type the following on the remote server before you can issue commands to it from another computer:
168
166
169
-
```
170
-
Enable-psremoting
167
+
```powershell
168
+
Enable-PSRemoting
171
169
```
172
170
173
171
@@ -211,61 +209,61 @@ PS SQLSERVER\sqlas\http_ds\http%3A%2F%2Flocalhost%2olap%2msmdpump%2Edll:> dir
211
209
### <aname="bkmk_admin"></a> Administer the Service
212
210
Verify the service is running. Returns status, name, and display name for SQL Server services, including Analysis Services (MSSQLServerOLAPService) and the Database Engine.
213
211
214
-
```
215
-
Get-service mssql*
212
+
```powershell
213
+
Get-Service mssql*
216
214
```
217
215
218
216
Returns properties about a process, including process ID, handle count, and memory usage:
219
217
220
-
```
221
-
Get-process msmdsrv
218
+
```powershell
219
+
Get-Process msmdsrv
222
220
```
223
221
224
222
Restarts the service when you issue the following cmdlet from the administrator shell:
225
223
226
-
```
227
-
Restart-service mssqlserverolapservice
224
+
```powershell
225
+
Restart-Service mssqlserverolapservice
228
226
```
229
227
230
228
### <aname="bkmk_help"></a> Get Help for Analysis Services PowerShell
231
229
Use any of the following cmdlets to verify cmdlet availability and to get more information about services, processes, and objects.
232
230
233
-
1. `Get-help` returns the built-in help for an Analysis Services cmdlet, including examples:
231
+
1.`Get-Help` returns the built-in help for an Analysis Services cmdlet, including examples:
234
232
235
-
```
236
-
Get-help invoke-ascmd -examples
233
+
```powershell
234
+
Get-Help invoke-ascmd -Examples
237
235
```
238
236
239
-
2. `Get-command` returns a list of the eleven Analysis Services PowerShell cmdlets:
237
+
2. `Get-Command` returns a list of the eleven Analysis Services PowerShell cmdlets:
240
238
241
-
```
242
-
get-command -module SQLASCmdlets
239
+
```powershell
240
+
Get-Command -module SQLASCmdlets
243
241
```
244
242
245
-
3. `Get-member` returns properties or methods of a service or process.
243
+
3. `Get-Member` returns properties or methods of a service or process.
4. `Get-member` can also be used to return properties or methods of an object (for example, AMO methods on the server object) using the SQLAS provider to specify the server instance.
257
+
4. `Get-Member` can also be used to return properties or methods of an object (for example, AMO methods on the server object) using the SQLAS provider to specify the server instance.
5. `Get-PSdrive` returns a list of the providers that are currently installed. If you imported the SQLPS module, you will see the `SQLServer` provider in the list (SQLAS is part of the SQLServer provider and never appears separately in the list):
0 commit comments