|
| 1 | +--- |
| 2 | +Module Name: PnP.PowerShell |
| 3 | +schema: 2.0.0 |
| 4 | +applicable: SharePoint Online |
| 5 | +online version: https://pnp.github.io/powershell/cmdlets/Add-PnPAlert.html |
| 6 | +external help file: PnP.PowerShell.dll-Help.xml |
| 7 | +title: Add-PnPAlert |
| 8 | +--- |
| 9 | + |
| 10 | +# Add-PnPAlert |
| 11 | + |
| 12 | +## SYNOPSIS |
| 13 | + |
| 14 | +> [!TIP] |
| 15 | +> We encourage you to make improvements to this documentation. Please navigate to https://github.com/pnp/powershell/blob/dev/documentation/Add-PnPAlert.md to change this file. |
| 16 | +
|
| 17 | +Adds an alert for a user to a list |
| 18 | + |
| 19 | +## SYNTAX |
| 20 | + |
| 21 | +```powershell |
| 22 | +Add-PnPAlert [-List] <ListPipeBind> [-Title <String>] [-User <UserPipeBind>] |
| 23 | + [-DeliveryMethod <AlertDeliveryChannel>] [-ChangeType <AlertEventType>] [-Frequency <AlertFrequency>] |
| 24 | + [-Filter <AlertFilter>] [-Time <DateTime>] [-Connection <PnPConnection>] |
| 25 | + [<CommonParameters>] |
| 26 | +``` |
| 27 | + |
| 28 | +## DESCRIPTION |
| 29 | +This cmdlets allows to add an alert for a user to a list. |
| 30 | + |
| 31 | +## EXAMPLES |
| 32 | + |
| 33 | +### EXAMPLE 1 |
| 34 | +```powershell |
| 35 | +Add-PnPAlert -List "Demo List" |
| 36 | +``` |
| 37 | + |
| 38 | +Adds a new alert to the "Demo List" for the current user. |
| 39 | + |
| 40 | +### EXAMPLE 2 |
| 41 | +```powershell |
| 42 | +Add-PnPAlert -Title "Daily summary" -List "Demo List" -Frequency Daily -ChangeType All -Time (Get-Date -Hour 11 -Minute 00 -Second 00) |
| 43 | +``` |
| 44 | + |
| 45 | +Adds a daily alert for the current user at the given time to the "Demo List". Note: a timezone offset might be applied so please verify on your tenant that the alert indeed got the right time. |
| 46 | + |
| 47 | +### EXAMPLE 3 |
| 48 | +```powershell |
| 49 | +Add-PnPAlert -Title "Alert for user" -List "Demo List" -User "i:0#.f|membership|[email protected]" |
| 50 | +``` |
| 51 | + |
| 52 | +Adds a new alert for user "Alice" to the "Demo List". Note: Only site owners and admins are permitted to set alerts for other users. |
| 53 | + |
| 54 | +## PARAMETERS |
| 55 | + |
| 56 | +### -ChangeType |
| 57 | +Alert change type |
| 58 | + |
| 59 | +```yaml |
| 60 | +Type: AlertEventType |
| 61 | +Parameter Sets: (All) |
| 62 | +Accepted values: AddObject, ModifyObject, DeleteObject, Discussion, All |
| 63 | + |
| 64 | +Required: False |
| 65 | +Position: Named |
| 66 | +Default value: None |
| 67 | +Accept pipeline input: False |
| 68 | +Accept wildcard characters: False |
| 69 | +``` |
| 70 | +
|
| 71 | +### -Connection |
| 72 | +Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. |
| 73 | +
|
| 74 | +```yaml |
| 75 | +Type: PnPConnection |
| 76 | +Parameter Sets: (All) |
| 77 | + |
| 78 | +Required: False |
| 79 | +Position: Named |
| 80 | +Default value: None |
| 81 | +Accept pipeline input: False |
| 82 | +Accept wildcard characters: False |
| 83 | +``` |
| 84 | +
|
| 85 | +### -DeliveryMethod |
| 86 | +Alert delivery method |
| 87 | +
|
| 88 | +```yaml |
| 89 | +Type: AlertDeliveryChannel |
| 90 | +Parameter Sets: (All) |
| 91 | +Accepted values: Email, Sms |
| 92 | + |
| 93 | +Required: False |
| 94 | +Position: Named |
| 95 | +Default value: None |
| 96 | +Accept pipeline input: False |
| 97 | +Accept wildcard characters: False |
| 98 | +``` |
| 99 | +
|
| 100 | +### -Filter |
| 101 | +Alert filter |
| 102 | +
|
| 103 | +```yaml |
| 104 | +Type: AlertFilter |
| 105 | +Parameter Sets: (All) |
| 106 | +Accepted values: AnythingChanges, SomeoneElseChangesAnItem, SomeoneElseChangesItemCreatedByMe, SomeoneElseChangesItemLastModifiedByMe |
| 107 | + |
| 108 | +Required: False |
| 109 | +Position: Named |
| 110 | +Default value: None |
| 111 | +Accept pipeline input: False |
| 112 | +Accept wildcard characters: False |
| 113 | +``` |
| 114 | +
|
| 115 | +### -Frequency |
| 116 | +Alert frequency |
| 117 | +
|
| 118 | +```yaml |
| 119 | +Type: AlertFrequency |
| 120 | +Parameter Sets: (All) |
| 121 | +Accepted values: Immediate, Daily, Weekly |
| 122 | + |
| 123 | +Required: False |
| 124 | +Position: Named |
| 125 | +Default value: None |
| 126 | +Accept pipeline input: False |
| 127 | +Accept wildcard characters: False |
| 128 | +``` |
| 129 | +
|
| 130 | +### -List |
| 131 | +The ID, Title or Url of the list. |
| 132 | +
|
| 133 | +```yaml |
| 134 | +Type: ListPipeBind |
| 135 | +Parameter Sets: (All) |
| 136 | + |
| 137 | +Required: True |
| 138 | +Position: 0 |
| 139 | +Default value: None |
| 140 | +Accept pipeline input: True (ByValue) |
| 141 | +Accept wildcard characters: False |
| 142 | +``` |
| 143 | +
|
| 144 | +### -Time |
| 145 | +Alert time (if frequency is not immediate) |
| 146 | +
|
| 147 | +```yaml |
| 148 | +Type: DateTime |
| 149 | +Parameter Sets: (All) |
| 150 | + |
| 151 | +Required: False |
| 152 | +Position: Named |
| 153 | +Default value: None |
| 154 | +Accept pipeline input: False |
| 155 | +Accept wildcard characters: False |
| 156 | +``` |
| 157 | +
|
| 158 | +### -Title |
| 159 | +Alert title |
| 160 | +
|
| 161 | +```yaml |
| 162 | +Type: String |
| 163 | +Parameter Sets: (All) |
| 164 | + |
| 165 | +Required: False |
| 166 | +Position: Named |
| 167 | +Default value: None |
| 168 | +Accept pipeline input: False |
| 169 | +Accept wildcard characters: False |
| 170 | +``` |
| 171 | +
|
| 172 | +### -User |
| 173 | +User to create the alert for (User ID, login name or actual User object). Skip this parameter to create an alert for the current user. Note: Only site owners can create alerts for other users. |
| 174 | +
|
| 175 | +```yaml |
| 176 | +Type: UserPipeBind |
| 177 | +Parameter Sets: (All) |
| 178 | + |
| 179 | +Required: False |
| 180 | +Position: Named |
| 181 | +Default value: None |
| 182 | +Accept pipeline input: False |
| 183 | +Accept wildcard characters: False |
| 184 | +``` |
| 185 | +
|
| 186 | +
|
| 187 | +
|
| 188 | +## RELATED LINKS |
| 189 | +
|
| 190 | +[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp) |
| 191 | +
|
| 192 | +
|
0 commit comments