Upload files to "docs"

This commit is contained in:
Ivo Oskamp 2024-12-19 20:04:08 +01:00
parent 2d7ea9e9d3
commit 2c1c559172
5 changed files with 644 additions and 0 deletions

View File

@ -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] <Object>] [[-ADFilter] <ScriptBlock>] [-IncludeAll]
[<CommonParameters>]
```
## 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

View File

@ -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] <String> [-clientSecret] <String> [-Resource] <String>
[-tenantName] <String> [<CommonParameters>]
```
## 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

View File

@ -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 <String> -SendEmailAccount <String> -Token <String>
[-TestAddress <String>] -ADAccount <PSObject> -Signature <String> -TextToAdd <String>
[-ExpireInDaysThreshold <Int32>] [-Logging] [-LogFile <String>] [<CommonParameters>]
```
## 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

109
docs/Set-PWEmailBody.md Normal file
View File

@ -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] <String>] [[-Importance] <String>] [[-Message] <String>] [[-EmailAddress] <String>]
[<CommonParameters>]
```
## 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

View File

@ -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 <String> -ADAccount <PSObject> -Signature <PSObject> [<CommonParameters>]
```
### Subject
```
Set-PWEmailMessagePayload -ADAccount <PSObject> -Subject <String> [<CommonParameters>]
```
## 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