From 2c1c559172f07bc2b164b9b2f54dd083229fb871 Mon Sep 17 00:00:00 2001 From: Ivo Oskamp Date: Thu, 19 Dec 2024 20:04:08 +0100 Subject: [PATCH] Upload files to "docs" --- docs/Get-PWADDSExpiringPassword.md | 101 ++++++++++++++ docs/Get-PWApplicationToken.md | 113 ++++++++++++++++ docs/Send-PWExpiringMailMessage.md | 210 +++++++++++++++++++++++++++++ docs/Set-PWEmailBody.md | 109 +++++++++++++++ docs/Set-PWEmailMessagePayload.md | 111 +++++++++++++++ 5 files changed, 644 insertions(+) create mode 100644 docs/Get-PWADDSExpiringPassword.md create mode 100644 docs/Get-PWApplicationToken.md create mode 100644 docs/Send-PWExpiringMailMessage.md create mode 100644 docs/Set-PWEmailBody.md create mode 100644 docs/Set-PWEmailMessagePayload.md diff --git a/docs/Get-PWADDSExpiringPassword.md b/docs/Get-PWADDSExpiringPassword.md new file mode 100644 index 0000000..f7268ba --- /dev/null +++ b/docs/Get-PWADDSExpiringPassword.md @@ -0,0 +1,101 @@ +--- +external help file: PWExpireNotification-help.xml +Module Name: PWExpireNotification +online version: +schema: 2.0.0 +--- + +# Get-PWADDSExpiringPassword + +## SYNOPSIS +This cmdlet obtains all users within the domain that have a password expiring at some point + +## SYNTAX + +``` +Get-PWADDSExpiringPassword [[-ExpireInDays] ] [[-ADFilter] ] [-IncludeAll] + [] +``` + +## DESCRIPTION +This cmdlet obtains all users within the domain that have a password expiring at some point +and omits those users that have an empty passwordlastset attribute + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-PWADDSExpiringPassword +``` + +Gets all users and their password expiration except if the user is disabled, +,the passwword is already expired, or the password is set to never expire. + +### Example 1 +```powershell +PS C:\> Get-PWADDSExpiringPassword -IncludeAll +``` + +Gets all users and their password expiration except if the +password less set is null. + +## PARAMETERS + +### -ADFilter +Allows the ability to scope query to a specific location or user attribute + +```yaml +Type: ScriptBlock +Parameter Sets: (All) +Aliases: + +Required: False +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ExpireInDays +Filters the output to return only users with passwords that expire less than or equal to the day + +```yaml +Type: Object +Parameter Sets: (All) +Aliases: + +Required: False +Position: 0 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IncludeAll +Enables the return of all users even if the the password never expires. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### None + +## OUTPUTS + +### System.Object +## NOTES + +## RELATED LINKS diff --git a/docs/Get-PWApplicationToken.md b/docs/Get-PWApplicationToken.md new file mode 100644 index 0000000..1200807 --- /dev/null +++ b/docs/Get-PWApplicationToken.md @@ -0,0 +1,113 @@ +--- +external help file: PWExpireNotification-help.xml +Module Name: PWExpireNotification +online version: +schema: 2.0.0 +--- + +# Get-PWApplicationToken + +## SYNOPSIS +Obtains an Application token using a client secret + +## SYNTAX + +``` +Get-PWApplicationToken [-clientID] [-clientSecret] [-Resource] + [-tenantName] [] +``` + +## DESCRIPTION +Intended to be used to obtain an token for an application that has Mail.Send permissions within Graph. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> $param = @{ + clientID = $clientID + clientSecret = $sec + resource = $resource + tenantName = $tenantName +} +$token = Get-PWApplicationToken @param +``` + +Providing the client ID, secret, graph resource, and tenantname, returns an OAuth token for the specified application + +## PARAMETERS + +### -Resource +Used to identify the graph resource where the token will be used. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: https://graph.microsoft.com, https://graph.microsoft.us, https://dod-graph.microsoft.us + +Required: True +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -clientID +Application ID of the AAD application + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -clientSecret +Client secret of the application + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -tenantName +Full TenantName such as mydomain.onmicrosoft.com + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### None + +## OUTPUTS + +### System.Object +## NOTES + +## RELATED LINKS diff --git a/docs/Send-PWExpiringMailMessage.md b/docs/Send-PWExpiringMailMessage.md new file mode 100644 index 0000000..061da83 --- /dev/null +++ b/docs/Send-PWExpiringMailMessage.md @@ -0,0 +1,210 @@ +--- +external help file: PWExpireNotification-help.xml +Module Name: PWExpireNotification +online version: +schema: 2.0.0 +--- + +# Send-PWExpiringMailMessage + +## SYNOPSIS +Used to send password expiration notification of ADDS Users + +## SYNTAX + +``` +Send-PWExpiringMailMessage -Resource -SendEmailAccount -Token + [-TestAddress ] -ADAccount -Signature -TextToAdd + [-ExpireInDaysThreshold ] [-Logging] [-LogFile ] [] +``` + +## DESCRIPTION +Used to send password expiration notification of ADDS Users + +## EXAMPLES + +### Example 1 +```powershell +PS C:\>$params = @{ + Resource = $resource + SendEmailAccount = $SendEmailAccount + Token = $token + TestAddress = $TestAddress + ADAccount = $user + ExpireInDaysThreshold = $ExpireInDaysThreshold + TextToAdd = $TextToAddToEmail + Signature = $Signature + Logging = $true + + } + Send-PWExpiringMailMessage @params -Verbose +``` + +This command takes the input from the $params hashtable and then sends an email to the test address versus the configured user. This would be used in a test scenario. Prior to live implemenation. + +## PARAMETERS + +### -ADAccount +The ADUser account object + +```yaml +Type: PSObject +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ExpireInDaysThreshold +The threshold for limiting at what time a user would be notified based on when their password expires. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -LogFile +If you want to log each run of this function this will enable logging and display what users were notified placing the logfile in the specified path. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Logging +Enable logging and output the logfile to the current working directory. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Resource +The graph resource that will be used + +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: https://graph.microsoft.com, https://graph.microsoft.us, https://dod-graph.microsoft.us + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SendEmailAccount +The account that will be used to send the mail message. e.g. Shared O365 Mailbox + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Signature +The signature as a string that you would like within your email body. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TestAddress +Used for testing, all email messages will go to this address versus the end user. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TextToAdd +A free form string that will be within the email message body below the default line containing the number of days remaining before their password expires. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Token +The token that will be used to send the message + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### None + +## OUTPUTS + +### System.Object +## NOTES + +## RELATED LINKS diff --git a/docs/Set-PWEmailBody.md b/docs/Set-PWEmailBody.md new file mode 100644 index 0000000..eccf57e --- /dev/null +++ b/docs/Set-PWEmailBody.md @@ -0,0 +1,109 @@ +--- +external help file: PWExpireNotification-help.xml +Module Name: PWExpireNotification +online version: +schema: 2.0.0 +--- + +# Set-PWEmailBody + +## SYNOPSIS +This cmdlet is used to configure the email message body in JSON format for configuring the JSON payload to graph + +## SYNTAX + +``` +Set-PWEmailBody [[-Subject] ] [[-Importance] ] [[-Message] ] [[-EmailAddress] ] + [] +``` + +## DESCRIPTION +This cmdlet is used to configure the email message body in JSON format for configuring the JSON payload to graph + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Set-PWEmailBody -Subject "Your Password is Expiring in 10 Days" ` + -Importance "High" ` + -Message "Please change soon" ` + -EmailAddress "olduser@mycompany.com" +``` + +Prepares the message section of the JSON payload to be submitted to Graph for sending the email message + +## PARAMETERS + +### -EmailAddress +Email address to receive the email + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Importance +Set the Importance of the email: High or Low + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Message +The message body + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Subject +Subject line of the email + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 0 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### None + +## OUTPUTS + +### System.Object +## NOTES + +## RELATED LINKS diff --git a/docs/Set-PWEmailMessagePayload.md b/docs/Set-PWEmailMessagePayload.md new file mode 100644 index 0000000..2607fa2 --- /dev/null +++ b/docs/Set-PWEmailMessagePayload.md @@ -0,0 +1,111 @@ +--- +external help file: PWExpireNotification-help.xml +Module Name: PWExpireNotification +online version: +schema: 2.0.0 +--- + +# Set-PWEmailMessagePayload + +## SYNOPSIS +Creates the full message paylod of to send to Graph API + +## SYNTAX + +### Message +``` +Set-PWEmailMessagePayload -TextToAdd -ADAccount -Signature [] +``` + +### Subject +``` +Set-PWEmailMessagePayload -ADAccount -Subject [] +``` + +## DESCRIPTION +Creates the full message paylod of to send to Graph API + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Set-PWEmailMessagePayload -TextToAdd $TextToAdd -ADAccount $ADAccount -Signature $Signature +``` + +Prepares the json payload for graph + +## PARAMETERS + +### -ADAccount +The account that is expiring + +```yaml +Type: PSObject +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Signature +Signature to be used within the email + +```yaml +Type: PSObject +Parameter Sets: Message +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Subject +The email subject + +```yaml +Type: String +Parameter Sets: Subject +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TextToAdd +Any additional text to add to the email body + +```yaml +Type: String +Parameter Sets: Message +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### None + +## OUTPUTS + +### System.Object +## NOTES + +## RELATED LINKS