Skip to content

Commit 5080787

Browse files
Merge branch 'main' into enganga/usability-params-for-beta
2 parents 58c8b54 + f29bc24 commit 5080787

11 files changed

+527
-2
lines changed

module/Entra/config/ModuleMetadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@
3030
"Entra"
3131
],
3232
"releaseNotes": "See https://github.com/microsoftgraph/entra-powershell.",
33-
"version": "0.18.0",
33+
"version": "0.19.0",
3434
"Prerelease": "preview"
3535
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# ------------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All Rights Reserved.
3+
# Licensed under the MIT License. See License in the project root for license information.
4+
# ------------------------------------------------------------------------------
5+
6+
function Enable-EntraBetaGlobalSecureAccessTenant {
7+
PROCESS {
8+
$customHeaders = New-EntraBetaCustomHeaders -Command $MyInvocation.MyCommand
9+
$response = Invoke-GraphRequest -Method POST -Headers $customHeaders -OutputType PSObject -Uri "https://graph.microsoft.com/beta/networkAccess/microsoft.graph.networkaccess.onboard"
10+
$response
11+
}
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# ------------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All Rights Reserved.
3+
# Licensed under the MIT License. See License in the project root for license information.
4+
# ------------------------------------------------------------------------------
5+
6+
function Get-EntraBetaGlobalSecureAccessTenantStatus {
7+
PROCESS {
8+
$customHeaders = New-EntraBetaCustomHeaders -Command $MyInvocation.MyCommand
9+
$response = Invoke-GraphRequest -Method GET -Headers $customHeaders -OutputType PSObject -Uri "https://graph.microsoft.com/beta/networkAccess/tenantStatus"
10+
$response
11+
}
12+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# ------------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All Rights Reserved.
3+
# Licensed under the MIT License. See License in the project root for license information.
4+
# ------------------------------------------------------------------------------
5+
6+
function Get-EntraBetaPrivateAccessApplication {
7+
8+
[CmdletBinding(DefaultParameterSetName = 'AllPrivateAccessApps')]
9+
param (
10+
[Alias("ObjectId")]
11+
[Parameter(Mandatory = $True, Position = 1, ParameterSetName = 'SingleAppID')]
12+
[string]
13+
$ApplicationId,
14+
15+
[Parameter(Mandatory = $False, ParameterSetName = 'SingleAppName')]
16+
[string]
17+
$ApplicationName
18+
)
19+
20+
PROCESS {
21+
$customHeaders = New-EntraBetaCustomHeaders -Command $MyInvocation.MyCommand
22+
23+
switch ($PSCmdlet.ParameterSetName) {
24+
"AllPrivateAccessApps" {
25+
$response = Invoke-GraphRequest -Method GET -Headers $customHeaders -OutputType PSObject -Uri 'https://graph.microsoft.com/beta/applications?$count=true&$select=displayName,appId,id,tags,createdDateTime,servicePrincipalType,createdDateTime,servicePrincipalNames&$filter=tags/Any(x: x eq ''PrivateAccessNonWebApplication'') or tags/Any(x: x eq ''NetworkAccessManagedApplication'') or tags/Any(x: x eq ''NetworkAccessQuickAccessApplication'')'
26+
$response.value
27+
break
28+
}
29+
"SingleAppID" {
30+
Invoke-GraphRequest -Method GET -Headers $customHeaders -OutputType PSObject -Uri "https://graph.microsoft.com/beta/applications/$ApplicationId/?`$select=displayName,appId,id,tags,createdDateTime,servicePrincipalType,createdDateTime,servicePrincipalNames"
31+
break
32+
}
33+
"SingleAppName" {
34+
$response = Invoke-GraphRequest -Method GET -Headers $customHeaders -OutputType PSObject -Uri "https://graph.microsoft.com/beta/applications?`$count=true&`$select=displayName,appId,id,tags,createdDateTime,servicePrincipalType,createdDateTime,servicePrincipalNames&`$filter=DisplayName eq '$ApplicationName'"
35+
$response.value
36+
break
37+
}
38+
}
39+
}
40+
}

module/EntraBeta/AdditionalFunctions/Get-EntraBetaPrivateAccessApplicationSegment.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# ------------------------------------------------------------------------------
22
# Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
33
# ------------------------------------------------------------------------------
4+
45
function Get-EntraBetaPrivateAccessApplicationSegment {
56

67
[CmdletBinding(DefaultParameterSetName = 'AllApplicationSegments')]
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# ------------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All Rights Reserved.
3+
# Licensed under the MIT License. See License in the project root for license information.
4+
# ------------------------------------------------------------------------------
5+
6+
function New-EntraBetaPrivateAccessApplication {
7+
8+
[CmdletBinding(DefaultParameterSetName = 'AllPrivateAccessApps')]
9+
param (
10+
[Parameter(Mandatory = $True, Position = 1)]
11+
[string]
12+
$ApplicationName,
13+
14+
[Parameter(Mandatory = $False, Position = 2)]
15+
[string]
16+
$ConnectorGroupId
17+
)
18+
19+
PROCESS {
20+
$customHeaders = New-EntraBetaCustomHeaders -Command $MyInvocation.MyCommand
21+
22+
$bodyJson = @{ displayName = $ApplicationName } | ConvertTo-Json -Depth 99 -Compress
23+
24+
# Instantiate the Private Access app
25+
try {
26+
$newApp = Invoke-GraphRequest -Method POST -Headers $customHeaders -Uri 'https://graph.microsoft.com/beta/applicationTemplates/8adf8e6e-67b2-4cf2-a259-e3dc5476c621/instantiate' -Body $bodyJson
27+
}
28+
catch {
29+
Write-Error "Failed to create the Private Access app. Error: $_"
30+
return
31+
}
32+
33+
$bodyJson = @{
34+
"onPremisesPublishing" = @{
35+
"applicationType" = "nonwebapp"
36+
"isAccessibleViaZTNAClient" = $true
37+
}
38+
} | ConvertTo-Json -Depth 99 -Compress
39+
40+
$newAppId = $newApp.application.objectId
41+
42+
# Set the Private Access app to be accessible via the ZTNA client
43+
$params = @{
44+
Method = 'PATCH'
45+
Uri = "https://graph.microsoft.com/beta/applications/$newAppId/"
46+
Body = $bodyJson
47+
}
48+
49+
Invoke-GraphRequest @params
50+
51+
# If ConnectorGroupId has been specified, assign the connector group to the app, otherwise the default connector group will be assigned.
52+
if ($ConnectorGroupId) {
53+
$bodyJson = @{
54+
"@odata.id" = "https://graph.microsoft.com/beta/onPremisesPublishingProfiles/applicationproxy/connectorGroups/$ConnectorGroupId"
55+
} | ConvertTo-Json -Depth 99 -Compress
56+
57+
$params = @{
58+
Method = 'PUT'
59+
Uri = "https://graph.microsoft.com/beta/applications/$newAppId/connectorGroup/`$ref"
60+
Body = $bodyJson
61+
}
62+
63+
Invoke-GraphRequest @params
64+
}
65+
}
66+
}

module/EntraBeta/config/ModuleMetadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@
3131
"Entra"
3232
],
3333
"releaseNotes": "See https://github.com/microsoftgraph/entra-powershell.",
34-
"version": "0.18.0",
34+
"version": "0.19.0",
3535
"Prerelease": "preview"
3636
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
---
2+
title: Enable-EntraBetaGlobalSecureAccessTenant
3+
description: This article provides details on the Enable-EntraBetaGlobalSecureAccessTenant command.
4+
5+
ms.topic: reference
6+
ms.date: 10/31/2024
7+
ms.author: eunicewaweru
8+
ms.reviewer: stevemutungi
9+
manager: CelesteDG
10+
author: andres-canello
11+
external help file: Microsoft.Graph.Entra.Beta-Help.xml
12+
Module Name: Microsoft.Graph.Entra.Beta
13+
online version:
14+
schema: 2.0.0
15+
---
16+
17+
# Enable-EntraBetaGlobalSecureAccessTenant
18+
19+
## Synopsis
20+
21+
Onboard the Global Secure Access service in the tenant.
22+
23+
## Description
24+
25+
The `Enable-EntraBetaGlobalSecureAccessTenant` cmdlet onboards the Global Secure Access service in the tenant.
26+
27+
In delegated scenarios with work or school accounts, the signed-in user needs a supported Microsoft Entra role or a custom role with the necessary permissions:
28+
29+
- Global Secure Access Administrator
30+
- Security Administrator
31+
32+
## Examples
33+
34+
### Example 1: Enable Global Secure Access for a tenant
35+
36+
```powershell
37+
Connect-Entra -Scopes 'NetworkAccessPolicy.ReadWrite.All', 'Application.ReadWrite.All', 'NetworkAccess.ReadWrite.All'
38+
Enable-EntraBetaGlobalSecureAccessTenant
39+
```
40+
41+
```Output
42+
@odata.context : https://graph.microsoft.com/beta/$metadata#networkAccess/tenantStatus/$entity
43+
onboardingStatus : onboarded
44+
onboardingErrorMessage :
45+
```
46+
47+
This command onboards the Global Secure Access service in the tenant.
48+
49+
### CommonParameters
50+
51+
This cmdlet supports the common parameters: `-Debug`, `-ErrorAction`, `-ErrorVariable`, `-InformationAction`, `-InformationVariable`, `-OutVariable`, `-OutBuffer`, `-PipelineVariable`, `-Verbose`, `-WarningAction`, and `-WarningVariable`. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
52+
53+
## Inputs
54+
55+
### System.String
56+
57+
System.Nullable\`1\[\[System. Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\]\] System.Nullable\`1\[\[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\]\]
58+
59+
## Outputs
60+
61+
### System.Object
62+
63+
## Notes
64+
65+
## RELATED LINKS
66+
67+
[Get-EntraBetaGlobalSecureAccessTenantStatus](Get-EntraBetaGlobalSecureAccessTenantStatus.md)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
---
2+
title: Get-EntraBetaGlobalSecureAccessTenantStatus
3+
description: This article provides details on the Get-EntraBetaGlobalSecureAccessTenantStatus command.
4+
5+
ms.topic: reference
6+
ms.date: 10/19/2024
7+
ms.author: eunicewaweru
8+
ms.reviewer: stevemutungi
9+
manager: CelesteDG
10+
author: andres-canello
11+
external help file: Microsoft.Graph.Entra.Beta-Help.xml
12+
Module Name: Microsoft.Graph.Entra.Beta
13+
online version:
14+
schema: 2.0.0
15+
---
16+
17+
# Get-EntraBetaGlobalSecureAccessTenantStatus
18+
19+
## Synopsis
20+
21+
Retrieves the onboarding status of the Global Secure Access service in the tenant.
22+
23+
## Description
24+
25+
The `Get-EntraBetaGlobalSecureAccessTenantStatus` cmdlet retrieves the onboarding status of the Global Secure Access service in the tenant.
26+
27+
For delegated scenarios involving work or school accounts, the signed-in user must have either a supported Microsoft Entra role or a custom role with the necessary permissions. The following least-privileged roles are supported for this operation:
28+
29+
- Global Reader
30+
- Global Secure Access Administrator
31+
- Security Administrator
32+
33+
## Examples
34+
35+
### Example 1: Check Global Secure Access status for the tenant
36+
37+
```powershell
38+
Connect-Entra -Scopes 'NetworkAccessPolicy.ReadWrite.All', 'Application.ReadWrite.All', 'NetworkAccess.ReadWrite.All'
39+
Get-EntraBetaGlobalSecureAccessTenantStatus
40+
```
41+
42+
```Output
43+
@odata.context onboardingStatus onboardingErrorMessage
44+
-------------- ---------------- ----------------------
45+
https://graph.microsoft.com/beta/$metadata#networkAccess/tenantStatus/$entity offboarded
46+
```
47+
48+
This command checks if the Global Secure Access service is activated in the tenant.
49+
50+
If the status is `offboarded`, you can activate the service with `New-EntraBetaGlobalSecureAccessTenant`.
51+
52+
The onboarding status can be: `offboarded`, `offboarding in progress`, `onboarding in progress`, `onboarded`, `onboarding error`, or `offboarding error`.
53+
54+
### CommonParameters
55+
56+
This cmdlet supports the common parameters: `-Debug`, `-ErrorAction`, `-ErrorVariable`, `-InformationAction`, `-InformationVariable`, `-OutVariable`, `-OutBuffer`, `-PipelineVariable`, `-Verbose`, `-WarningAction`, and `-WarningVariable`. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
57+
58+
## Inputs
59+
60+
### System.String
61+
62+
System.Nullable\`1\[\[System. Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\]\] System.Nullable\`1\[\[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\]\]
63+
64+
## Outputs
65+
66+
### System.Object
67+
68+
## Notes
69+
70+
## RELATED LINKS
71+
72+
[Get-EntraBetaApplication](Get-EntraBetaApplication.md)
73+
74+
[Get-EntraBetaPrivateAccessApplicationSegment](Get-EntraBetaPrivateAccessApplicationSegment.md)
75+
76+
[Remove-EntraBetaPrivateAccessApplicationSegment](Remove-EntraBetaPrivateAccessApplicationSegment.md)
77+
78+
[New-EntraBetaPrivateAccessApplicationSegment](New-EntraBetaPrivateAccessApplicationSegment.md)

0 commit comments

Comments
 (0)