Module Name | schema | applicable | online version | external help file | title |
---|---|---|---|---|---|
PnP.PowerShell |
2.0.0 |
SharePoint Online |
PnP.PowerShell.dll-Help.xml |
Add-PnPFileSharingInvite |
Creates an invitation for users to a file.
Add-PnPFileSharingInvite -FileUrl <String> -Users <String[]> -Message <String> -RequireSignIn <SwitchParameter> -SendInvitation <SwitchParameter> -Role <PermissionRole> -ExpirationDateTime <DateTime> [-Connection <PnPConnection>]
Creates an invitation for users to a file.
Add-PnPFileSharingInvite -FileUrl "/sites/demo/Shared Documents/Test.docx" -Users "[email protected]" -RequireSignIn
This will invite the user [email protected]
to the Test.docx
file with Read permissions and will require that user to sign in before accessing the file.
Add-PnPFileSharingInvite -FileUrl "/sites/demo/Shared Documents/Test.docx" -Users "[email protected]" -RequireSignIn -SendInvitation -Role Owner
This will invite the user [email protected]
to the Test.docx
file with Read permissions and will require that user to sign in before accessing the file. The invitation will be sent and the user will have Owner
permissions
Add-PnPFileSharingInvite -FileUrl "/sites/demo/Shared Documents/Test.docx" -Users "[email protected]" -RequireSignIn -ExpirationDate (Get-Date).AddDays(15)
This will invite the user [email protected]
to the Test.docx
file with Read permissions and will require that user to sign in before accessing the file. The link will expire after 15 days.
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.
Type: PnPConnection
Parameter Sets: (All)
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The FileUrl in the site
Type: String
Parameter Sets: (All)
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
A collection of recipients who will receive access and the sharing invitation. Currently, only one user at a time is supported. We are planning to add support for multiple users a bit later.
Type: String[]
Parameter Sets: (All)
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
A plain text formatted message that is included in the sharing invitation. Maximum length 2000 characters.
Type: String
Parameter Sets: (All)
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies where the recipient of the invitation is required to sign-in to view the shared item
Type: SwitchParamter
Parameter Sets: (All)
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies if an email or post is generated (false) or if the permission is just created (true).
Type: SwitchParamter
Parameter Sets: (All)
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specify the role that is to be granted to the recipients of the sharing invitation.
Supported values are Owner
, Write
and Read
.
Type: PnP.Core.Model.Security.PermissionRole
Parameter Sets: (All)
Required: False
Position: Named
Default value: Read
Accept pipeline input: False
Accept wildcard characters: False
The expiration date for the FileUrl after which the permission expires.
Type: String
Parameter Sets: (All)
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False