@WallisJohnINFOSYS-5992 It is not possible to use Get-MsolAccountSku with connecting to msol-service and using a service principal. I suggest you to Microsoft Graph API to get the license details. You need to hit the endpoint - https://graph.microsoft.com/v1.0/subscribedSkus
to get all SKUs. If you want to get only specific information then you need to use $select like this - https://graph.microsoft.com/v1.0/subscribedSkus?$select = Skuid,skupartnumber, consumedUnits, prepaidunits
Here is the output for your reference. You can follow the documentation for details.
Now, if you want to use this endpoint from an application service principal, then you need to register the application in Azure Active Directory, provide API permissions for Microsoft Graph to the application. Minimum required permission for using application context is User.Read.All as listed in the above documentation link.
Please refer to Get access without a user to understand the concepts of calling Microsoft Graph API with application context with no logged in user.
Also, if you want to call Microsoft Graph using PowerShell then you need to do some scripting as detailed in this blog.
Please do not forget to "Accept the answer" wherever the information provided helps you to help others in the community.