Skip to content

Commit 0948a69

Browse files
authored
Merge pull request #658 from arakeshmicrosoft/BillingPolicy
New cmdlets to Add, Retrieve and Delete Billing Policies owned by the tenant
2 parents 8158c20 + b5aeca3 commit 0948a69

File tree

3 files changed

+277
-0
lines changed

3 files changed

+277
-0
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
external help file: sharepointonline.xml
3+
Module Name: Microsoft.Online.SharePoint.PowerShell
4+
online version: https://learn.microsoft.com/powershell/module/sharepoint-online/Get-SPOAppBillingPolicies
5+
applicable: SharePoint Online
6+
title: Get-SPOAppBillingPolicies
7+
schema: 2.0.0
8+
author: arakesh
9+
ms.author: arakesh
10+
ms.reviewer:
11+
---
12+
# Get-SPOAppBillingPolicies
13+
14+
## SYNOPSIS
15+
16+
Returns billing policies that are owned by the tenant.
17+
18+
## SYNTAX
19+
20+
```powershell
21+
Get-SPOAppBillingPolicies
22+
```
23+
24+
## DESCRIPTION
25+
26+
Get-SPOAppBillingPolicies returns a list of billing policies that are owned by the tenant. If the tenant has no billing policies associated, the cmdlet will produce no output.
27+
28+
The output of this cmdlet will include information related to the billing policy such as Application Id, Azure subscription ID, Resource Group, Region, State of the subscription and the usage charging model.
29+
30+
You must be a SharePoint Administrator to run this cmdlet.
31+
32+
> [!NOTE]
33+
> To use the Get-SPOAppBillingPolicies cmdlet, an admin must authenticate to SharePoint Online using modern authentication.
34+
>
35+
> Use the **Connect-SPOService** cmdlet shown below, which will prompt you to enter your credentials. If multi-factor authentication (MFA) is enabled, you will need to complete the MFA process (e.g., entering a verification code sent to your phone).
36+
>
37+
> `Connect-SPOService -Url https://(your-tenant)-admin.sharepoint.com`
38+
>
39+
> Replace (your-tenant) with your actual SharePoint Online domain, e.g. `https://contoso-admin.sharepoint.com. `
40+
41+
## EXAMPLES
42+
43+
### Example 1
44+
45+
```powershell
46+
47+
Get-SPOAppBillingPolicies
48+
49+
```
50+
51+
## RELATED LINKS
52+
53+
[Getting started with SharePoint Online Management Shell](/powershell/sharepoint/sharepoint-online/connect-sharepoint-online?view=sharepoint-ps)
Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
---
2+
external help file: sharepointonline.xml
3+
Module Name: Microsoft.Online.SharePoint.PowerShell
4+
online version: https://learn.microsoft.com/powershell/module/sharepoint-online/New-SPOAppBillingPolicy
5+
applicable: SharePoint Online
6+
title: New-SPOAppBillingPolicy
7+
schema: 2.0.0
8+
author: arakesh
9+
ms.author: arakesh
10+
ms.reviewer:
11+
---
12+
# New-SPOAppBillingPolicy
13+
14+
## SYNOPSIS
15+
16+
Creates a new billing policy for an application owned by the tenant.
17+
18+
## SYNTAX
19+
20+
```powershell
21+
22+
New-SPOAppBillingPolicy
23+
[[-ApplicationId] <ApplicationId>]
24+
[[-AzureSubscriptionId] <AzureSubscriptionID>]
25+
[[-ResourceGroup] <ResourceGroup>]
26+
[[-AzureRegion] <AzureRegion>]
27+
[[-UsageCharges] <UsageCharges>]
28+
```
29+
30+
## DESCRIPTION
31+
32+
This cmdlet creates a new billing policy for an application that is owned by the tenant running the cmdlet.
33+
34+
You must be a SharePoint Administrator to run this cmdlet.
35+
36+
> [!NOTE]
37+
> To use the New-SPOAppBillingPolicy cmdlet, an admin must authenticate to SharePoint Online using modern authentication.
38+
>
39+
> Use the **Connect-SPOService** cmdlet shown below, which will prompt you to enter your credentials. If multi-factor authentication (MFA) is enabled, you will need to complete the MFA process (e.g., entering a verification code sent to your phone).
40+
>
41+
>
42+
> `Connect-SPOService -Url https://(your-tenant)-admin.sharepoint.com`
43+
>
44+
> Replace (your-tenant) with your actual SharePoint Online domain, e.g. `https://contoso-admin.sharepoint.com.`
45+
46+
## EXAMPLES
47+
48+
### Example 1
49+
50+
```powershell
51+
52+
New-SPOAppBillingPolicy -ApplicationId 50785fde-3082-47ac-a36d-06282ac5c7da -AzureSubscriptionId c7170373-eb8d-4984-8cc9-59bcc88c65a0 -ResouceGroup "SPOPAYG" -AzureRegion "Uk-South" -UsageCharges AppOwnerIsCharged
53+
54+
```
55+
### Example 2
56+
57+
```powershell
58+
59+
New-SPOAppBillingPolicy -ApplicationId 50785fde-3082-47ac-a36d-06282ac5c7da -AzureSubscriptionId c7170373-eb8d-4984-8cc9-59bcc88c65a0 -ResouceGroup "SPOPAYG" -AzureRegion "Uk-South" -UsageCharges ConsumingTenantOfTheAppisCharged
60+
61+
```
62+
## PARAMETERS
63+
64+
### -ApplicationID
65+
66+
This parameter specifies the ID of the application.
67+
68+
```yaml
69+
Type: GUID
70+
Parameter Sets: (All)
71+
Aliases:
72+
Applicable: SharePoint Online
73+
74+
Required: True
75+
Position: Named
76+
Default value: None
77+
Accept pipeline input: False
78+
Accept wildcard characters: False
79+
```
80+
81+
### -AzureSubscriptionId
82+
83+
The unique identifier of the Azure Active Directory profile (Microsoft Entra ID) for billing purposes.
84+
85+
```yaml
86+
Type: GUID
87+
Parameter Sets: Standard
88+
Aliases:
89+
Applicable: SharePoint Online
90+
91+
Required: True
92+
Position: Named
93+
Default value: None
94+
Accept pipeline input: False
95+
Accept wildcard characters: False
96+
```
97+
98+
### -ResourceGroup
99+
100+
Resource Group Name associated with the Azure Subscription
101+
102+
```yaml
103+
Type: String
104+
Parameter Sets: Standard
105+
Aliases:
106+
Applicable: SharePoint Online
107+
108+
Required: True
109+
Position: Named
110+
Default value: None
111+
Accept pipeline input: False
112+
Accept wildcard characters: False
113+
```
114+
115+
### -AzureRegion
116+
117+
The region of the Azure Subscription.
118+
119+
```yaml
120+
Type: String
121+
Parameter Sets: Standard
122+
Aliases:
123+
Applicable: SharePoint Online
124+
125+
Required: True
126+
Position: Named
127+
Default value: None
128+
Accept pipeline input: False
129+
Accept wildcard characters: False
130+
```
131+
132+
### -UsageCharges
133+
134+
This parameters determined who is charged for the usage of the application. This parameter supports two values - AppOwnerIsCharged or ConsumingTenantoftheAppischarged.
135+
- AppOwnerIsCharged : The tenant owning the application is charged for the usage
136+
- ConsumingTenantoftheAppischarged : The tenant using the application is charged for the usage.
137+
138+
```yaml
139+
Type: Switch
140+
Parameter Sets: All
141+
Aliases:
142+
Applicable: SharePoint Online
143+
144+
Required: True
145+
Position: Named
146+
Default value: None
147+
Accept pipeline input: False
148+
Accept wildcard characters: False
149+
```
150+
## RELATED LINKS
151+
152+
[Getting started with SharePoint Online Management Shell](/powershell/sharepoint/sharepoint-online/connect-sharepoint-online?view=sharepoint-ps)
153+
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
external help file: sharepointonline.xml
3+
Module Name: Microsoft.Online.SharePoint.PowerShell
4+
online version: https://learn.microsoft.com/powershell/module/sharepoint-online/Remove-SPOAppBillingPolicy
5+
applicable: SharePoint Online
6+
title: Remove-SPOAppBillingPolicy
7+
schema: 2.0.0
8+
author: arakesh
9+
ms.author: arakesh
10+
ms.reviewer:
11+
---
12+
# Remove-SPOAppBillingPolicy
13+
14+
## SYNOPSIS
15+
16+
Removes billing policy asscoiated with the application.
17+
18+
## SYNTAX
19+
20+
```powershell
21+
22+
Remove-SPOAppBillingPolicy [[-ApplicationId] <ApplicationId>]
23+
```
24+
25+
## DESCRIPTION
26+
27+
Remove-SPOAppBillingPolicy removes the billing policy associated with the application.
28+
29+
You must be a SharePoint Administrator to run this cmdlet.
30+
31+
> [!NOTE]
32+
> To use the Remove-SPOAppBillingPolicy cmdlet, an admin must authenticate to SharePoint Online using modern authentication.
33+
>
34+
> Use the **Connect-SPOService** cmdlet shown below, which will prompt you to enter your credentials. If multi-factor authentication (MFA) is enabled, you will need to complete the MFA process (e.g., entering a verification code sent to your phone).
35+
>
36+
>
37+
> `Connect-SPOService -Url https://(your-tenant)-admin.sharepoint.com`
38+
>
39+
> Replace (your-tenant) with your actual SharePoint Online domain, e.g. `https://contoso-admin.sharepoint.com.`
40+
41+
## EXAMPLES
42+
43+
### Example 1
44+
45+
```powershell
46+
47+
Remove-SPOAppBillingPolicy -ApplicationId 1653hhd-87100luhw-786265gk-00asa00
48+
49+
```
50+
## PARAMETERS
51+
52+
### -ApplicationID
53+
54+
This parameter specifies the ID of the application.
55+
56+
```yaml
57+
Type: GUID
58+
Parameter Sets: (All)
59+
Aliases:
60+
Applicable: SharePoint Online
61+
62+
Required: True
63+
Position: Named
64+
Default value: None
65+
Accept pipeline input: False
66+
Accept wildcard characters: False
67+
```
68+
69+
## RELATED LINKS
70+
71+
[Getting started with SharePoint Online Management Shell](/powershell/sharepoint/sharepoint-online/connect-sharepoint-online?view=sharepoint-ps)

0 commit comments

Comments
 (0)