web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Report on all Power Pa...
Power Pages
Unanswered

Report on all Power Pages Sites

(0) ShareShare
ReportReport
Posted on by 15

Dear All

I've been asked to report on our Power Pages Sites detailing in particular the 'Security' settings (certificate/ website authentication key expiration dates etc.)

Is this something that can be done programatically? is there an API that i can use to query such information?

 

Many thanks for your time and consideration

Ed.

Categories:
  • MonkeySee Profile Picture
    15 on at

    Hello Everyone

     

    Just an update as to how I'm progressing this.

     

    I've managed to cobble together quite a few PowerShell functions that get all the information I require from https://admin.powerplatform.microsoft.com 

     

    For example:

    function Get-Portal {
     [CmdletBinding()]
     param (
     [Parameter(Position=0,mandatory=$true)]
     [string] $bearerToken
     )
     $headers = @{
     'Authorization' = "Bearer $bearerToken"
     }
     $uri = "https://portalsitewide-gbr.portal-infra.dynamics.com/api/v1/powerPortal/ListPortals"
     $result = Invoke-RestMethod -Method Get -Uri $uri -Headers $headers
    
     return $result | ConvertFrom-Json
    }

    I'm just struggling with the Authorization Bearer token. Currently, I'm capturing it from my manually initiated web session and its working fine. I just want to be able to programmatically 'get' the authorization bearer token rather then the fudged solution I'm currently using. 

     

    If anyone has any ideas or resources that might help I'd be very grateful

     

    kind regards 

  • chuhailinh Profile Picture
    16 on at

    Hi @MonkeySee , do you have any document about this api, because I see that, seems this api url depends on the geo localtion like 'gbr' in your code snippet

     

  • MonkeySee Profile Picture
    15 on at

    Hi chuhailinh,

    No i don't have any documentation.

    I've had to work it out for myself by capturing the web traffic generated when i visit the powerplatform admin center

    regards,

  • chuhailinh Profile Picture
    16 on at

    Hi @MonkeySee , thank you for your answer
    I see that for each geo location, the url is differrent, do you know how to get the mapping for geo and url

  • Fubar Profile Picture
    17 Super User 2026 Season 1 on at

    Don't know if this helps, but it is how you would get the token for other apps https://learn.microsoft.com/en-us/power-platform/admin/programmability-authentication-v2#step-5-request-an-access-token

  • chuhailinh Profile Picture
    16 on at

    Hi @Fubar , I tried it with this api https://learn.microsoft.com/en-us/rest/api/power-platform/powerpages/websites/get-website-by-id, but when I used service principal flow to get access token the api will not work, it is only work when I used user name password flow to get access token. I am not sure the reason is this Note. Do you know the real reason?

    chuhailinh_0-1718253014785.png

     

  • MonkeySee Profile Picture
    15 on at

    Many thanks for your input @Fubar I'll take a look and see if i can make it work using the info

    With much appreciation,

    MonkeySee

  • MonkeySee Profile Picture
    15 on at

    Hi @Fubar 

    Good News! With the help of that article you provided, i'm able to generate a bearer token using my azure app.

    Bad News... when i use that bearer token to query the endpoints (for example:

    "Message": "Authorization has been denied for this request."

    I'm assuming my app doesn't have the correct permissions set out in the 'scp:' of the bearer token. Does anyone know what api permissions my app needs to be able to query the portals and powerpages?

    In an attempt to get it working, i set the following api permissions on the app:

    MonkeySee_0-1718268746708.png

    Sadly, those permissions don't seem enough 😞

     

  • chuhailinh Profile Picture
    16 on at

    you should use these apis https://learn.microsoft.com/en-us/rest/api/power-platform/powerpages/websites with the token from the document that Fubar sent. apis in this document have same actions with yours but not enough fields

  • MonkeySee Profile Picture
    15 on at

    Many thanks @chuhailinh 

    Generating a token and sending it to https://api.powerplatform.com/powerpages/environments/{environmentId}/websites?api-version=2022-03-01-preview did indeed result in some information regarding the website being sent back!!.... but sadly not the piece of information i wanted 😢

    I was specifically after the expiration date of the 'Website Authentication Key' and similar details relating to any SSL certificates assigned.

     

    Again, Many thanks

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Pages

#1
Mohsin Ali Profile Picture

Mohsin Ali 35

#2
M Bilal Khan Profile Picture

M Bilal Khan 29

#3
11manish Profile Picture

11manish 23 Super User 2026 Season 2

Last 30 days Overall leaderboard