Search Results for

    Show / Hide Table of Contents

    Add-PnPFolderAnonymousSharingLink

    SYNOPSIS

    Creates an anonymous sharing link to share a folder.

    SYNTAX

    Add-PnPFolderAnonymousSharingLink -Folder <FolderPipeBind> -Type <PnP.Core.Model.Security.ShareType> -Password <String> -ExpirationDateTime <DateTime> [-Connection <PnPConnection>] 
    

    DESCRIPTION

    Creates a new anonymous sharing link for a folder.

    EXAMPLES

    EXAMPLE 1

    Add-PnPFolderAnonymousSharingLink -Folder "/sites/demo/Shared Documents/Test"
    

    This will create an anonymous sharing link for Test folder in the Shared Documents library which will be viewable to anonymous users.

    EXAMPLE 2

    Add-PnPFolderAnonymousSharingLink -Folder "/sites/demo/Shared Documents/Test" -Type Edit -Password "PnPRocks!"
    

    This will create an anonymous sharing link for Test folder in the Shared Documents library which will be editable by anonymous users with the specified password.

    EXAMPLE 3

    Add-PnPFolderAnonymousSharingLink -Folder "/sites/demo/Shared Documents/Test" -Type Edit -Password "PnPRocks!" -ExpirationDateTime (Get-Date).AddDays(15)
    

    This will create an anonymous sharing link for Test folder in the Shared Documents library which will be editable by anonymous users with the specified password. The link will expire after 15 days.

    PARAMETERS

    -Connection

    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
    

    -Folder

    The folder in the site

    Type: FolderPipeBind
    Parameter Sets: (All)
    
    Required: True
    Position: Named
    Default value: None
    Accept pipeline input: False
    Accept wildcard characters: False
    

    -ShareType

    The type of sharing that you want to, i.e do you want to enable anonymous users to view the shared content or also edit the content?

    Review and BlocksDownload values are not supported.

    Type: PnP.Core.Model.Security.ShareType
    Parameter Sets: (All)
    
    Required: False
    Position: Named
    Default value: View
    Accept pipeline input: False
    Accept wildcard characters: False
    

    -Password

    The password for the folder which will be shared anonymously.

    Type: String
    Parameter Sets: (All)
    
    Required: False
    Position: Named
    Default value: None
    Accept pipeline input: False
    Accept wildcard characters: False
    

    -ExpirationDateTime

    The expiration date for the folder after which the shared link will stop working.

    Type: String
    Parameter Sets: (All)
    
    Required: True
    Position: Named
    Default value: None
    Accept pipeline input: False
    Accept wildcard characters: False
    

    RELATED LINKS

    Microsoft 365 Patterns and Practices

    Back to top Generated by DocFX spacer