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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Engage with the Community
Unanswered

How to switch tenants in Power Platform PowerShell to disable Power Pages Creation with test tenant

(2) ShareShare
ReportReport
Posted on by 4
Hi I would like to disable Power Pages Creation in my UAT tenant, where I have the admin role.
 

However, when I run the PowerShell commands (Set-TenantSettings -RequestBody @{ "disablePortalsCreationByNonAdminUsers" = $true }) they always connect to my default production tenant, where I am not an admin.

I would like to know how to:


  1. Force PowerShell to log in to a specific tenant (UAT) so I can disable Power Pages only in that tenant, and

  2. Re-login back to my default production tenant afterwards when needed.

What is the correct way to switch tenants in Power Platform PowerShell to avoid affecting the wrong tenant?


 
I have the same question (0)
  • Vahid Ghafarpour Profile Picture
    12,068 Super User 2025 Season 2 on at
    I think this cmdlet will help but I didn't test
    Connect-AdminPowerAppEnvironment -TenantId $tenantId -Credential $Credential
     
     

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Engage with the Community

#1
Pallavi Phade Profile Picture

Pallavi Phade 52

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 41 Super User 2025 Season 2

#3
Adis Profile Picture

Adis 20 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans