Get Site URL using Keyword query Search api
-
20-01-2021 - |
Question
I want to get Site URL using Keyword Query power shell..
Below are properties(b and lastmodifiedtime) im retrieving using keyword query ..likewise i want to get Site URL using below approach,how can i get?
Can anyone help me in this?
$keywordQuery.SelectProperties.Add("Created")
$keywordQuery.SelectProperties.Add("LastModifiedTime")
La solution
To get the current web URL, you can use the SPWebUrl
managed property.
To get the current site collection, you can use the SPSiteUrl
managed property.
So, append the below code as to your code:
$keywordQuery.SelectProperties.Add("SPWebUrl") // to get SP Web Url
$keywordQuery.SelectProperties.Add("SPSiteUrl") // to get SP Site Url
Licencié sous: CC-BY-SA avec attribution
Non affilié à sharepoint.stackexchange