question

nellie-2760 avatar image
0 Votes"
nellie-2760 asked EmilyDu-MSFT commented

how do u get a full url path for a given sharepint online folder

Hi there have a criteria
there is a doc library on sharepint online which has many folders within this.
A user wants to put a title of a folder to find e.g 'Fox hides in the wood at 8:00 pm to catch a rabbit called f01xi' , how do I find the folder within the doc library.
I have tried pnp PowerShell using encode decode URL but no job, how can get I get full URL for a given folder title.

thanks

office-sharepoint-online
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@nellie-2760

I'm checking how the things are going on about this issue. Whether the answer helps you?

You can accept the answer if it helps.


If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.




0 Votes 0 ·

@nellie-2760

Is there any progress on this issue?

If you find any answers helpful to you, please remember to accept them.

It will help others who meet the similar question in this forum.

Thank you for your understanding.


If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 Votes 0 ·
EmilyDu-MSFT avatar image
0 Votes"
EmilyDu-MSFT answered EmilyDu-MSFT edited

@nellie-2760

Try below PowerShell.

 #Variables
 $SiteURL = "site URL"
 $LibraryName = "library name"
 $FolderName = "folder name"
    
 Try {
     #Get Credentials to connect
     $Cred= Get-Credential
     $Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Cred.Username, $Cred.Password)
    
     #Setup the context
     $Ctx = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL)
     $Ctx.Credentials = $Credentials
      
     #Get the Library
     $Library = $Ctx.web.Lists.GetByTitle($LibraryName)
     $Folders = $Library.RootFolder.Folders
     $Ctx.Load($Folders)
     $Ctx.executeQuery()
    
     #Get the Folder by Name
     $Folder = $Folders | Where {$_.Name -eq $FolderName}
     $Ctx.Load($Folder)
     $Ctx.ExecuteQuery() 
        
     #Get Some Folder Properties
     Write-host -f Green "Folder URL:"$Folder.ServerRelativeUrl
 }
 Catch {
     write-host -f Red "Error Getting Folder!" $_.Exception.Message
 }

If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

EmilyDu-MSFT avatar image
0 Votes"
EmilyDu-MSFT answered nellie-2760 commented

@nellie-2760

Based on your description, I understand that yon want to find the path of the folder whose name is "Fox hides in the wood at 8:00 pm to catch a rabbit called f01xi".

1.Use Search to find this folder.

77590-1.png

2.Select the file, click details panel, copy path.

77616-2.png


If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.






1.png (86.6 KiB)
2.png (45.8 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi there thanks very much but sharepoint search is disabled(i KNOW) ... I need it as PNP ... can caml do it ?

0 Votes 0 ·