Advertisement
Guest User

Untitled

a guest
Feb 10th, 2017
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.94 KB | None | 0 0
  1. ####################################################
  2. # Script Name: CreateTenantOfferWithPowerShell.ps1
  3. # Author Name: Carlos Vargas
  4. # Version : 1.0
  5. ####################################################
  6.  
  7.  
  8. clear
  9.  
  10. Write-Host "**************** Azure Stack Create Tenant Offers *********************"
  11. Write-Host "*************************By Carlos Vargas******************************"
  12.  
  13. ############
  14. # Variables
  15. ############
  16. ## Azure Stack Tool Variable
  17. $azurestacktools = "F:\OneDrive\Documents\Scripts\AzureStack\AzureStackToolsMaster\AzureSTack-Tools-master"
  18.  
  19. ###################
  20. # Login Credentials
  21. ###################
  22. ## Get Azure Stack Credentials
  23. $azurestackuser = Read-Host "Type your Azure Stack Admin Username. Ex azurestackadmin@domain.onmicrosoft.com"
  24. $azurestackpass = Read-Host "Type your Azure Stack Admin Password" -AsSecureString
  25. $azurestackcreds = New-Object System.Management.Automation.PSCredential ($azurestackuser,$azurestackpass)
  26. $aadtenantid = Read-Host "Type your Azure AAD Tenant ID. Ex. domain.onmicrosoft.com"
  27. $tenantoffername = Read-Host "Type the Name for your Tenant Offer. Ex: Offer1"
  28.  
  29.  
  30. ###########################################
  31. # Import AzureStack Infrastructure Modules
  32. ###########################################
  33. Import-Module $azurestacktools"\Connect\AzureStack.Connect.psm1"
  34. Import-Module $azurestacktools"\serviceAdmin\AzureStack.ServiceAdmin.psm1"
  35.  
  36. ## Login To Azure Stack
  37. Login-AzureRmAccount -Credential $AzureStackCreds #-TenantId $AadTenant
  38.  
  39. ### Add Azure Tenant If you Know it
  40. Add-AzureStackAzureRmEnvironment -AadTenant $AadTenantid
  41.  
  42. ################################
  43. # Target your Local Azure Stack
  44. ################################
  45. $AzureStackAccountDetails = Add-AzureRmAccount -EnvironmentName AzureStack -Credential $AzureStackCreds
  46.  
  47. #################################
  48. # Create Tenant Offer And Quotas
  49. #################################
  50. New-AzureStackTenantOfferAndQuotas -ServiceAdminCredential $azurestackcreds -Name $tenantoffername
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement