Skip to content

Commit f420c76

Browse files
author
msebolt
committed
powershell updates
1 parent 9c44cd0 commit f420c76

24 files changed

Lines changed: 119 additions & 169 deletions

File tree

docs/2014/analysis-services/instances/install-windows/power-pivot-minimum-privilege-example-sharepoint-2013.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,7 @@ manager: craigg
6666

6767
2. Run the following PowerShell code:
6868

69-
```
69+
```powershell
7070
$webApp = Get-SPWebApplication "http://<servername>"
71-
$webApp.GrantAccessToProcessIdentity("DOMAIN\<ServiceAccountName>")
72-
71+
$webApp.GrantAccessToProcessIdentity("DOMAIN\<ServiceAccountName>")
7372
```
74-
75-

docs/2014/analysis-services/power-pivot-sharepoint/power-pivot-configuration-using-windows-powershell.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ manager: craigg
2929

3030
2. Enter the following command:
3131

32-
```
33-
Get-help *powerpivot*
32+
```powershell
33+
Get-Help *powerpivot*
3434
```
3535
3636
You should see a list of cmdlets that include PowerPivot in the cmdlet name. For example `Get-PowerPivotServiceApplication`. The number of cmdlets available depends on the version of Analysis Services you are using.
@@ -43,14 +43,14 @@ manager: craigg
4343
4444
All cmdlets have online help. The following example shows how to view the online help for the `New-PowerPivotServiceApplication` cmdlet:
4545
46-
```
47-
Get-help new-powerpivotserviceapplication -full
46+
```powershell
47+
Get-Help new-powerpivotserviceapplication -Full
4848
```
4949
5050
Alternatively, to view just the examples, use the following syntax:
5151
52-
```
53-
Get-help new-powerpivotserviceapplication -example
52+
```powershell
53+
Get-Help new-powerpivotserviceapplication -Example
5454
```
5555
5656
## Enable PowerPivot Cmdlets on a Server
@@ -60,15 +60,15 @@ manager: craigg
6060
6161
2. Run the first cmdlet:
6262
63-
```
63+
```powershell
6464
Add-SPSolution -LiteralPath "C:\Program Files\Microsoft SQL Server\110\Tools\PowerPivotTools\ConfigurationTool\Resources\PowerPivotFarm.wsp"
6565
```
6666
6767
The cmdlet returns the name of the solution, its solution ID, and Deployed=False. In the next step, you deploy the solution.
6868
6969
3. Run the second cmdlet to deploy the solution:
7070
71-
```
71+
```powershell
7272
Install-SPSolution -Identity PowerPivotFarm.wsp -GACDeployment -Force
7373
```
7474
@@ -80,5 +80,3 @@ manager: craigg
8080
[PowerPivot Configuration Tools](power-pivot-configuration-tools.md)
8181
8282
[PowerShell Reference for PowerPivot for SharePoint](/sql/analysis-services/powershell/powershell-reference-for-power-pivot-for-sharepoint)
83-
84-

docs/2014/database-engine/availability-groups/windows/perform-a-forced-manual-failover-of-an-availability-group-sql-server.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ manager: craigg
136136
137137
The following example forces the `AccountsAG` availability group to fail over to the local secondary replica.
138138
139-
```
139+
```sql
140140
ALTER AVAILABILITY GROUP AccountsAG FORCE_FAILOVER_ALLOW_DATA_LOSS;
141141
```
142142
@@ -155,10 +155,8 @@ manager: craigg
155155
156156
The following example performs a forced failover (with possible data loss) of the availability group `MyAg` to the secondary replica on the server instance named `SecondaryServer\InstanceName`. You will be prompted to confirm this operation.
157157
158-
```
159-
Switch-SqlAvailabilityGroup `
160-
-Path SQLSERVER:\Sql\SecondaryServer\InstanceName\AvailabilityGroups\MyAg `
161-
-AllowDataLoss
158+
```powershell
159+
Switch-SqlAvailabilityGroup -Path SQLSERVER:\Sql\SecondaryServer\InstanceName\AvailabilityGroups\MyAg -AllowDataLoss
162160
```
163161
164162
- **-AllowDataLoss-Force**
@@ -167,10 +165,8 @@ manager: craigg
167165
168166
The following example performs a forced failover (with possible data loss) of the availability group `MyAg` to the server instance named `SecondaryServer\InstanceName`. The `-Force` option suppresses confirmation of this operation.
169167
170-
```
171-
Switch-SqlAvailabilityGroup `
172-
-Path SQLSERVER:\Sql\SecondaryServer\InstanceName\AvailabilityGroups\MyAg `
173-
-AllowDataLoss -Force
168+
```powershell
169+
Switch-SqlAvailabilityGroup -Path SQLSERVER:\Sql\SecondaryServer\InstanceName\AvailabilityGroups\MyAg -AllowDataLoss -Force
174170
```
175171
176172
> [!NOTE]

docs/2014/database-engine/availability-groups/windows/perform-a-planned-manual-failover-of-an-availability-group-sql-server.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ manager: craigg
7676

7777
The following example manually fails over the *MyAg* availability group to the connected secondary replica.
7878

79-
```
79+
```sql
8080
ALTER AVAILABILITY GROUP MyAg FAILOVER;
8181
```
8282

@@ -92,7 +92,7 @@ manager: craigg
9292

9393
The following example manually fails over the *MyAg* availability group to the secondary replica with the specified path.
9494

95-
```
95+
```powershell
9696
Switch-SqlAvailabilityGroup -Path SQLSERVER:\Sql\SecondaryServer\InstanceName\AvailabilityGroups\MyAg
9797
```
9898

@@ -109,5 +109,3 @@ manager: craigg
109109
[Overview of AlwaysOn Availability Groups &#40;SQL Server&#41;](overview-of-always-on-availability-groups-sql-server.md)
110110
[Failover and Failover Modes &#40;AlwaysOn Availability Groups&#41;](failover-and-failover-modes-always-on-availability-groups.md)
111111
[Perform a Forced Manual Failover of an Availability Group &#40;SQL Server&#41;](perform-a-forced-manual-failover-of-an-availability-group-sql-server.md)
112-
113-

docs/2014/database-engine/availability-groups/windows/prereqs-restrictions-recommendations-always-on-availability.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ manager: craigg
9797

9898
The following PowerShell example sets the HostRecordTTL to 300 seconds for a Network Name resource named "`SQL Network Name (SQL35)`".
9999

100-
```
100+
```powershell
101101
Import-Module FailoverClusters
102102
103103
$nameResource = "SQL Network Name (SQL35)"

docs/2014/database-engine/availability-groups/windows/remove-a-primary-database-from-an-availability-group-sql-server.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ manager: craigg
8080

8181
The following example removes a databases named `Db6` from the `MyAG` availability group.
8282

83-
```
83+
```sql
8484
ALTER AVAILABILITY GROUP MyAG REMOVE DATABASE Db6;
8585
```
8686

@@ -93,9 +93,8 @@ manager: craigg
9393

9494
For example, the following command removes the availability database `MyDb9` from the availability group named `MyAg`. Because the command is executed on the server instance that hosts the primary replica, the primary database and all its corresponding secondary databases are removed from the availability group. Data synchronization will no longer occur for this database on any secondary replica.
9595

96-
```
97-
Remove-SqlAvailabilityDatabase `
98-
-Path SQLSERVER:\Sql\PrimaryComputer\InstanceName\AvailabilityGroups\MyAg\Databases\MyDb9
96+
```powershell
97+
Remove-SqlAvailabilityDatabase -Path SQLSERVER:\Sql\PrimaryComputer\InstanceName\AvailabilityGroups\MyAg\Databases\MyDb9
9998
```
10099

101100
> [!NOTE]
@@ -121,5 +120,3 @@ manager: craigg
121120
## See Also
122121
[Overview of AlwaysOn Availability Groups &#40;SQL Server&#41;](overview-of-always-on-availability-groups-sql-server.md)
123122
[Remove a Secondary Database from an Availability Group &#40;SQL Server&#41;](remove-a-secondary-database-from-an-availability-group-sql-server.md)
124-
125-

docs/2014/database-engine/availability-groups/windows/remove-a-secondary-database-from-an-availability-group-sql-server.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ manager: craigg
8080

8181
The following example removes the local secondary database *MyDb2* from its availability group.
8282

83-
```
83+
```sql
8484
ALTER DATABASE MyDb2 SET HADR OFF;
8585
GO
8686
```
@@ -94,9 +94,8 @@ manager: craigg
9494

9595
For example, the following command removes the secondary database `MyDb8` from the secondary replica hosted by the server instance named `SecondaryComputer\Instance`. Data synchronization to the removed secondary databases ceases. This command does not affect the primary database or any other secondary databases.
9696

97-
```
98-
Remove-SqlAvailabilityDatabase `
99-
-Path SQLSERVER:\Sql\SecondaryComputer\InstanceName\AvailabilityGroups\MyAg\Databases\MyDb8
97+
```powershell
98+
Remove-SqlAvailabilityDatabase -Path SQLSERVER:\Sql\SecondaryComputer\InstanceName\AvailabilityGroups\MyAg\Databases\MyDb8
10099
```
101100

102101
> [!NOTE]
@@ -125,5 +124,3 @@ manager: craigg
125124
## See Also
126125
[Overview of AlwaysOn Availability Groups &#40;SQL Server&#41;](overview-of-always-on-availability-groups-sql-server.md)
127126
[Remove a Primary Database from an Availability Group &#40;SQL Server&#41;](remove-a-primary-database-from-an-availability-group-sql-server.md)
128-
129-

docs/2014/database-engine/availability-groups/windows/remove-a-secondary-replica-from-an-availability-group-sql-server.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ manager: craigg
8686

8787
The following example removes a secondary replica from the *MyAG* availability group. The target secondary replica is located on a server instance named *HADR_INSTANCE* on a computer named *COMPUTER02*.
8888

89-
```
89+
```sql
9090
ALTER AVAILABILITY GROUP MyAG REMOVE REPLICA ON 'COMPUTER02\HADR_INSTANCE';
9191
```
9292

@@ -99,9 +99,8 @@ manager: craigg
9999

100100
For example, the following command removes the availability replica on the server `MyReplica` from the availability group named `MyAg`. This command must be run on the server instance that hosts the primary replica of the availability group.
101101

102-
```
103-
Remove-SqlAvailabilityReplica `
104-
-Path SQLSERVER:\SQL\PrimaryServer\InstanceName\AvailabilityGroups\MyAg\AvailabilityReplicas\MyReplica
102+
```powershell
103+
Remove-SqlAvailabilityReplica -Path SQLSERVER:\SQL\PrimaryServer\InstanceName\AvailabilityGroups\MyAg\AvailabilityReplicas\MyReplica
105104
```
106105

107106
> [!NOTE]
@@ -120,5 +119,3 @@ manager: craigg
120119
[Overview of AlwaysOn Availability Groups &#40;SQL Server&#41;](overview-of-always-on-availability-groups-sql-server.md)
121120
[Add a Secondary Replica to an Availability Group &#40;SQL Server&#41;](add-a-secondary-replica-to-an-availability-group-sql-server.md)
122121
[Remove an Availability Group &#40;SQL Server&#41;](remove-an-availability-group-sql-server.md)
123-
124-

docs/2014/database-engine/availability-groups/windows/remove-an-availability-group-listener-sql-server.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ manager: craigg
8181

8282
The following example deletes the listener of the `AccountsAG` availability group. The DNS name is AccountsAG_Listener.
8383

84-
```
84+
```sql
8585
ALTER AVAILABILITY GROUP AccountsAG REMOVE LISTENER 'AccountsAG_Listener';
8686
```
8787

@@ -92,9 +92,8 @@ manager: craigg
9292

9393
2. Use the built in `Remove-Item` cmdlet to remove a listener. For example, the following command removes a listener named `MyListener` from an availability group named `MyAg`.
9494

95-
```
96-
Remove-Item `
97-
SQLSERVER:\Sql\PrimaryServer\InstanceName\AvailabilityGroups\MyAg\AGListeners\MyListener
95+
```powershell
96+
Remove-Item SQLSERVER:\Sql\PrimaryServer\InstanceName\AvailabilityGroups\MyAg\AGListeners\MyListener
9897
```
9998

10099
> [!NOTE]
@@ -109,5 +108,3 @@ manager: craigg
109108
## See Also
110109
[Overview of AlwaysOn Availability Groups &#40;SQL Server&#41;](overview-of-always-on-availability-groups-sql-server.md)
111110
[Availability Group Listeners, Client Connectivity, and Application Failover &#40;SQL Server&#41;](../../listeners-client-connectivity-application-failover.md)
112-
113-

docs/2014/database-engine/availability-groups/windows/remove-an-availability-group-sql-server.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ manager: craigg
8787

8888
The following example deletes the `MyAG` availability group.
8989

90-
```
90+
```sql
9191
DROP AVAILABILITY GROUP MyAG;
9292
```
9393

@@ -102,9 +102,8 @@ manager: craigg
102102

103103
For example, the following command removes the availability group named `MyAg`. This command can be executed on any server instance that hosts an availability replica for the availability group.
104104

105-
```
106-
Remove-SqlAvailabilityGroup `
107-
-Path SQLSERVER:\Sql\Computer\Instance\AvailabilityGroups\MyAg
105+
```powershell
106+
Remove-SqlAvailabilityGroup -Path SQLSERVER:\Sql\Computer\Instance\AvailabilityGroups\MyAg
108107
```
109108

110109
> [!NOTE]
@@ -121,5 +120,3 @@ manager: craigg
121120
## See Also
122121
[Overview of AlwaysOn Availability Groups &#40;SQL Server&#41;](overview-of-always-on-availability-groups-sql-server.md)
123122
[Creation and Configuration of Availability Groups &#40;SQL Server&#41;](creation-and-configuration-of-availability-groups-sql-server.md)
124-
125-

0 commit comments

Comments
 (0)