et all site collection in a on-premise SharePoint 2016 farm with PNP PowerShell

Highlighted
Regular Contributor

Hi, is it possible to get all site collection in a on-premise SharePoint 2016 farm with PNP PowerShell?

 

Thanks

Stefan

3 Replies
Highlighted

There is one solution with serach

 

$results = Submit-PnPSearchQuery -Query "ContentClass:STS_Site" -TrimDuplicates:$false
$urls = $results.ResultRows | ForEach-Object{$_.SPWebUrl}
 
Vesa Juvonen was give me the hint to use the search.  Thanks 
 
Highlighted
works great.! and it is security trimmed. :)

thanks