|
| 1 | +--- |
| 2 | +Module Name: PnP.PowerShell |
| 3 | +schema: 2.0.0 |
| 4 | +applicable: SharePoint Online |
| 5 | +online version: https://pnp.github.io/powershell/cmdlets/Get-PnPWebAlert.html |
| 6 | +external help file: PnP.PowerShell.dll-Help.xml |
| 7 | +title: Get-PnPWebAlert |
| 8 | +--- |
| 9 | + |
| 10 | +# Get-PnPWebAlert |
| 11 | + |
| 12 | +## SYNOPSIS |
| 13 | +Returns alerts from the current web, optionally filtered by list and user. |
| 14 | + |
| 15 | +## SYNTAX |
| 16 | + |
| 17 | +### All |
| 18 | +```powershell |
| 19 | +Get-PnPWebAlert [-UserName <String>] [-UserId <Guid>] [-Connection <PnPConnection>] |
| 20 | +``` |
| 21 | + |
| 22 | +### By List Id |
| 23 | +```powershell |
| 24 | +Get-PnPWebAlert -ListId <Guid> [-UserName <String>] [-UserId <Guid>] [-Connection <PnPConnection>] |
| 25 | +``` |
| 26 | + |
| 27 | +### By List Url |
| 28 | +```powershell |
| 29 | +Get-PnPWebAlert -ListUrl <String> [-UserName <String>] [-UserId <Guid>] [-Connection <PnPConnection>] |
| 30 | +``` |
| 31 | + |
| 32 | +### By List Title |
| 33 | +```powershell |
| 34 | +Get-PnPWebAlert -ListTitle <String> [-UserName <String>] [-UserId <Guid>] [-Connection <PnPConnection>] |
| 35 | +``` |
| 36 | + |
| 37 | +## DESCRIPTION |
| 38 | + |
| 39 | +Retrieves alerts from the current web using the REST API. You can optionally filter by list (ID, URL, or title) and by user. Specify either UserName or UserId, but not both. |
| 40 | + |
| 41 | +## EXAMPLES |
| 42 | + |
| 43 | +### EXAMPLE 1 |
| 44 | +```powershell |
| 45 | +Get-PnPWebAlert |
| 46 | +``` |
| 47 | + |
| 48 | +Returns all alerts for the current web. |
| 49 | + |
| 50 | +### EXAMPLE 2 |
| 51 | +```powershell |
| 52 | +Get-PnPWebAlert -ListTitle "Documents" |
| 53 | +``` |
| 54 | + |
| 55 | +Returns alerts for the list with title "Documents". |
| 56 | + |
| 57 | +### EXAMPLE 3 |
| 58 | +```powershell |
| 59 | +Get-PnPWebAlert -ListUrl "Lists/Tasks" -UserName "alex.wilber@contoso.com" |
| 60 | +``` |
| 61 | + |
| 62 | +Returns alerts for the list at the specified URL and for the specified user. |
| 63 | + |
| 64 | +### EXAMPLE 4 |
| 65 | +```powershell |
| 66 | +Get-PnPWebAlert -UserId 12345678-90ab-cdef-1234-567890abcdef |
| 67 | +``` |
| 68 | + |
| 69 | +Returns alerts for the specified user ID. |
| 70 | + |
| 71 | +## PARAMETERS |
| 72 | + |
| 73 | +### -Connection |
| 74 | +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. |
| 75 | + |
| 76 | +```yaml |
| 77 | +Type: PnPConnection |
| 78 | +Parameter Sets: (All) |
| 79 | + |
| 80 | +Required: False |
| 81 | +Position: Named |
| 82 | +Default value: None |
| 83 | +Accept pipeline input: False |
| 84 | +Accept wildcard characters: False |
| 85 | +``` |
| 86 | +
|
| 87 | +### -ListId |
| 88 | +The ID of the list to filter alerts by. |
| 89 | +
|
| 90 | +```yaml |
| 91 | +Type: Guid |
| 92 | +Parameter Sets: By List Id |
| 93 | + |
| 94 | +Required: True |
| 95 | +Position: Named |
| 96 | +Default value: None |
| 97 | +Accept pipeline input: False |
| 98 | +Accept wildcard characters: False |
| 99 | +``` |
| 100 | +
|
| 101 | +### -ListUrl |
| 102 | +The server-relative URL of the list to filter alerts by. |
| 103 | +
|
| 104 | +```yaml |
| 105 | +Type: String |
| 106 | +Parameter Sets: By List Url |
| 107 | + |
| 108 | +Required: True |
| 109 | +Position: Named |
| 110 | +Default value: None |
| 111 | +Accept pipeline input: False |
| 112 | +Accept wildcard characters: False |
| 113 | +``` |
| 114 | +
|
| 115 | +### -ListTitle |
| 116 | +The title of the list to filter alerts by. |
| 117 | +
|
| 118 | +```yaml |
| 119 | +Type: String |
| 120 | +Parameter Sets: By List Title |
| 121 | + |
| 122 | +Required: True |
| 123 | +Position: Named |
| 124 | +Default value: None |
| 125 | +Accept pipeline input: False |
| 126 | +Accept wildcard characters: False |
| 127 | +``` |
| 128 | +
|
| 129 | +### -UserId |
| 130 | +The user ID (GUID) to filter alerts by. Do not specify together with UserName. |
| 131 | +
|
| 132 | +```yaml |
| 133 | +Type: Guid |
| 134 | +Parameter Sets: (All) |
| 135 | + |
| 136 | +Required: False |
| 137 | +Position: Named |
| 138 | +Default value: None |
| 139 | +Accept pipeline input: False |
| 140 | +Accept wildcard characters: False |
| 141 | +``` |
| 142 | +
|
| 143 | +### -UserName |
| 144 | +The user principal name to filter alerts by. Do not specify together with UserId. |
| 145 | +
|
| 146 | +```yaml |
| 147 | +Type: String |
| 148 | +Parameter Sets: (All) |
| 149 | + |
| 150 | +Required: False |
| 151 | +Position: Named |
| 152 | +Default value: None |
| 153 | +Accept pipeline input: False |
| 154 | +Accept wildcard characters: False |
| 155 | +``` |
| 156 | +
|
| 157 | +## OUTPUTS |
| 158 | +
|
| 159 | +### Type |
| 160 | +PnP.PowerShell.Commands.Model.SharePoint.WebAlert |
| 161 | +
|
| 162 | +## RELATED LINKS |
| 163 | +
|
| 164 | +[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp) |
0 commit comments