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

Iron Contributor

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

 

Thanks

Stefan

3 Replies

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 
 
works great.! and it is security trimmed. :)

thanks