Upload files to "src/PWExpireNotification/1.0.1"

This commit is contained in:
Ivo Oskamp 2024-12-19 20:05:17 +01:00
parent aac501ac89
commit 615652182d
3 changed files with 1079 additions and 0 deletions

View File

@ -0,0 +1,930 @@
<?xml version="1.0" encoding="utf-8"?>
<helpItems schema="maml" xmlns="http://msh">
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp">
<command:details>
<command:name>Get-PWADDSExpiringPassword</command:name>
<command:verb>Get</command:verb>
<command:noun>PWADDSExpiringPassword</command:noun>
<maml:description>
<maml:para>This cmdlet obtains all users within the domain that have a password expiring at some point</maml:para>
</maml:description>
</command:details>
<maml:description>
<maml:para>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</maml:para>
</maml:description>
<command:syntax>
<command:syntaxItem>
<maml:name>Get-PWADDSExpiringPassword</maml:name>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none">
<maml:name>ExpireInDays</maml:name>
<maml:description>
<maml:para>Filters the output to return only users with passwords that expire less than or equal to the day</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">Object</command:parameterValue>
<dev:type>
<maml:name>Object</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none">
<maml:name>ADFilter</maml:name>
<maml:description>
<maml:para>Allows the ability to scope query to a specific location or user attribute</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">ScriptBlock</command:parameterValue>
<dev:type>
<maml:name>ScriptBlock</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
<maml:name>IncludeAll</maml:name>
<maml:description>
<maml:para>Enables the return of all users even if the the password never expires.</maml:para>
</maml:description>
<dev:type>
<maml:name>SwitchParameter</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>False</dev:defaultValue>
</command:parameter>
</command:syntaxItem>
</command:syntax>
<command:parameters>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none">
<maml:name>ADFilter</maml:name>
<maml:description>
<maml:para>Allows the ability to scope query to a specific location or user attribute</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">ScriptBlock</command:parameterValue>
<dev:type>
<maml:name>ScriptBlock</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none">
<maml:name>ExpireInDays</maml:name>
<maml:description>
<maml:para>Filters the output to return only users with passwords that expire less than or equal to the day</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">Object</command:parameterValue>
<dev:type>
<maml:name>Object</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
<maml:name>IncludeAll</maml:name>
<maml:description>
<maml:para>Enables the return of all users even if the the password never expires.</maml:para>
</maml:description>
<command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue>
<dev:type>
<maml:name>SwitchParameter</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>False</dev:defaultValue>
</command:parameter>
</command:parameters>
<command:inputTypes>
<command:inputType>
<dev:type>
<maml:name>None</maml:name>
</dev:type>
<maml:description>
<maml:para></maml:para>
</maml:description>
</command:inputType>
</command:inputTypes>
<command:returnValues>
<command:returnValue>
<dev:type>
<maml:name>System.Object</maml:name>
</dev:type>
<maml:description>
<maml:para></maml:para>
</maml:description>
</command:returnValue>
</command:returnValues>
<maml:alertSet>
<maml:alert>
<maml:para></maml:para>
</maml:alert>
</maml:alertSet>
<command:examples>
<command:example>
<maml:title>-------------------------- Example 1 --------------------------</maml:title>
<dev:code>PS C:\&gt; Get-PWADDSExpiringPassword</dev:code>
<dev:remarks>
<maml:para>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.</maml:para>
</dev:remarks>
</command:example>
<command:example>
<maml:title>-------------------------- Example 1 --------------------------</maml:title>
<dev:code>PS C:\&gt; Get-PWADDSExpiringPassword -IncludeAll</dev:code>
<dev:remarks>
<maml:para>Gets all users and their password expiration except if the password less set is null.
</maml:para>
</dev:remarks>
</command:example>
</command:examples>
<command:relatedLinks />
</command:command>
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp">
<command:details>
<command:name>Get-PWApplicationToken</command:name>
<command:verb>Get</command:verb>
<command:noun>PWApplicationToken</command:noun>
<maml:description>
<maml:para>Obtains an Application token using a client secret</maml:para>
</maml:description>
</command:details>
<maml:description>
<maml:para>Intended to be used to obtain an token for an application that has Mail.Send permissions within Graph.</maml:para>
</maml:description>
<command:syntax>
<command:syntaxItem>
<maml:name>Get-PWApplicationToken</maml:name>
<command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none">
<maml:name>clientID</maml:name>
<maml:description>
<maml:para>Application ID of the AAD application</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
<dev:type>
<maml:name>String</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none">
<maml:name>clientSecret</maml:name>
<maml:description>
<maml:para>Client secret of the application</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
<dev:type>
<maml:name>String</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="2" aliases="none">
<maml:name>Resource</maml:name>
<maml:description>
<maml:para>Used to identify the graph resource where the token will be used.</maml:para>
</maml:description>
<command:parameterValueGroup>
<command:parameterValue required="false" command:variableLength="false">https://graph.microsoft.com</command:parameterValue>
<command:parameterValue required="false" command:variableLength="false">https://graph.microsoft.us</command:parameterValue>
<command:parameterValue required="false" command:variableLength="false">https://dod-graph.microsoft.us</command:parameterValue>
</command:parameterValueGroup>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
<dev:type>
<maml:name>String</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="3" aliases="none">
<maml:name>tenantName</maml:name>
<maml:description>
<maml:para>Full TenantName such as mydomain.onmicrosoft.com</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
<dev:type>
<maml:name>String</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
</command:syntaxItem>
</command:syntax>
<command:parameters>
<command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="2" aliases="none">
<maml:name>Resource</maml:name>
<maml:description>
<maml:para>Used to identify the graph resource where the token will be used.</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
<dev:type>
<maml:name>String</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none">
<maml:name>clientID</maml:name>
<maml:description>
<maml:para>Application ID of the AAD application</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
<dev:type>
<maml:name>String</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none">
<maml:name>clientSecret</maml:name>
<maml:description>
<maml:para>Client secret of the application</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
<dev:type>
<maml:name>String</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="3" aliases="none">
<maml:name>tenantName</maml:name>
<maml:description>
<maml:para>Full TenantName such as mydomain.onmicrosoft.com</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
<dev:type>
<maml:name>String</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
</command:parameters>
<command:inputTypes>
<command:inputType>
<dev:type>
<maml:name>None</maml:name>
</dev:type>
<maml:description>
<maml:para></maml:para>
</maml:description>
</command:inputType>
</command:inputTypes>
<command:returnValues>
<command:returnValue>
<dev:type>
<maml:name>System.Object</maml:name>
</dev:type>
<maml:description>
<maml:para></maml:para>
</maml:description>
</command:returnValue>
</command:returnValues>
<maml:alertSet>
<maml:alert>
<maml:para></maml:para>
</maml:alert>
</maml:alertSet>
<command:examples>
<command:example>
<maml:title>-------------------------- Example 1 --------------------------</maml:title>
<dev:code>PS C:\&gt; $param = @{
clientID = $clientID
clientSecret = $sec
resource = $resource
tenantName = $tenantName
}
$token = Get-PWApplicationToken @param</dev:code>
<dev:remarks>
<maml:para>Providing the client ID, secret, graph resource, and tenantname, returns an OAuth token for the specified application</maml:para>
</dev:remarks>
</command:example>
</command:examples>
<command:relatedLinks />
</command:command>
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp">
<command:details>
<command:name>Send-PWExpiringMailMessage</command:name>
<command:verb>Send</command:verb>
<command:noun>PWExpiringMailMessage</command:noun>
<maml:description>
<maml:para>Used to send password expiration notification of ADDS Users</maml:para>
</maml:description>
</command:details>
<maml:description>
<maml:para>Used to send password expiration notification of ADDS Users</maml:para>
</maml:description>
<command:syntax>
<command:syntaxItem>
<maml:name>Send-PWExpiringMailMessage</maml:name>
<command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
<maml:name>ADAccount</maml:name>
<maml:description>
<maml:para>The ADUser account object</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">PSObject</command:parameterValue>
<dev:type>
<maml:name>PSObject</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
<maml:name>ExpireInDaysThreshold</maml:name>
<maml:description>
<maml:para>The threshold for limiting at what time a user would be notified based on when their password expires.</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">Int32</command:parameterValue>
<dev:type>
<maml:name>Int32</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
<maml:name>LogFile</maml:name>
<maml:description>
<maml:para>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.</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
<dev:type>
<maml:name>String</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
<maml:name>Logging</maml:name>
<maml:description>
<maml:para>Enable logging and output the logfile to the current working directory.</maml:para>
</maml:description>
<dev:type>
<maml:name>SwitchParameter</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>False</dev:defaultValue>
</command:parameter>
<command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
<maml:name>Resource</maml:name>
<maml:description>
<maml:para>The graph resource that will be used</maml:para>
</maml:description>
<command:parameterValueGroup>
<command:parameterValue required="false" command:variableLength="false">https://graph.microsoft.com</command:parameterValue>
<command:parameterValue required="false" command:variableLength="false">https://graph.microsoft.us</command:parameterValue>
<command:parameterValue required="false" command:variableLength="false">https://dod-graph.microsoft.us</command:parameterValue>
</command:parameterValueGroup>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
<dev:type>
<maml:name>String</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
<maml:name>SendEmailAccount</maml:name>
<maml:description>
<maml:para>The account that will be used to send the mail message. e.g. Shared O365 Mailbox</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
<dev:type>
<maml:name>String</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
<maml:name>Signature</maml:name>
<maml:description>
<maml:para>The signature as a string that you would like within your email body.</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
<dev:type>
<maml:name>String</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
<maml:name>TestAddress</maml:name>
<maml:description>
<maml:para>Used for testing, all email messages will go to this address versus the end user.</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
<dev:type>
<maml:name>String</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
<maml:name>TextToAdd</maml:name>
<maml:description>
<maml:para>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.</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
<dev:type>
<maml:name>String</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
<maml:name>Token</maml:name>
<maml:description>
<maml:para>The token that will be used to send the message</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
<dev:type>
<maml:name>String</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
</command:syntaxItem>
</command:syntax>
<command:parameters>
<command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
<maml:name>ADAccount</maml:name>
<maml:description>
<maml:para>The ADUser account object</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">PSObject</command:parameterValue>
<dev:type>
<maml:name>PSObject</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
<maml:name>ExpireInDaysThreshold</maml:name>
<maml:description>
<maml:para>The threshold for limiting at what time a user would be notified based on when their password expires.</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">Int32</command:parameterValue>
<dev:type>
<maml:name>Int32</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
<maml:name>LogFile</maml:name>
<maml:description>
<maml:para>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.</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
<dev:type>
<maml:name>String</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
<maml:name>Logging</maml:name>
<maml:description>
<maml:para>Enable logging and output the logfile to the current working directory.</maml:para>
</maml:description>
<command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue>
<dev:type>
<maml:name>SwitchParameter</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>False</dev:defaultValue>
</command:parameter>
<command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
<maml:name>Resource</maml:name>
<maml:description>
<maml:para>The graph resource that will be used</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
<dev:type>
<maml:name>String</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
<maml:name>SendEmailAccount</maml:name>
<maml:description>
<maml:para>The account that will be used to send the mail message. e.g. Shared O365 Mailbox</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
<dev:type>
<maml:name>String</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
<maml:name>Signature</maml:name>
<maml:description>
<maml:para>The signature as a string that you would like within your email body.</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
<dev:type>
<maml:name>String</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
<maml:name>TestAddress</maml:name>
<maml:description>
<maml:para>Used for testing, all email messages will go to this address versus the end user.</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
<dev:type>
<maml:name>String</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
<maml:name>TextToAdd</maml:name>
<maml:description>
<maml:para>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.</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
<dev:type>
<maml:name>String</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
<maml:name>Token</maml:name>
<maml:description>
<maml:para>The token that will be used to send the message</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
<dev:type>
<maml:name>String</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
</command:parameters>
<command:inputTypes>
<command:inputType>
<dev:type>
<maml:name>None</maml:name>
</dev:type>
<maml:description>
<maml:para></maml:para>
</maml:description>
</command:inputType>
</command:inputTypes>
<command:returnValues>
<command:returnValue>
<dev:type>
<maml:name>System.Object</maml:name>
</dev:type>
<maml:description>
<maml:para></maml:para>
</maml:description>
</command:returnValue>
</command:returnValues>
<maml:alertSet>
<maml:alert>
<maml:para></maml:para>
</maml:alert>
</maml:alertSet>
<command:examples>
<command:example>
<maml:title>-------------------------- Example 1 --------------------------</maml:title>
<dev:code>PS C:\&gt;$params = @{
Resource = $resource
SendEmailAccount = $SendEmailAccount
Token = $token
TestAddress = $TestAddress
ADAccount = $user
ExpireInDaysThreshold = $ExpireInDaysThreshold
TextToAdd = $TextToAddToEmail
Signature = $Signature
Logging = $true
}
Send-PWExpiringMailMessage @params -Verbose</dev:code>
<dev:remarks>
<maml:para>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.</maml:para>
</dev:remarks>
</command:example>
</command:examples>
<command:relatedLinks />
</command:command>
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp">
<command:details>
<command:name>Set-PWEmailBody</command:name>
<command:verb>Set</command:verb>
<command:noun>PWEmailBody</command:noun>
<maml:description>
<maml:para>This cmdlet is used to configure the email message body in JSON format for configuring the JSON payload to graph</maml:para>
</maml:description>
</command:details>
<maml:description>
<maml:para>This cmdlet is used to configure the email message body in JSON format for configuring the JSON payload to graph</maml:para>
</maml:description>
<command:syntax>
<command:syntaxItem>
<maml:name>Set-PWEmailBody</maml:name>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none">
<maml:name>Subject</maml:name>
<maml:description>
<maml:para>Subject line of the email</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
<dev:type>
<maml:name>String</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none">
<maml:name>Importance</maml:name>
<maml:description>
<maml:para>Set the Importance of the email: High or Low</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
<dev:type>
<maml:name>String</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="2" aliases="none">
<maml:name>Message</maml:name>
<maml:description>
<maml:para>The message body</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
<dev:type>
<maml:name>String</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="3" aliases="none">
<maml:name>EmailAddress</maml:name>
<maml:description>
<maml:para>Email address to receive the email</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
<dev:type>
<maml:name>String</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
</command:syntaxItem>
</command:syntax>
<command:parameters>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="3" aliases="none">
<maml:name>EmailAddress</maml:name>
<maml:description>
<maml:para>Email address to receive the email</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
<dev:type>
<maml:name>String</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none">
<maml:name>Importance</maml:name>
<maml:description>
<maml:para>Set the Importance of the email: High or Low</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
<dev:type>
<maml:name>String</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="2" aliases="none">
<maml:name>Message</maml:name>
<maml:description>
<maml:para>The message body</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
<dev:type>
<maml:name>String</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none">
<maml:name>Subject</maml:name>
<maml:description>
<maml:para>Subject line of the email</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
<dev:type>
<maml:name>String</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
</command:parameters>
<command:inputTypes>
<command:inputType>
<dev:type>
<maml:name>None</maml:name>
</dev:type>
<maml:description>
<maml:para></maml:para>
</maml:description>
</command:inputType>
</command:inputTypes>
<command:returnValues>
<command:returnValue>
<dev:type>
<maml:name>System.Object</maml:name>
</dev:type>
<maml:description>
<maml:para></maml:para>
</maml:description>
</command:returnValue>
</command:returnValues>
<maml:alertSet>
<maml:alert>
<maml:para></maml:para>
</maml:alert>
</maml:alertSet>
<command:examples>
<command:example>
<maml:title>-------------------------- Example 1 --------------------------</maml:title>
<dev:code>PS C:\&gt; Set-PWEmailBody -Subject "Your Password is Expiring in 10 Days" `
-Importance "High" `
-Message "Please change soon" `
-EmailAddress "olduser@mycompany.com"</dev:code>
<dev:remarks>
<maml:para>Prepares the message section of the JSON payload to be submitted to Graph for sending the email message</maml:para>
</dev:remarks>
</command:example>
</command:examples>
<command:relatedLinks />
</command:command>
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp">
<command:details>
<command:name>Set-PWEmailMessagePayload</command:name>
<command:verb>Set</command:verb>
<command:noun>PWEmailMessagePayload</command:noun>
<maml:description>
<maml:para>Creates the full message paylod of to send to Graph API</maml:para>
</maml:description>
</command:details>
<maml:description>
<maml:para>Creates the full message paylod of to send to Graph API</maml:para>
</maml:description>
<command:syntax>
<command:syntaxItem>
<maml:name>Set-PWEmailMessagePayload</maml:name>
<command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
<maml:name>ADAccount</maml:name>
<maml:description>
<maml:para>The account that is expiring</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">PSObject</command:parameterValue>
<dev:type>
<maml:name>PSObject</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
<maml:name>Signature</maml:name>
<maml:description>
<maml:para>Signature to be used within the email</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">PSObject</command:parameterValue>
<dev:type>
<maml:name>PSObject</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
<maml:name>TextToAdd</maml:name>
<maml:description>
<maml:para>Any additional text to add to the email body</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
<dev:type>
<maml:name>String</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
</command:syntaxItem>
<command:syntaxItem>
<maml:name>Set-PWEmailMessagePayload</maml:name>
<command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
<maml:name>ADAccount</maml:name>
<maml:description>
<maml:para>The account that is expiring</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">PSObject</command:parameterValue>
<dev:type>
<maml:name>PSObject</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
<maml:name>Subject</maml:name>
<maml:description>
<maml:para>The email subject</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
<dev:type>
<maml:name>String</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
</command:syntaxItem>
</command:syntax>
<command:parameters>
<command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
<maml:name>ADAccount</maml:name>
<maml:description>
<maml:para>The account that is expiring</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">PSObject</command:parameterValue>
<dev:type>
<maml:name>PSObject</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
<maml:name>Signature</maml:name>
<maml:description>
<maml:para>Signature to be used within the email</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">PSObject</command:parameterValue>
<dev:type>
<maml:name>PSObject</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
<maml:name>Subject</maml:name>
<maml:description>
<maml:para>The email subject</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
<dev:type>
<maml:name>String</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
<maml:name>TextToAdd</maml:name>
<maml:description>
<maml:para>Any additional text to add to the email body</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
<dev:type>
<maml:name>String</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
</command:parameters>
<command:inputTypes>
<command:inputType>
<dev:type>
<maml:name>None</maml:name>
</dev:type>
<maml:description>
<maml:para></maml:para>
</maml:description>
</command:inputType>
</command:inputTypes>
<command:returnValues>
<command:returnValue>
<dev:type>
<maml:name>System.Object</maml:name>
</dev:type>
<maml:description>
<maml:para></maml:para>
</maml:description>
</command:returnValue>
</command:returnValues>
<maml:alertSet>
<maml:alert>
<maml:para></maml:para>
</maml:alert>
</maml:alertSet>
<command:examples>
<command:example>
<maml:title>-------------------------- Example 1 --------------------------</maml:title>
<dev:code>PS C:\&gt; Set-PWEmailMessagePayload -TextToAdd $TextToAdd -ADAccount $ADAccount -Signature $Signature</dev:code>
<dev:remarks>
<maml:para>Prepares the json payload for graph</maml:para>
</dev:remarks>
</command:example>
</command:examples>
<command:relatedLinks />
</command:command>
</helpItems>

View File

@ -0,0 +1,126 @@
#
# Module manifest for module 'PSGet_ADDSPasswordNotification'
#
# Generated by: Daniel Carroll
#
# Generated on: 3/6/2022
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'PWExpireNotification.psm1'
# Version number of this module.
ModuleVersion = '1.0.1'
# Supported PSEditions
# CompatiblePSEditions = @()
# ID used to uniquely identify this module
GUID = '626c48e4-dcf8-4364-b5ab-135429452403'
# Author of this module
Author = 'Daniel Carroll'
# Company or vendor of this module
CompanyName = 'Carroll Solutions'
# Copyright statement for this module
Copyright = 'This work is licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.'
# Description of the functionality provided by this module
Description = 'PowerShell module for sending notifications to end users when their password is expiring using an O365 mailbox'
# Minimum version of the Windows PowerShell engine required by this module
PowerShellVersion = '5.1'
# Name of the Windows PowerShell host required by this module
# PowerShellHostName = ''
# Minimum version of the Windows PowerShell host required by this module
# PowerShellHostVersion = ''
# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
# DotNetFrameworkVersion = ''
# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
# CLRVersion = ''
# Processor architecture (None, X86, Amd64) required by this module
# ProcessorArchitecture = ''
# Modules that must be imported into the global environment prior to importing this module
#RequiredModules = @('ActiveDirectory')
# Assemblies that must be loaded prior to importing this module
# RequiredAssemblies = @()
# Script files (.ps1) that are run in the caller's environment prior to importing this module.
# ScriptsToProcess = @()
# Type files (.ps1xml) to be loaded when importing this module
# TypesToProcess = @()
# Format files (.ps1xml) to be loaded when importing this module
# FormatsToProcess = @()
# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
# NestedModules = @()
# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
FunctionsToExport = @('New-PWEmailBody','Get-PWApplicationToken','Get-PWADDSExpiringPassword','Send-PWExpiringMailMessage','New-PWEmailMessagePayload')
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
CmdletsToExport = @()
# Variables to export from this module
# VariablesToExport = @()
# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
AliasesToExport = @()
# DSC resources to export from this module
# DscResourcesToExport = @()
# List of all modules packaged with this module
# ModuleList = @()
# List of all files packaged with this module
# FileList = @()
# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
PrivateData = @{
PSData = @{
# Tags applied to this module. These help with module discovery in online galleries.
Tags = @('ActiveDirectory','PasswordExpiration','EmailNotification','O365MailNotification','MicrosoftGraph','SendMail')
# A URL to the license for this module.
LicenseUri = 'https://raw.githubusercontent.com/dacarroll/PWExpireNotification/main/LICENSE'
# A URL to the main website for this project.
ProjectUri = 'https://github.com/dacarroll/PWExpireNotification'
# A URL to an icon representing this module.
# IconUri = ''
# ReleaseNotes of this module
ReleaseNotes = 'Minor fix for New-PWEmailBody'
# External dependent modules of this module
ExternalModuleDependencies = 'ActiveDirectory'
} # End of PSData hashtable
} # End of PrivateData hashtable
# HelpInfo URI of this module
HelpInfoURI = 'https://github.com/dacarroll/PWExpireNotification/docs'
# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
# DefaultCommandPrefix = ''
}

View File

@ -0,0 +1,23 @@
# .ExternalHelp PWExpireNotifictaion-help.xml
[cmdletbinding()]
param()
Write-Verbose $PSScriptRoot
Write-Verbose 'Import everything in sub folders public, private folder'
$functionFolders = @('Functions', 'Internal')
ForEach ($folder in $functionFolders) {
$folderPath = Join-Path -Path $PSScriptRoot -ChildPath $folder
If (Test-Path -Path $folderPath) {
Write-Verbose -Message "Importing from $folder"
$functions = Get-ChildItem -Path $folderPath -Filter '*.ps1'
ForEach ($function in $functions) {
Write-Verbose -Message " Importing $($function.BaseName)"
try {
. $($function.FullName)
}
catch {
Write-Verbose ('Failed to import "{0}". Reason: "{1}"' -f $function.FullName, $_.Exception.Message)
}
}
}
}