The Get-PnPUserProfileProperty (part of the Officedev Pnp Powershell commandlets) can be used to query User Profiles on SharePoint Online. We must connect to the tenant admin website (https://:-admin.sharepoint.com) with Connect-PnPOnline in order to use this cmdlet with SharePoint Online.
I would like to use the commandlet to talk to an On Premise SharePoint server too
I've tested this, but as far as I can see this commandlet is not included in the On Premise version of the Officedev PNP Powershell Commandlets. In the documentation I cannot find a definite answer.
Can someone confirm that this commandlet does indeed not work with SharePoint Server?