Skip to content

Commit f44c76f

Browse files
authored
Merge pull request #111 from KelvinTegelaar/dev
[pull] dev from KelvinTegelaar:dev
2 parents 381fe54 + 7632547 commit f44c76f

File tree

19 files changed

+188
-241
lines changed

19 files changed

+188
-241
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,31 @@
1-
# Docs for the Azure Web Apps Deploy action: https://github.com/azure/functions-action
2-
# More GitHub Actions for Azure: https://github.com/Azure/actions
3-
4-
name: Build and deploy Powershell project to Azure Function App - cippjta72
5-
6-
on:
7-
push:
8-
branches:
9-
- dev
10-
workflow_dispatch:
11-
12-
env:
13-
AZURE_FUNCTIONAPP_PACKAGE_PATH: '.' # set this to the path to your web app project, defaults to the repository root
14-
15-
jobs:
16-
deploy:
17-
runs-on: windows-latest
18-
19-
steps:
20-
- name: 'Checkout GitHub Action'
21-
uses: actions/checkout@v4
22-
23-
- name: 'Run Azure Functions Action'
24-
uses: Azure/functions-action@v1
25-
id: fa
26-
with:
27-
app-name: 'cippjta72'
28-
slot-name: 'Production'
29-
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
30-
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_5B44448119C645C099EE192346D7433A }}
1+
# Docs for the Azure Web Apps Deploy action: https://github.com/azure/functions-action
2+
# More GitHub Actions for Azure: https://github.com/Azure/actions
3+
4+
name: dev_api
5+
6+
on:
7+
push:
8+
branches:
9+
- dev
10+
workflow_dispatch:
11+
12+
env:
13+
AZURE_FUNCTIONAPP_PACKAGE_PATH: '.' # set this to the path to your web app project, defaults to the repository root
14+
15+
jobs:
16+
deploy:
17+
if: github.event.repository.fork == false && github.event_name == 'push'
18+
runs-on: windows-latest
19+
20+
steps:
21+
- name: 'Checkout GitHub Action'
22+
uses: actions/checkout@v4
23+
24+
- name: 'Run Azure Functions Action'
25+
uses: Azure/functions-action@v1
26+
id: fa
27+
with:
28+
app-name: 'cippjta72'
29+
slot-name: 'Production'
30+
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
31+
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_5B44448119C645C099EE192346D7433A }}
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,31 @@
1-
# Docs for the Azure Web Apps Deploy action: https://github.com/azure/functions-action
2-
# More GitHub Actions for Azure: https://github.com/Azure/actions
3-
4-
name: Build and deploy Powershell project to Azure Function App - cippjta72-proc
5-
6-
on:
7-
push:
8-
branches:
9-
- dev
10-
workflow_dispatch:
11-
12-
env:
13-
AZURE_FUNCTIONAPP_PACKAGE_PATH: '.' # set this to the path to your web app project, defaults to the repository root
14-
15-
jobs:
16-
deploy:
17-
runs-on: windows-latest
18-
19-
steps:
20-
- name: 'Checkout GitHub Action'
21-
uses: actions/checkout@v4
22-
23-
- name: 'Run Azure Functions Action'
24-
uses: Azure/functions-action@v1
25-
id: fa
26-
with:
27-
app-name: 'cippjta72-proc'
28-
slot-name: 'Production'
29-
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
30-
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_A53AC5C52A55459DA0A3D8F1716638CB }}
1+
# Docs for the Azure Web Apps Deploy action: https://github.com/azure/functions-action
2+
# More GitHub Actions for Azure: https://github.com/Azure/actions
3+
4+
name: dev_api_proc
5+
6+
on:
7+
push:
8+
branches:
9+
- dev
10+
workflow_dispatch:
11+
12+
env:
13+
AZURE_FUNCTIONAPP_PACKAGE_PATH: '.' # set this to the path to your web app project, defaults to the repository root
14+
15+
jobs:
16+
deploy:
17+
if: github.event.repository.fork == false && github.event_name == 'push'
18+
runs-on: windows-latest
19+
20+
steps:
21+
- name: 'Checkout GitHub Action'
22+
uses: actions/checkout@v4
23+
24+
- name: 'Run Azure Functions Action'
25+
uses: Azure/functions-action@v1
26+
id: fa
27+
with:
28+
app-name: 'cippjta72-proc'
29+
slot-name: 'Production'
30+
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
31+
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_A53AC5C52A55459DA0A3D8F1716638CB }}

.github/workflows/dev_cipp44thq.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

.github/workflows/dev_cippbcaom.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

.github/workflows/dev_cippkwn4s-auditlog.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

.github/workflows/dev_cippkwn4s.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

CIPPTimers.json

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,29 @@
2828
{
2929
"Id": "44a40668-ed71-403c-8c26-b32e320086ad",
3030
"Command": "Start-AuditLogOrchestrator",
31-
"Description": "Orchestrator to process audit logs",
31+
"Description": "Orchestrator to download audit logs",
3232
"Cron": "0 */15 * * * *",
3333
"Priority": 2,
3434
"RunOnProcessor": true,
3535
"PreferredProcessor": "auditlog",
3636
"IsSystem": true
3737
},
38+
{
39+
"Id": "01cd512a-15c4-44a9-b8cb-1e5d879cfd2d",
40+
"Command": "Start-AuditLogProcessingOrchestrator",
41+
"Description": "Orchestrator to process audit logs",
42+
"Cron": "0 */15 * * * *",
43+
"Priority": 3,
44+
"RunOnProcessor": true,
45+
"PreferredProcessor": "auditlog",
46+
"IsSystem": true
47+
},
3848
{
3949
"Id": "03475c86-4314-4d7b-90f2-5a0639e3899b",
4050
"Command": "Start-AuditLogSearchCreation",
4151
"Description": "Timer to create audit log searches",
4252
"Cron": "0 */30 * * * *",
43-
"Priority": 3,
53+
"Priority": 4,
4454
"RunOnProcessor": true,
4555
"PreferredProcessor": "auditlog",
4656
"IsSystem": true

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Identity/Administration/Users/Invoke-EditUser.ps1

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Function Invoke-EditUser {
3434
#Edit the user
3535
try {
3636
Write-Host "$([boolean]$UserObj.MustChangePass)"
37-
$UserPrincipalName = "$($UserObj.Username ? $UserObj.username :$UserObj.mailNickname)@$($UserObj.Domain ? $UserObj.Domain : $UserObj.primDomain.value)"
37+
$UserPrincipalName = "$($UserObj.username)@$($UserObj.Domain ? $UserObj.Domain : $UserObj.primDomain.value)"
3838
$BodyToship = [pscustomobject] @{
3939
'givenName' = $UserObj.givenName
4040
'surname' = $UserObj.surname
@@ -181,6 +181,14 @@ Function Invoke-EditUser {
181181
$null = $results.Add("Success. Set $($UserObj.DisplayName)'s manager to $($Request.body.setManager.label)")
182182
}
183183

184+
if ($Request.body.setSponsor.value) {
185+
$SponsorBody = [PSCustomObject]@{'@odata.id' = "https://graph.microsoft.com/beta/users/$($Request.body.setSponsor.value)" }
186+
$SponsorBodyJSON = ConvertTo-Json -Compress -Depth 10 -InputObject $SponsorBody
187+
$null = New-GraphPostRequest -uri "https://graph.microsoft.com/beta/users/$($UserObj.id)/sponsors/`$ref" -tenantid $UserObj.tenantFilter -type POST -body $SponsorBodyJSON -Verbose
188+
Write-LogMessage -headers $Request.Headers -API $ApiName -tenant $UserObj.tenantFilter -message "Set $($UserObj.DisplayName)'s sponsor to $($Request.body.setSponsor.label)" -Sev Info
189+
$null = $results.Add("Success. Set $($UserObj.DisplayName)'s sponsor to $($Request.body.setSponsor.label)")
190+
}
191+
184192
if ($RemoveFromGroups) {
185193
$RemoveFromGroups | ForEach-Object {
186194

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Identity/Administration/Users/Invoke-ListUsers.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Function Invoke-ListUsers {
2020
$userid = $Request.Query.UserID
2121

2222
$GraphRequest = if ($TenantFilter -ne 'AllTenants') {
23-
New-GraphGetRequest -uri "https://graph.microsoft.com/beta/users/$($userid)?`$top=999&`$filter=$GraphFilter&`$count=true" -tenantid $TenantFilter -ComplexFilter | ForEach-Object {
23+
New-GraphGetRequest -uri "https://graph.microsoft.com/beta/users/$($userid)?`$top=999&`$filter=$GraphFilter&`$count=true&`$expand=manager(`$select=id,userPrincipalName,displayName)" -tenantid $TenantFilter -ComplexFilter | ForEach-Object {
2424
$_ | Add-Member -MemberType NoteProperty -Name 'onPremisesSyncEnabled' -Value ([bool]($_.onPremisesSyncEnabled)) -Force
2525
$_ | Add-Member -MemberType NoteProperty -Name 'username' -Value ($_.userPrincipalName -split '@' | Select-Object -First 1) -Force
2626
$_ | Add-Member -MemberType NoteProperty -Name 'Aliases' -Value ($_.ProxyAddresses -join ', ') -Force

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Tenant/Administration/Tenant/Invoke-ListTenants.ps1

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Function Invoke-ListTenants {
4141
Push-OutputBinding -Name Response -Value ([HttpResponseContext]@{
4242
StatusCode = [HttpStatusCode]::OK
4343
Body = @{
44-
Results = @($GraphRequest)
44+
Results = @($GraphRequest)
4545
Metadata = @{
4646
Details = $Results
4747
}
@@ -93,6 +93,19 @@ Function Invoke-ListTenants {
9393
} else {
9494
$Body = $Tenants
9595
}
96+
if ($Request.Query.Mode -eq 'TenantList') {
97+
# add portal link properties
98+
$Body = $Body | Select-Object *, @{Name = 'portal_m365'; Expression = { "https://admin.microsoft.com/Partner/BeginClientSession.aspx?CTID=$($_.customerId)&CSDEST=o365admincenter" } },
99+
@{Name = 'portal_exchange'; Expression = { "https://admin.exchange.microsoft.com/?landingpage=homepage&form=mac_sidebar&delegatedOrg=$($_.defaultDomainName)" } },
100+
@{Name = 'portal_entra'; Expression = { "https://entra.microsoft.com/$($_.defaultDomainName)" } },
101+
@{Name = 'portal_teams'; Expression = { "https://admin.teams.microsoft.com/?delegatedOrg=$($_.defaultDomainName)" } },
102+
@{Name = 'portal_azure'; Expression = { "https://portal.azure.com/$($_.defaultDomainName)" } },
103+
@{Name = 'portal_intune'; Expression = { "https://intune.microsoft.com/$($_.defaultDomainName)" } },
104+
@{Name = 'portal_security'; Expression = { "https://security.microsoft.com/?tid=$($_.customerId)" } },
105+
@{Name = 'portal_compliance'; Expression = { "https://purview.microsoft.com/?tid=$($_.customerId)" } },
106+
@{Name = 'portal_sharepoint'; Expression = { "https://admin.microsoft.com/Partner/beginclientsession.aspx?CTID=$($_.customerId)&CSDEST=SharePoint" } }
107+
}
108+
96109
} else {
97110
$body = $Tenants | Where-Object -Property defaultDomainName -EQ $Tenantfilter
98111
}

0 commit comments

Comments
 (0)