Loop though multiples tenants with Connect-AzAccount #28421
-
I'm trying to loop through multiples tenant and subscriptions with a script,
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Why don't you connect once and use |
Beta Was this translation helpful? Give feedback.
Why don't you connect once and use
Select-AzSubscription -Tenant $sub.TenantId -Subscription $sub.SubscriptionId
in your loop ? If your account has permissions to all tenant, then you don't need to log in every time .