Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ####################################################
- # Script Name: CreateTenantOfferWithPowerShell.ps1
- # Author Name: Carlos Vargas
- # Version : 1.0
- ####################################################
- clear
- Write-Host "**************** Azure Stack Create Tenant Offers *********************"
- Write-Host "*************************By Carlos Vargas******************************"
- ############
- # Variables
- ############
- ## Azure Stack Tool Variable
- $azurestacktools = "F:\OneDrive\Documents\Scripts\AzureStack\AzureStackToolsMaster\AzureSTack-Tools-master"
- ###################
- # Login Credentials
- ###################
- ## Get Azure Stack Credentials
- $azurestackuser = Read-Host "Type your Azure Stack Admin Username. Ex azurestackadmin@domain.onmicrosoft.com"
- $azurestackpass = Read-Host "Type your Azure Stack Admin Password" -AsSecureString
- $azurestackcreds = New-Object System.Management.Automation.PSCredential ($azurestackuser,$azurestackpass)
- $aadtenantid = Read-Host "Type your Azure AAD Tenant ID. Ex. domain.onmicrosoft.com"
- $tenantoffername = Read-Host "Type the Name for your Tenant Offer. Ex: Offer1"
- ###########################################
- # Import AzureStack Infrastructure Modules
- ###########################################
- Import-Module $azurestacktools"\Connect\AzureStack.Connect.psm1"
- Import-Module $azurestacktools"\serviceAdmin\AzureStack.ServiceAdmin.psm1"
- ## Login To Azure Stack
- Login-AzureRmAccount -Credential $AzureStackCreds #-TenantId $AadTenant
- ### Add Azure Tenant If you Know it
- Add-AzureStackAzureRmEnvironment -AadTenant $AadTenantid
- ################################
- # Target your Local Azure Stack
- ################################
- $AzureStackAccountDetails = Add-AzureRmAccount -EnvironmentName AzureStack -Credential $AzureStackCreds
- #################################
- # Create Tenant Offer And Quotas
- #################################
- New-AzureStackTenantOfferAndQuotas -ServiceAdminCredential $azurestackcreds -Name $tenantoffername
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement