Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Get Azure subscription login information and CSP tenant account
- Write-Host "Please enter the Domain Name of the Azure customer tenant you would like to access."
- Write-Host "Ex: NebulaCorp.onmicrosoft.com`n" -ForegroundColor Cyan
- $TenantFQDN = Read-Host
- #Login to Azure using supplied credentials and define the Tenant ID as the default tenant to make changes to.
- Login-AzureRmAccount -Tenant $TenantFQDN
- #Get TenantID and SubscriptionID
- $TenantID = (Get-AzureRmContext).Tenant.Id
- $SubscriptionId = (Get-AzureRmSubscription -TenantId $TenantID) | ?{$_.SubscriptionName -like "*Azure*" -and $_.State -eq "Enabled"} | Select-Object -ExpandProperty SubscriptionId
- #Select Azure Subscription to make changes to
- Select-AzureRmSubscription -TenantId $TenantID -SubscriptionId $SubscriptionID
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement