Skip to content

Instantly share code, notes, and snippets.

@carlosvargasvip
Created February 10, 2017 19:07
Show Gist options
  • Save carlosvargasvip/b17046ffed373456926e2df0b3cc7325 to your computer and use it in GitHub Desktop.
Save carlosvargasvip/b17046ffed373456926e2df0b3cc7325 to your computer and use it in GitHub Desktop.
####################################################
# 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment