Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add: existing email app parameter set #5

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
e7bd25c
add: existing email app parameter set
DrIOSX Mar 11, 2025
55942d3
fix: formatting
DrIOSX Mar 12, 2025
90b9cb4
fix: refactor calls
DrIOSX Mar 12, 2025
ff5a720
fix: remove -confirm from connect function
DrIOSX Mar 12, 2025
33d33e6
add: Todo
DrIOSX Mar 12, 2025
309527e
fix: Existing app output params
DrIOSX Mar 12, 2025
c92f2b3
add: Helper file to gitignore
DrIOSX Mar 12, 2025
6a2a82a
add: confirm to high for connect function
DrIOSX Mar 12, 2025
aaf03f3
fix: manual app call for sending email
DrIOSX Mar 12, 2025
2cfa118
docs: Update Changelog
DrIOSX Mar 12, 2025
54f1d92
add: private functions and updated docs
DrIOSX Mar 12, 2025
a129e53
Update Help XML for Cmdlets
DrIOSX Mar 14, 2025
9564a09
Refactor Connect-TkMsService Unit Tests
DrIOSX Mar 14, 2025
f90bea2
Refactor ConvertTo-ParameterSplat Unit Tests
DrIOSX Mar 14, 2025
2fd4a4f
Update Initialize-TkAppAuthCertificate Unit Tests
DrIOSX Mar 14, 2025
a219171
Refactor Initialize-TkAppSpRegistration Unit Tests
DrIOSX Mar 14, 2025
2a41592
Update Initialize-TkModuleEnv Unit Tests
DrIOSX Mar 14, 2025
1f3cf64
Remove Redundant Tests for New-TkAppName and TkRequiredResourcePermis…
DrIOSX Mar 14, 2025
9c153f8
Add and Update New-TkAppRegistration and New-TkExchangeEmailAppPolicy…
DrIOSX Mar 14, 2025
fe85755
Update Set-TkJsonSecret Unit Tests
DrIOSX Mar 14, 2025
337946a
Add/Update Test-IsAdmin and Write-AuditLog Unit Tests
DrIOSX Mar 14, 2025
c9bd19f
Add New Private Functions & Their Tests
DrIOSX Mar 14, 2025
8ea1c84
fix: aligned and refactored formatting
DrIOSX Mar 14, 2025
6b5dd30
docs: update README with revised formatting and content
DrIOSX Mar 14, 2025
48735cc
docs: update wiki
DrIOSX Mar 14, 2025
2310dc1
docs: update CHANGELOG
DrIOSX Mar 14, 2025
b5e065f
add: switch to not use domain suffix
DrIOSX Mar 14, 2025
0775aa1
add: certname as parameter and update permissions in comment help
DrIOSX Mar 14, 2025
48288d9
fix: connect shouldprocess to show correct scopes
DrIOSX Mar 14, 2025
e0b9904
add: Permissions needed to comment-help block
DrIOSX Mar 14, 2025
35bb8ca
docs: update CHANGELOG
DrIOSX Mar 14, 2025
3ae453d
docs: Update Wiki and Docs
DrIOSX Mar 14, 2025
26bcb79
docs: Update CHANGELOG
DrIOSX Mar 14, 2025
b17c9ab
fix: Exo shouldprocess output
DrIOSX Mar 14, 2025
96b5820
fix: client certificate subject output
DrIOSX Mar 14, 2025
2700824
fix: Scenario 1 vault and manual params
DrIOSX Mar 14, 2025
27a4c4d
fix: context object in connect
DrIOSX Mar 14, 2025
704d6b5
fix: all scenarios working for email
DrIOSX Mar 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ output/
*.local.*
!**/README.md
.kitchen/

/scripts/
*.nupkg
*.suo
*.user
Expand All @@ -16,3 +16,5 @@ markdownissues.txt
node_modules
package-lock.json
ZZBuild-Help.ps1
test1.ps1
helpdoc.ps1
27 changes: 26 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,31 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Added cert options to the GraphAppToolkit send email.
- Updated auth methods to invoke needed permissions only.
- Added private functions to handle existing certs and secrets.
- Added support for -WhatIf and -Confirm parameters to cmdlets.
- Renamed private function "New-TkAppName" to "Initialize-TkAppName".
- Renamed private function "New-TkRequiredResourcePermissionObject" to "Initialize-TkRequiredResourcePermissionObject".
- Updated documentation across the module (README.md, help XML files, and about_GraphAppToolkit.help.txt).
- Enhanced logging in private functions for improved auditability.
- Switch parameter for removing domain suffix from the app name.
- Certificate subject to param splat export.
- Permissions to comment based help.
- Initial test cases structure for Pester with rudimentary tests.

### Fixed

- Fixed formatting.
- Manual app call for sending email.
- Confirm to high for connect function.
- Corrected parameter block formatting and alignment issues in multiple cmdlets.
- Fixed Connect function ShouldProcess output.

## [0.1.2] - 2025-03-11

### Added

- Added class definitions for GraphAppToolkit

## [0.1.1] - 2025-03-10
Expand All @@ -27,4 +52,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Initial release of GraphAppToolkit
- Initial release of GraphAppToolkit
300 changes: 217 additions & 83 deletions README.md

Large diffs are not rendered by default.

100 changes: 53 additions & 47 deletions README2.md

Large diffs are not rendered by default.

250 changes: 155 additions & 95 deletions docs/index.html

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions help/GraphAppToolkit.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
Module Name: GraphAppToolkit
Module Guid: b5426317-5612-4483-b664-beafc448bc2f
Download Help Link: {{ Update Download Link }}
Expand All @@ -8,22 +8,22 @@ Locale: en-US

# GraphAppToolkit Module
## Description
{{ Fill in the Description }}
The GraphAppToolkit module provides a collection of PowerShell functions to automate the management of Azure AD (Entra ID) application registrations. It streamlines the deployment of Microsoft Graph-powered applications, focusing on app-only authentication using certificates, secure credential storage, and operational automation. This module is designed to: - Enable certificate-based authentication for Microsoft Graph applications. - Simplify email sending from service principals. - Automate Intune (MEM) policy management . - Deploy M365 audit apps with read-write permissions. - Securely manage mail-enabled security groups for restricted send scenarios. GraphAppToolkit is ideal for IT admins, security engineers, and DevOps teams managing Microsoft 365 and Entra ID workloads.

## GraphAppToolkit Cmdlets
### [New-MailEnabledSendingGroup](New-MailEnabledSendingGroup.md)
### [New-MailEnabledSendingGroup](New-MailEnabledSendingGroup)
Creates or retrieves a mail-enabled security group with a custom or default domain.

### [Publish-TkEmailApp](Publish-TkEmailApp.md)
### [Publish-TkEmailApp](Publish-TkEmailApp)
Deploys a new Microsoft Graph Email app and associates it with a certificate for app-only authentication.

### [Publish-TkM365AuditApp](Publish-TkM365AuditApp.md)
### [Publish-TkM365AuditApp](Publish-TkM365AuditApp)
Publishes (creates) a new M365 Audit App registration in Entra ID (Azure AD) with a specified certificate.

### [Publish-TkMemPolicyManagerApp](Publish-TkMemPolicyManagerApp.md)
### [Publish-TkMemPolicyManagerApp](Publish-TkMemPolicyManagerApp)
Publishes a new MEM (Intune) Policy Manager App in Azure AD with read-only or read-write permissions.

### [Send-TkEmailAppMessage](Send-TkEmailAppMessage.md)
### [Send-TkEmailAppMessage](Send-TkEmailAppMessage)
Sends an email using the Microsoft Graph API, either by retrieving app credentials from a local vault
or by specifying them manually.

34 changes: 32 additions & 2 deletions help/New-MailEnabledSendingGroup.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ Creates or retrieves a mail-enabled security group with a custom or default doma
### CustomDomain (Default)
```
New-MailEnabledSendingGroup -Name <String> [-Alias <String>] -PrimarySmtpAddress <String>
[-ProgressAction <ActionPreference>] [<CommonParameters>]
[-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]
```

### DefaultDomain
```
New-MailEnabledSendingGroup -Name <String> [-Alias <String>] -DefaultDomain <String>
[-ProgressAction <ActionPreference>] [<CommonParameters>]
[-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -109,6 +109,36 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Confirm
Prompts you for confirmation before running the cmdlet.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -ProgressAction
{{ Fill ProgressAction Description }}

Expand Down
106 changes: 68 additions & 38 deletions help/Publish-TkEmailApp.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,19 @@ Deploys a new Microsoft Graph Email app and associates it with a certificate for

## SYNTAX

### CreateNewApp (Default)
```
Publish-TkEmailApp [-AppPrefix] <String> [-AuthorizedSenderUserName] <String>
[-MailEnabledSendingGroup] <String> [[-CertThumbprint] <String>] [[-KeyExportPolicy] <String>]
[[-VaultName] <String>] [-OverwriteVaultSecret] [-ReturnParamSplat] [-ProgressAction <ActionPreference>]
[-WhatIf] [-Confirm] [<CommonParameters>]
Publish-TkEmailApp [-AppPrefix <String>] -AuthorizedSenderUserName <String> -MailEnabledSendingGroup <String>
[-CertPrefix <String>] [-CertThumbprint <String>] [-KeyExportPolicy <String>] [-VaultName <String>]
[-OverwriteVaultSecret] [-ReturnParamSplat] [-DoNotUseDomainSuffix] [-ProgressAction <ActionPreference>]
[<CommonParameters>]
```

### UseExistingApp
```
Publish-TkEmailApp -ExistingAppObjectId <String> -CertPrefix <String> [-CertThumbprint <String>]
[-KeyExportPolicy <String>] [-VaultName <String>] [-OverwriteVaultSecret] [-ReturnParamSplat]
[-DoNotUseDomainSuffix] [-ProgressAction <ActionPreference>] [<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -44,11 +52,11 @@ grouping purposes (2-4 alphanumeric characters).

```yaml
Type: String
Parameter Sets: (All)
Parameter Sets: CreateNewApp
Aliases:

Required: True
Position: 1
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Expand All @@ -59,11 +67,11 @@ The username of the authorized sender.

```yaml
Type: String
Parameter Sets: (All)
Parameter Sets: CreateNewApp
Aliases:

Required: True
Position: 2
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Expand All @@ -76,11 +84,53 @@ app policy restrictions.

```yaml
Type: String
Parameter Sets: (All)
Parameter Sets: CreateNewApp
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -ExistingAppObjectId
The AppId of the existing App Registration to which you want to attach a certificate. Must be a valid GUID.

```yaml
Type: String
Parameter Sets: UseExistingApp
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -CertPrefix
Prefix to add to the certificate subject for the existing app.

```yaml
Type: String
Parameter Sets: CreateNewApp
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

```yaml
Type: String
Parameter Sets: UseExistingApp
Aliases:

Required: True
Position: 3
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Expand All @@ -97,7 +147,7 @@ Parameter Sets: (All)
Aliases:

Required: False
Position: 4
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Expand All @@ -115,7 +165,7 @@ Parameter Sets: (All)
Aliases:

Required: False
Position: 5
Position: Named
Default value: NonExportable
Accept pipeline input: False
Accept wildcard characters: False
Expand All @@ -132,7 +182,7 @@ Parameter Sets: (All)
Aliases:

Required: False
Position: 6
Position: Named
Default value: GraphEmailAppLocalStore
Accept pipeline input: False
Accept wildcard characters: False
Expand Down Expand Up @@ -170,33 +220,17 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Confirm
Prompts you for confirmation before running the cmdlet.
### -DoNotUseDomainSuffix
Switch to add session domain suffix to the app name.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Aliases:

Required: False
Position: Named
Default value: None
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```
Expand All @@ -221,12 +255,8 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## INPUTS

### None
## OUTPUTS

### By default, returns a PSCustomObject containing details such as AppId, CertThumbprint,
### TenantID, and CertExpires. If -ReturnParamSplat is specified, returns the parameter
### splat instead.
## NOTES
This cmdlet requires that the user running the cmdlet have the necessary permissions to
create the app and connect to Exchange Online.
Expand Down
28 changes: 6 additions & 22 deletions help/Publish-TkM365AuditApp.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ Publishes (creates) a new M365 Audit App registration in Entra ID (Azure AD) wit

```
Publish-TkM365AuditApp [[-AppPrefix] <String>] [[-CertThumbprint] <String>] [[-KeyExportPolicy] <String>]
[[-VaultName] <String>] [-OverwriteVaultSecret] [-ReturnParamSplat] [-ProgressAction <ActionPreference>]
[-WhatIf] [-Confirm] [<CommonParameters>]
[[-VaultName] <String>] [-OverwriteVaultSecret] [-ReturnParamSplat] [-DoNotUseDomainSuffix]
[-ProgressAction <ActionPreference>] [<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -137,33 +137,17 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
### -DoNotUseDomainSuffix
If specified, does not append the domain suffix to the app name.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Confirm
Prompts you for confirmation before running the cmdlet.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Aliases:

Required: False
Position: Named
Default value: None
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```
Expand Down
Loading