Pregunta

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")
¿Fue útil?

Solución

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 
Licenciado bajo: CC-BY-SA con atribución
scroll top