From c765596acf20e2756bfb3a8a61f1f646dccf38b5 Mon Sep 17 00:00:00 2001 From: David Smith <17909720+cloudwidth@users.noreply.github.com> Date: Tue, 12 Mar 2019 11:44:36 -0500 Subject: [PATCH 01/16] add southcentralus as an allowed location --- active-directory-new-domain-with-data/azuredeploy.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/active-directory-new-domain-with-data/azuredeploy.json b/active-directory-new-domain-with-data/azuredeploy.json index 1e92e42..aca7501 100644 --- a/active-directory-new-domain-with-data/azuredeploy.json +++ b/active-directory-new-domain-with-data/azuredeploy.json @@ -29,7 +29,8 @@ "East US", "West Europe", "East Asia", - "Southeast Asia" + "Southeast Asia", + "South Central US" ], "metadata": { "description": "The region to deploy the resources into" From e4b3208143c336caff33f5ade6fd87c43b546ba5 Mon Sep 17 00:00:00 2001 From: David Smith Date: Tue, 12 Mar 2019 11:54:25 -0500 Subject: [PATCH 02/16] updated URI and added southcentralus --- .../azuredeploy.parameters.json | 2 +- .../vnet-with-dns-server.json | 3 ++- active-directory-new-domain-with-data/vnet.json | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/active-directory-new-domain-with-data/azuredeploy.parameters.json b/active-directory-new-domain-with-data/azuredeploy.parameters.json index 478449c..a19b63a 100644 --- a/active-directory-new-domain-with-data/azuredeploy.parameters.json +++ b/active-directory-new-domain-with-data/azuredeploy.parameters.json @@ -27,7 +27,7 @@ "value": "GEN-UNIQUE" }, "assetLocation": { - "value": "https://raw.githubusercontent.com/GoateePFE/AzureRM/master/active-directory-new-domain-with-data/" + "value": "https://raw.githubusercontent.com/cloudwidth/ADDS-with-Data/master/active-directory-new-domain-with-data/" } } } diff --git a/active-directory-new-domain-with-data/vnet-with-dns-server.json b/active-directory-new-domain-with-data/vnet-with-dns-server.json index 49e9d25..0c74a89 100644 --- a/active-directory-new-domain-with-data/vnet-with-dns-server.json +++ b/active-directory-new-domain-with-data/vnet-with-dns-server.json @@ -9,7 +9,8 @@ "East US", "West Europe", "East Asia", - "Southeast Asia" + "Southeast Asia", + "South Central US" ], "metadata": { "Description": "The region to deploy the resources into" diff --git a/active-directory-new-domain-with-data/vnet.json b/active-directory-new-domain-with-data/vnet.json index 3fcd8e2..3c86d82 100644 --- a/active-directory-new-domain-with-data/vnet.json +++ b/active-directory-new-domain-with-data/vnet.json @@ -9,7 +9,8 @@ "East US", "West Europe", "East Asia", - "Southeast Asia" + "Southeast Asia", + "South Central US" ], "metadata": { "Description": "The region to deploy the resources into" From 84045a6ced10f0c2ab1bdb589e3491d6a064670a Mon Sep 17 00:00:00 2001 From: David Smith Date: Tue, 12 Mar 2019 11:59:23 -0500 Subject: [PATCH 03/16] updated URI and changed to AZ PS module cmdlets --- .../CallingScript.ps1 | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/active-directory-new-domain-with-data/CallingScript.ps1 b/active-directory-new-domain-with-data/CallingScript.ps1 index 38332e5..49d36f5 100644 --- a/active-directory-new-domain-with-data/CallingScript.ps1 +++ b/active-directory-new-domain-with-data/CallingScript.ps1 @@ -22,14 +22,14 @@ Login-AzureRmAccount # Adjust the 'yournamehere' part of these three strings to # something unique for you. Leave the last two characters in each. -$URI = 'https://raw.githubusercontent.com/GoateePFE/AzureRM/master/active-directory-new-domain-with-data/azuredeploy.json' -$Location = 'east us' -$rgname = 'yournamehererg' -$saname = 'yournameheresa' # Lowercase required -$addnsName = 'yournameheread' # Lowercase required +$URI = 'https://raw.githubusercontent.com/cloudwidth/ADDS-with-Data/master/active-directory-new-domain-with-data/azuredeploy.json' +$Location = 'south central us' +$rgname = 'RG-OnPremDatacenter' +$saname = 'saonpredcadds' # Lowercase required +$addnsName = 'onpremadds' # Lowercase required # Check that the public dns $addnsName is available -if (Test-AzureRmDnsAvailability -DomainNameLabel $addnsName -Location $Location) +if (Test-AzDnsAvailability -DomainNameLabel $addnsName -Location $Location) { 'Available' } else { 'Taken. addnsName must be globally unique.' } # Create the new resource group. Runs quickly. @@ -38,7 +38,7 @@ New-AzureRmResourceGroup -Name $rgname -Location $Location # Parameters for the template and configuration $MyParams = @{ newStorageAccountName = $saname - location = 'East US' + location = 'South Central US' domainName = 'alpineskihouse.com' addnsName = $addnsName } @@ -53,7 +53,7 @@ $SplatParams = @{ # This takes ~30 minutes # One prompt for the domain admin password -New-AzureRmResourceGroupDeployment @SplatParams -Verbose +New-AzResourceGroupDeployment @SplatParams -Verbose # Find the VM IP and FQDN $PublicAddress = (Get-AzureRmPublicIpAddress -ResourceGroupName $rgname)[0] From d0d8aa8bc2bb1d6b031c6c9d8406f53dae451f8e Mon Sep 17 00:00:00 2001 From: David Smith Date: Tue, 12 Mar 2019 12:01:12 -0500 Subject: [PATCH 04/16] updated URI --- active-directory-new-domain-with-data/azuredeploy.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/active-directory-new-domain-with-data/azuredeploy.json b/active-directory-new-domain-with-data/azuredeploy.json index aca7501..ff70ac4 100644 --- a/active-directory-new-domain-with-data/azuredeploy.json +++ b/active-directory-new-domain-with-data/azuredeploy.json @@ -193,7 +193,7 @@ "metadata": { "description": "The location of resources such as templates and DSC modules that the script is dependent" }, - "defaultValue": "https://raw.githubusercontent.com/GoateePFE/AzureRM/master/active-directory-new-domain-with-data/" + "defaultValue": "https://raw.githubusercontent.com/cloudwidth/ADDS-with-Data/master/active-directory-new-domain-with-data/" } }, "variables": { From c0bee8ecf393040fc2073974e9ddbf9ab1f83b00 Mon Sep 17 00:00:00 2001 From: David Smith Date: Tue, 12 Mar 2019 12:05:08 -0500 Subject: [PATCH 05/16] updated az cmd --- active-directory-new-domain-with-data/CallingScript.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/active-directory-new-domain-with-data/CallingScript.ps1 b/active-directory-new-domain-with-data/CallingScript.ps1 index 49d36f5..ee26159 100644 --- a/active-directory-new-domain-with-data/CallingScript.ps1 +++ b/active-directory-new-domain-with-data/CallingScript.ps1 @@ -56,7 +56,7 @@ $SplatParams = @{ New-AzResourceGroupDeployment @SplatParams -Verbose # Find the VM IP and FQDN -$PublicAddress = (Get-AzureRmPublicIpAddress -ResourceGroupName $rgname)[0] +$PublicAddress = (Get-AzPublicIpAddress -ResourceGroupName $rgname)[0] $IP = $PublicAddress.IpAddress $FQDN = $PublicAddress.DnsSettings.Fqdn @@ -75,4 +75,4 @@ Start-Process -FilePath mstsc.exe -ArgumentList "/v:$IP" # Users root container has test users and populated test groups # Delete the entire resource group when finished -Remove-AzureRmResourceGroup -Name $rgname -Force -Verbose +Remove-AzResourceGroup -Name $rgname -Force -Verbose From edead6b9eae9c3aef42aa0a385be9e106c8a0578 Mon Sep 17 00:00:00 2001 From: David Smith Date: Tue, 12 Mar 2019 13:36:20 -0500 Subject: [PATCH 06/16] add'l powershell changes to az module --- active-directory-new-domain-with-data/CallingScript.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/active-directory-new-domain-with-data/CallingScript.ps1 b/active-directory-new-domain-with-data/CallingScript.ps1 index ee26159..c6910be 100644 --- a/active-directory-new-domain-with-data/CallingScript.ps1 +++ b/active-directory-new-domain-with-data/CallingScript.ps1 @@ -18,7 +18,7 @@ Import-AzureRM -Verbose Import-Module Azure -Verbose # Authenticate to your Azure account -Login-AzureRmAccount +Login-AzAccount # Adjust the 'yournamehere' part of these three strings to # something unique for you. Leave the last two characters in each. @@ -33,7 +33,7 @@ if (Test-AzDnsAvailability -DomainNameLabel $addnsName -Location $Location) { 'Available' } else { 'Taken. addnsName must be globally unique.' } # Create the new resource group. Runs quickly. -New-AzureRmResourceGroup -Name $rgname -Location $Location +New-AzResourceGroup -Name $rgname -Location $Location # Parameters for the template and configuration $MyParams = @{ From a9cafb7ae159aed25da185a787e5ea715d589ce9 Mon Sep 17 00:00:00 2001 From: David Smith Date: Fri, 26 Apr 2019 11:28:30 -0500 Subject: [PATCH 07/16] updated to use name prefix --- .../CallingScript.ps1 | 13 +-- .../azuredeploy.json | 94 +++++++------------ .../azuredeploy.parameters.json | 3 + 3 files changed, 42 insertions(+), 68 deletions(-) diff --git a/active-directory-new-domain-with-data/CallingScript.ps1 b/active-directory-new-domain-with-data/CallingScript.ps1 index c6910be..d451773 100644 --- a/active-directory-new-domain-with-data/CallingScript.ps1 +++ b/active-directory-new-domain-with-data/CallingScript.ps1 @@ -23,15 +23,16 @@ Login-AzAccount # Adjust the 'yournamehere' part of these three strings to # something unique for you. Leave the last two characters in each. $URI = 'https://raw.githubusercontent.com/cloudwidth/ADDS-with-Data/master/active-directory-new-domain-with-data/azuredeploy.json' -$Location = 'south central us' -$rgname = 'RG-OnPremDatacenter' -$saname = 'saonpredcadds' # Lowercase required -$addnsName = 'onpremadds' # Lowercase required +$Location = 'South Central US' +$rgname = 'RG-2019AzureGlobalBootcamp' +$saname = 'mysa2019agb' # Lowercase required +$addnsName = 'agbdemo' # Lowercase required # Check that the public dns $addnsName is available if (Test-AzDnsAvailability -DomainNameLabel $addnsName -Location $Location) { 'Available' } else { 'Taken. addnsName must be globally unique.' } + # Create the new resource group. Runs quickly. New-AzResourceGroup -Name $rgname -Location $Location @@ -39,7 +40,7 @@ New-AzResourceGroup -Name $rgname -Location $Location $MyParams = @{ newStorageAccountName = $saname location = 'South Central US' - domainName = 'alpineskihouse.com' + domainName = 'azureglobalbootcamp.com' addnsName = $addnsName } @@ -48,7 +49,7 @@ $SplatParams = @{ TemplateUri = $URI ResourceGroupName = $rgname TemplateParameterObject = $MyParams - Name = 'AlpineSkiHouseForest' + Name = '2019AzureGlobalBootcampForest' } # This takes ~30 minutes diff --git a/active-directory-new-domain-with-data/azuredeploy.json b/active-directory-new-domain-with-data/azuredeploy.json index ff70ac4..dd44725 100644 --- a/active-directory-new-domain-with-data/azuredeploy.json +++ b/active-directory-new-domain-with-data/azuredeploy.json @@ -36,12 +36,11 @@ "description": "The region to deploy the resources into" } }, - "virtualNetworkName": { + "namePrefix": { "type": "string", "metadata": { - "description": "The name of the Virtual Network to Create" - }, - "defaultValue": "adVNET" + "description": "naming prefix used for all components" + } }, "virtualNetworkAddressRange": { "type": "string", @@ -50,13 +49,6 @@ }, "defaultValue": "10.0.0.0/16" }, - "adSubnetName": { - "type": "string", - "metadata": { - "description": "The name of the subnet created in the new VNET" - }, - "defaultValue": "adSubnet" - }, "adSubnet": { "type": "string", "metadata": { @@ -64,13 +56,6 @@ }, "defaultValue": "10.0.0.0/24" }, - "adNicName": { - "type": "string", - "metadata": { - "description": "The name of the NIC attached to the new VM" - }, - "defaultValue": "adNic" - }, "adNicIPAddress": { "type": "string", "metadata": { @@ -78,13 +63,6 @@ }, "defaultValue": "10.0.0.4" }, - "publicIPAddressName": { - "type": "string", - "metadata": { - "description": "The name of the public IP address used by the Load Balancer" - }, - "defaultValue": "adpublicIP" - }, "publicIPAddressType": { "type": "string", "allowedValues": [ @@ -96,13 +74,6 @@ }, "defaultValue": "Dynamic" }, - "adVMName": { - "type": "string", - "metadata": { - "description": "The name of the VM created" - }, - "defaultValue": "adDC" - }, "adminUsername": { "type": "string", "metadata": { @@ -162,13 +133,6 @@ "description": "Image SKU" } }, - "adAvailabilitySetName": { - "type": "string", - "metadata": { - "description": "The name of the availability set that the AD VM is created in" - }, - "defaultValue": "adAvailabiltySet" - }, "domainName": { "type": "string", "metadata": { @@ -200,11 +164,17 @@ "adLBFE": "LBFE", "adLBBE": "LBBE", "adRDPNAT": "adRDP", - "VnetID": "[resourceId('Microsoft.Network/virtualNetworks', parameters('virtualNetworkName'))]", - "adSubnetRef": "[concat(variables('VnetID'),'/subnets/',parameters('adSubnetName'))]", - "adNicId": "[resourceId('Microsoft.Network/networkInterfaces',parameters('adNicName'))]", + "adAvailabilitySetName": "[concat(parameters('namePrefix'),'AvailabilitySet')]", + "virtualNetworkName": "[concat(parameters('namePrefix'),'DC')]", + "adSubnetName": "[concat(parameters('namePrefix'),'-subnet')]", + "adNicName": "[concat(parameters('namePrefix'),'Nic')]", + "publicIPAddressName": "[concat(parameters('namePrefix'),'PIP')]", + "adVMName": "[concat(parameters('namePrefix'),'PIP')]", + "VnetID": "[resourceId('Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]", + "adSubnetRef": "[concat(variables('VnetID'),'/subnets/',variables('adSubnetName'))]", + "adNicId": "[resourceId('Microsoft.Network/networkInterfaces',variables('adNicName'))]", "adIPConfigID": "[concat(variables('adNicId'),'/ipConfigurations/ipconfig1')]", - "adLBName": "adLoadBalancer", + "adLBName": "[concat(parameters('namePrefix'),'LoadBalancer')]", "adlbID": "[resourceId('Microsoft.Network/loadBalancers',variables('adLBName'))]", "adlbFEConfigID": "[concat(variables('adlbID'),'/frontendIPConfigurations/',variables('adLBFE'))]", "adRDPNATRuleID": "[concat(variables('adlbID'),'/inboundNatRules/',variables('adRDPNAT'))]", @@ -229,7 +199,7 @@ { "apiVersion": "2015-05-01-preview", "type": "Microsoft.Network/publicIPAddresses", - "name": "[parameters('publicIPAddressName')]", + "name": "[variables('publicIPAddressName')]", "location": "[parameters('location')]", "properties": { "publicIPAllocationMethod": "[parameters('publicIPAddressType')]", @@ -240,7 +210,7 @@ }, { "type": "Microsoft.Compute/availabilitySets", - "name": "[parameters('adAvailabilitySetName')]", + "name": "[variables('adAvailabilitySetName')]", "apiVersion": "2015-05-01-preview", "location": "[parameters('location')]" }, @@ -259,13 +229,13 @@ "value": "[parameters('location')]" }, "virtualNetworkName": { - "value": "[parameters('virtualNetworkName')]" + "value": "[variables('virtualNetworkName')]" }, "virtualNetworkAddressRange": { "value": "[parameters('virtualNetworkAddressRange')]" }, "subnetName": { - "value": "[parameters('adSubnetName')]" + "value": "[variables('adSubnetName')]" }, "subnetRange": { "value": "[parameters('adSubnet')]" @@ -279,7 +249,7 @@ "type": "Microsoft.Network/loadBalancers", "location": "[parameters('location')]", "dependsOn": [ - "[resourceId('Microsoft.Network/publicIPAddresses',parameters('publicIPAddressName'))]" + "[resourceId('Microsoft.Network/publicIPAddresses',variables('publicIPAddressName'))]" ], "properties": { "frontendIPConfigurations": [ @@ -287,7 +257,7 @@ "name": "[variables('adLBFE')]", "properties": { "publicIPAddress": { - "id": "[resourceId('Microsoft.Network/publicIPAddresses',parameters('publicIPAddressName'))]" + "id": "[resourceId('Microsoft.Network/publicIPAddresses',variables('publicIPAddressName'))]" } } } @@ -314,7 +284,7 @@ } }, { - "name": "[parameters('adNicName')]", + "name": "[variables('adNicName')]", "type": "Microsoft.Network/networkInterfaces", "location": "[parameters('location')]", "dependsOn": [ @@ -350,12 +320,12 @@ { "apiVersion": "2015-05-01-preview", "type": "Microsoft.Compute/virtualMachines", - "name": "[parameters('adVMName')]", + "name": "[variables('adVMName')]", "location": "[parameters('location')]", "dependsOn": [ "[resourceId('Microsoft.Storage/storageAccounts',parameters('newStorageAccountName'))]", - "[resourceId('Microsoft.Network/networkInterfaces',parameters('adNicName'))]", - "[resourceId('Microsoft.Compute/availabilitySets', parameters('adAvailabilitySetName'))]", + "[resourceId('Microsoft.Network/networkInterfaces',variables('adNicName'))]", + "[resourceId('Microsoft.Compute/availabilitySets', variables('adAvailabilitySetName'))]", "[resourceId('Microsoft.Network/loadBalancers',variables('adlbName'))]" ], "properties": { @@ -363,10 +333,10 @@ "vmSize": "[parameters('adVMSize')]" }, "availabilitySet": { - "id": "[resourceId('Microsoft.Compute/availabilitySets', parameters('adAvailabilitySetName'))]" + "id": "[resourceId('Microsoft.Compute/availabilitySets', variables('adAvailabilitySetName'))]" }, "osProfile": { - "computerName": "[parameters('adVMName')]", + "computerName": "[variables('adVMName')]", "adminUsername": "[parameters('adminUsername')]", "adminPassword": "[parameters('adminPassword')]" }, @@ -390,7 +360,7 @@ "vhd": { "uri": "[concat('http://',parameters('newStorageAccountName'),'.blob.core.windows.net/vhds/', variables('adDataDisk'),'-1.vhd')]" }, - "name": "[concat(parameters('adVMName'),'-data-disk1')]", + "name": "[concat(variables('adVMName'),'-data-disk1')]", "caching": "None", "createOption": "empty", "diskSizeGB": "[variables('adDataDiskSize')]", @@ -401,7 +371,7 @@ "networkProfile": { "networkInterfaces": [ { - "id": "[resourceId('Microsoft.Network/networkInterfaces',parameters('adNicName'))]" + "id": "[resourceId('Microsoft.Network/networkInterfaces',variables('adNicName'))]" } ] } @@ -409,11 +379,11 @@ "resources": [ { "type": "Microsoft.Compute/virtualMachines/extensions", - "name": "[concat(parameters('adVMName'),'/CreateADForest')]", + "name": "[concat(variables('adVMName'),'/CreateADForest')]", "apiVersion": "2015-05-01-preview", "location": "[parameters('location')]", "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines', parameters('adVMName'))]" + "[resourceId('Microsoft.Compute/virtualMachines', variables('adVMName'))]" ], "properties": { "publisher": "Microsoft.Powershell", @@ -446,7 +416,7 @@ "type": "Microsoft.Resources/deployments", "apiVersion": "2015-01-01", "dependsOn": [ - "[concat('Microsoft.Compute/virtualMachines/', parameters('adVMName'),'/extensions/CreateADForest')]" + "[concat('Microsoft.Compute/virtualMachines/', variables('adVMName'),'/extensions/CreateADForest')]" ], "properties": { "mode": "Incremental", @@ -459,13 +429,13 @@ "value": "[parameters('location')]" }, "virtualNetworkName": { - "value": "[parameters('virtualNetworkName')]" + "value": "[variables('virtualNetworkName')]" }, "virtualNetworkAddressRange": { "value": "[parameters('virtualNetworkAddressRange')]" }, "subnetName": { - "value": "[parameters('adSubnetName')]" + "value": "[variables('adSubnetName')]" }, "subnetRange": { "value": "[parameters('adSubnet')]" diff --git a/active-directory-new-domain-with-data/azuredeploy.parameters.json b/active-directory-new-domain-with-data/azuredeploy.parameters.json index a19b63a..4b5af34 100644 --- a/active-directory-new-domain-with-data/azuredeploy.parameters.json +++ b/active-directory-new-domain-with-data/azuredeploy.parameters.json @@ -26,6 +26,9 @@ "addnsName": { "value": "GEN-UNIQUE" }, + "namePrefix": { + "value": "GEN-UNIQUE" + }, "assetLocation": { "value": "https://raw.githubusercontent.com/cloudwidth/ADDS-with-Data/master/active-directory-new-domain-with-data/" } From a19f7ab2da2fd0a53e8f319f340412128fb9051f Mon Sep 17 00:00:00 2001 From: David Smith Date: Fri, 26 Apr 2019 11:35:20 -0500 Subject: [PATCH 08/16] fixed vmname bug and updated callingscript --- active-directory-new-domain-with-data/CallingScript.ps1 | 5 ++++- active-directory-new-domain-with-data/azuredeploy.json | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/active-directory-new-domain-with-data/CallingScript.ps1 b/active-directory-new-domain-with-data/CallingScript.ps1 index d451773..95186f4 100644 --- a/active-directory-new-domain-with-data/CallingScript.ps1 +++ b/active-directory-new-domain-with-data/CallingScript.ps1 @@ -25,9 +25,11 @@ Login-AzAccount $URI = 'https://raw.githubusercontent.com/cloudwidth/ADDS-with-Data/master/active-directory-new-domain-with-data/azuredeploy.json' $Location = 'South Central US' $rgname = 'RG-2019AzureGlobalBootcamp' -$saname = 'mysa2019agb' # Lowercase required +$namePrefix = '2019AGBDemo' +$saname = ('sa' + $namePrefix).ToLower() # Lowercase required $addnsName = 'agbdemo' # Lowercase required + # Check that the public dns $addnsName is available if (Test-AzDnsAvailability -DomainNameLabel $addnsName -Location $Location) { 'Available' } else { 'Taken. addnsName must be globally unique.' } @@ -42,6 +44,7 @@ $MyParams = @{ location = 'South Central US' domainName = 'azureglobalbootcamp.com' addnsName = $addnsName + namePrefix = $namePrefix } # Splat the parameters on New-AzureRmResourceGroupDeployment diff --git a/active-directory-new-domain-with-data/azuredeploy.json b/active-directory-new-domain-with-data/azuredeploy.json index dd44725..982f5ea 100644 --- a/active-directory-new-domain-with-data/azuredeploy.json +++ b/active-directory-new-domain-with-data/azuredeploy.json @@ -169,7 +169,7 @@ "adSubnetName": "[concat(parameters('namePrefix'),'-subnet')]", "adNicName": "[concat(parameters('namePrefix'),'Nic')]", "publicIPAddressName": "[concat(parameters('namePrefix'),'PIP')]", - "adVMName": "[concat(parameters('namePrefix'),'PIP')]", + "adVMName": "[concat(parameters('namePrefix'),'DC')]", "VnetID": "[resourceId('Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]", "adSubnetRef": "[concat(variables('VnetID'),'/subnets/',variables('adSubnetName'))]", "adNicId": "[resourceId('Microsoft.Network/networkInterfaces',variables('adNicName'))]", From 2679252055fcb95ad1ef6a936b1795b65431273e Mon Sep 17 00:00:00 2001 From: David Smith Date: Fri, 26 Apr 2019 11:39:04 -0500 Subject: [PATCH 09/16] updated addnsname to match nameprefix --- active-directory-new-domain-with-data/CallingScript.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/active-directory-new-domain-with-data/CallingScript.ps1 b/active-directory-new-domain-with-data/CallingScript.ps1 index 95186f4..ef952af 100644 --- a/active-directory-new-domain-with-data/CallingScript.ps1 +++ b/active-directory-new-domain-with-data/CallingScript.ps1 @@ -27,7 +27,7 @@ $Location = 'South Central US' $rgname = 'RG-2019AzureGlobalBootcamp' $namePrefix = '2019AGBDemo' $saname = ('sa' + $namePrefix).ToLower() # Lowercase required -$addnsName = 'agbdemo' # Lowercase required +$addnsName = ($namePrefix).ToLower() # Lowercase required # Check that the public dns $addnsName is available From 3cd76ea2b540cd29504de21f0dbe9f64946ddfbf Mon Sep 17 00:00:00 2001 From: David Smith Date: Fri, 26 Apr 2019 11:46:26 -0500 Subject: [PATCH 10/16] fixed bug --- .../CallingScript.ps1 | 6 +++--- active-directory-new-domain-with-data/azuredeploy.json | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/active-directory-new-domain-with-data/CallingScript.ps1 b/active-directory-new-domain-with-data/CallingScript.ps1 index ef952af..214ede3 100644 --- a/active-directory-new-domain-with-data/CallingScript.ps1 +++ b/active-directory-new-domain-with-data/CallingScript.ps1 @@ -25,9 +25,9 @@ Login-AzAccount $URI = 'https://raw.githubusercontent.com/cloudwidth/ADDS-with-Data/master/active-directory-new-domain-with-data/azuredeploy.json' $Location = 'South Central US' $rgname = 'RG-2019AzureGlobalBootcamp' -$namePrefix = '2019AGBDemo' -$saname = ('sa' + $namePrefix).ToLower() # Lowercase required -$addnsName = ($namePrefix).ToLower() # Lowercase required +$namePrefix = 'AGB2019Demo' # cannot start with numbers +$saname = ('sa' + $namePrefix).ToLower() # Lowercase required +$addnsName = ($namePrefix).ToLower() # Lowercase required # Check that the public dns $addnsName is available diff --git a/active-directory-new-domain-with-data/azuredeploy.json b/active-directory-new-domain-with-data/azuredeploy.json index 982f5ea..667eec2 100644 --- a/active-directory-new-domain-with-data/azuredeploy.json +++ b/active-directory-new-domain-with-data/azuredeploy.json @@ -164,12 +164,12 @@ "adLBFE": "LBFE", "adLBBE": "LBBE", "adRDPNAT": "adRDP", - "adAvailabilitySetName": "[concat(parameters('namePrefix'),'AvailabilitySet')]", - "virtualNetworkName": "[concat(parameters('namePrefix'),'DC')]", - "adSubnetName": "[concat(parameters('namePrefix'),'-subnet')]", - "adNicName": "[concat(parameters('namePrefix'),'Nic')]", + "adAvailabilitySetName": "[concat(parameters('namePrefix'),'AvSet')]", + "virtualNetworkName": "[concat(parameters('namePrefix'),'VNet')]", + "adSubnetName": "[concat(parameters('namePrefix'),'-Subnet')]", + "adNicName": "[concat(parameters('namePrefix'),'NIC')]", "publicIPAddressName": "[concat(parameters('namePrefix'),'PIP')]", - "adVMName": "[concat(parameters('namePrefix'),'DC')]", + "adVMName": "[concat(parameters('namePrefix'),'DCvm')]", "VnetID": "[resourceId('Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]", "adSubnetRef": "[concat(variables('VnetID'),'/subnets/',variables('adSubnetName'))]", "adNicId": "[resourceId('Microsoft.Network/networkInterfaces',variables('adNicName'))]", From 2041f18d2c3c66b4c562c0be776493fbb199f34e Mon Sep 17 00:00:00 2001 From: David Smith Date: Fri, 26 Apr 2019 11:54:28 -0500 Subject: [PATCH 11/16] changed to managed disks and remv'd stg acct --- .../CallingScript.ps1 | 4 +- .../azuredeploy.json | 54 +++++-------------- .../azuredeploy.parameters.json | 6 --- 3 files changed, 14 insertions(+), 50 deletions(-) diff --git a/active-directory-new-domain-with-data/CallingScript.ps1 b/active-directory-new-domain-with-data/CallingScript.ps1 index 214ede3..c0a38b0 100644 --- a/active-directory-new-domain-with-data/CallingScript.ps1 +++ b/active-directory-new-domain-with-data/CallingScript.ps1 @@ -26,7 +26,7 @@ $URI = 'https://raw.githubusercontent.com/cloudwidth/ADDS-with-Data/master $Location = 'South Central US' $rgname = 'RG-2019AzureGlobalBootcamp' $namePrefix = 'AGB2019Demo' # cannot start with numbers -$saname = ('sa' + $namePrefix).ToLower() # Lowercase required +#$saname = ('sa' + $namePrefix).ToLower() # Lowercase required $addnsName = ($namePrefix).ToLower() # Lowercase required @@ -40,7 +40,7 @@ New-AzResourceGroup -Name $rgname -Location $Location # Parameters for the template and configuration $MyParams = @{ - newStorageAccountName = $saname +# newStorageAccountName = $saname location = 'South Central US' domainName = 'azureglobalbootcamp.com' addnsName = $addnsName diff --git a/active-directory-new-domain-with-data/azuredeploy.json b/active-directory-new-domain-with-data/azuredeploy.json index 667eec2..89dcb06 100644 --- a/active-directory-new-domain-with-data/azuredeploy.json +++ b/active-directory-new-domain-with-data/azuredeploy.json @@ -2,26 +2,6 @@ "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", "contentVersion": "1.0.0.1", "parameters": { - "newStorageAccountName": { - "type": "string", - "metadata": { - "description": "The name of the new storage account created to store the VMs disks" - } - }, - "storageAccountType": { - "type": "string", - "allowedValues": [ - "Standard_LRS", - "Standard_GRS", - "Standard_RAGRS", - "Standard_ZRS", - "Premium_LRS" - ], - "metadata": { - "description": "The type of the Storage Account created" - }, - "defaultValue": "Standard_LRS" - }, "location": { "type": "string", "allowedValues": [ @@ -187,15 +167,6 @@ "adConfigurationFunction": "CreateADDomainWithData.ps1\\CreateADDomainWithData" }, "resources": [ - { - "type": "Microsoft.Storage/storageAccounts", - "name": "[parameters('newStorageAccountName')]", - "apiVersion": "2015-05-01-preview", - "location": "[parameters('location')]", - "properties": { - "accountType": "[parameters('storageAccountType')]" - } - }, { "apiVersion": "2015-05-01-preview", "type": "Microsoft.Network/publicIPAddresses", @@ -323,7 +294,6 @@ "name": "[variables('adVMName')]", "location": "[parameters('location')]", "dependsOn": [ - "[resourceId('Microsoft.Storage/storageAccounts',parameters('newStorageAccountName'))]", "[resourceId('Microsoft.Network/networkInterfaces',variables('adNicName'))]", "[resourceId('Microsoft.Compute/availabilitySets', variables('adAvailabilitySetName'))]", "[resourceId('Microsoft.Network/loadBalancers',variables('adlbName'))]" @@ -348,23 +318,23 @@ "version": "latest" }, "osDisk": { - "name": "osdisk", - "vhd": { - "uri": "[concat('http://',parameters('newStorageAccountName'),'.blob.core.windows.net/vhds/','osdisk.vhd')]" - }, + "name": "[concat(variables('adVMName'),'_OSDisk')]", "caching": "ReadWrite", - "createOption": "FromImage" + "createOption": "FromImage", + "managedDisk": { + "storageAccountType": "Standard_LRS" + } }, "dataDisks": [ { - "vhd": { - "uri": "[concat('http://',parameters('newStorageAccountName'),'.blob.core.windows.net/vhds/', variables('adDataDisk'),'-1.vhd')]" - }, - "name": "[concat(variables('adVMName'),'-data-disk1')]", - "caching": "None", - "createOption": "empty", + "lun": 0, + "name": "[concat(variables('adVMName'),'_DataDisk')]", + "createOption": "Empty", "diskSizeGB": "[variables('adDataDiskSize')]", - "lun": 0 + "caching": "None", + "managedDisk": { + "storageAccountType": "Standard_LRS" + } } ] }, diff --git a/active-directory-new-domain-with-data/azuredeploy.parameters.json b/active-directory-new-domain-with-data/azuredeploy.parameters.json index 4b5af34..836fe60 100644 --- a/active-directory-new-domain-with-data/azuredeploy.parameters.json +++ b/active-directory-new-domain-with-data/azuredeploy.parameters.json @@ -2,12 +2,6 @@ "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", "contentVersion": "1.0.0.0", "parameters": { - "newStorageAccountName": { - "value": "GEN-UNIQUE" - }, - "storageAccountType": { - "value": "Standard_GRS" - }, "location": { "value": "West US" }, From 76f26ebc1ed952a4636fb8d6aa58fe438e16ef0a Mon Sep 17 00:00:00 2001 From: David Smith Date: Fri, 26 Apr 2019 17:41:13 -0500 Subject: [PATCH 12/16] broke out datadisk as single resource and will attach --- .../CallingScript.ps1 | 12 ++++---- .../azuredeploy.json | 29 +++++++++++++------ 2 files changed, 25 insertions(+), 16 deletions(-) diff --git a/active-directory-new-domain-with-data/CallingScript.ps1 b/active-directory-new-domain-with-data/CallingScript.ps1 index c0a38b0..34f2e2b 100644 --- a/active-directory-new-domain-with-data/CallingScript.ps1 +++ b/active-directory-new-domain-with-data/CallingScript.ps1 @@ -24,9 +24,8 @@ Login-AzAccount # something unique for you. Leave the last two characters in each. $URI = 'https://raw.githubusercontent.com/cloudwidth/ADDS-with-Data/master/active-directory-new-domain-with-data/azuredeploy.json' $Location = 'South Central US' -$rgname = 'RG-2019AzureGlobalBootcamp' -$namePrefix = 'AGB2019Demo' # cannot start with numbers -#$saname = ('sa' + $namePrefix).ToLower() # Lowercase required +$rgname = 'RG-2019GAB' +$namePrefix = 'GAB2019Demo' # cannot start with numbers $addnsName = ($namePrefix).ToLower() # Lowercase required @@ -40,9 +39,8 @@ New-AzResourceGroup -Name $rgname -Location $Location # Parameters for the template and configuration $MyParams = @{ -# newStorageAccountName = $saname - location = 'South Central US' - domainName = 'azureglobalbootcamp.com' + location = $Location + domainName = ($namePrefix + ".com") # The maximum length is 15 characters addnsName = $addnsName namePrefix = $namePrefix } @@ -52,7 +50,7 @@ $SplatParams = @{ TemplateUri = $URI ResourceGroupName = $rgname TemplateParameterObject = $MyParams - Name = '2019AzureGlobalBootcampForest' + Name = ($namePrefix + 'Forest') } # This takes ~30 minutes diff --git a/active-directory-new-domain-with-data/azuredeploy.json b/active-directory-new-domain-with-data/azuredeploy.json index 89dcb06..afbadb7 100644 --- a/active-directory-new-domain-with-data/azuredeploy.json +++ b/active-directory-new-domain-with-data/azuredeploy.json @@ -289,7 +289,23 @@ } }, { - "apiVersion": "2015-05-01-preview", + "type": "Microsoft.Compute/disks", + "apiVersion": "2018-06-01", + "name": "[concat(variables('adVMName'),'_DataDisk')]", + "location": "[parameters('location')]", + "sku": { + "name": "Standard_LRS" + }, + "properties": { + "creationData": { + "createOption": "Empty" + }, + "diskSizeGB": "[variables('adDataDiskSize')]", + "caching": "None" + } + }, + { + "apiVersion": "2018-10-01", "type": "Microsoft.Compute/virtualMachines", "name": "[variables('adVMName')]", "location": "[parameters('location')]", @@ -320,20 +336,15 @@ "osDisk": { "name": "[concat(variables('adVMName'),'_OSDisk')]", "caching": "ReadWrite", - "createOption": "FromImage", - "managedDisk": { - "storageAccountType": "Standard_LRS" - } + "createOption": "FromImage" }, "dataDisks": [ { "lun": 0, "name": "[concat(variables('adVMName'),'_DataDisk')]", - "createOption": "Empty", - "diskSizeGB": "[variables('adDataDiskSize')]", - "caching": "None", + "createOption": "attach", "managedDisk": { - "storageAccountType": "Standard_LRS" + "id": "[resourceId('Microsoft.Compute/disks/', concat(variables('adVMName'),'_DataDisk'))]" } } ] From cead9cb941377bc558a1e227556a093448e27659 Mon Sep 17 00:00:00 2001 From: David Smith Date: Fri, 26 Apr 2019 17:52:03 -0500 Subject: [PATCH 13/16] changed datadisk caching --- .../azuredeploy.json | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/active-directory-new-domain-with-data/azuredeploy.json b/active-directory-new-domain-with-data/azuredeploy.json index afbadb7..2fc548b 100644 --- a/active-directory-new-domain-with-data/azuredeploy.json +++ b/active-directory-new-domain-with-data/azuredeploy.json @@ -182,8 +182,15 @@ { "type": "Microsoft.Compute/availabilitySets", "name": "[variables('adAvailabilitySetName')]", - "apiVersion": "2015-05-01-preview", - "location": "[parameters('location')]" + "apiVersion": "2017-03-30", + "location": "[parameters('location')]", + "properties": { + "PlatformUpdateDomainCount": 5, + "PlatformFaultDomainCount": 2 + }, + "sku": { + "name": "Aligned" + } }, { "name": "VNet", @@ -290,7 +297,7 @@ }, { "type": "Microsoft.Compute/disks", - "apiVersion": "2018-06-01", + "apiVersion": "2018-09-30", "name": "[concat(variables('adVMName'),'_DataDisk')]", "location": "[parameters('location')]", "sku": { @@ -300,8 +307,7 @@ "creationData": { "createOption": "Empty" }, - "diskSizeGB": "[variables('adDataDiskSize')]", - "caching": "None" + "diskSizeGB": "[variables('adDataDiskSize')]" } }, { @@ -343,6 +349,7 @@ "lun": 0, "name": "[concat(variables('adVMName'),'_DataDisk')]", "createOption": "attach", + "caching": "None", "managedDisk": { "id": "[resourceId('Microsoft.Compute/disks/', concat(variables('adVMName'),'_DataDisk'))]" } From 6394d0bc1060ffadef2efbb9f60c45e8d34ad563 Mon Sep 17 00:00:00 2001 From: David Smith Date: Fri, 26 Apr 2019 17:55:27 -0500 Subject: [PATCH 14/16] bugfixes --- active-directory-new-domain-with-data/azuredeploy.json | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/active-directory-new-domain-with-data/azuredeploy.json b/active-directory-new-domain-with-data/azuredeploy.json index 2fc548b..dd77e96 100644 --- a/active-directory-new-domain-with-data/azuredeploy.json +++ b/active-directory-new-domain-with-data/azuredeploy.json @@ -182,15 +182,16 @@ { "type": "Microsoft.Compute/availabilitySets", "name": "[variables('adAvailabilitySetName')]", - "apiVersion": "2017-03-30", + "apiVersion": "2018-10-01", "location": "[parameters('location')]", + "sku": { + "name": "Aligned" + }, "properties": { "PlatformUpdateDomainCount": 5, "PlatformFaultDomainCount": 2 }, - "sku": { - "name": "Aligned" - } + }, { "name": "VNet", From 030dd2286c350a438075b91b4535f1d4ffafdc03 Mon Sep 17 00:00:00 2001 From: David Smith Date: Fri, 26 Apr 2019 17:57:00 -0500 Subject: [PATCH 15/16] bugfixes --- active-directory-new-domain-with-data/azuredeploy.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/active-directory-new-domain-with-data/azuredeploy.json b/active-directory-new-domain-with-data/azuredeploy.json index dd77e96..178af44 100644 --- a/active-directory-new-domain-with-data/azuredeploy.json +++ b/active-directory-new-domain-with-data/azuredeploy.json @@ -190,8 +190,7 @@ "properties": { "PlatformUpdateDomainCount": 5, "PlatformFaultDomainCount": 2 - }, - + } }, { "name": "VNet", From dd645cf422ae16495b49e6e85520a6569dcb81c0 Mon Sep 17 00:00:00 2001 From: "David Smith (10M)" Date: Wed, 2 Dec 2020 14:31:35 -0600 Subject: [PATCH 16/16] # out module install lines - assume installed --- .../CallingScript.ps1 | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/active-directory-new-domain-with-data/CallingScript.ps1 b/active-directory-new-domain-with-data/CallingScript.ps1 index 34f2e2b..ac363d9 100644 --- a/active-directory-new-domain-with-data/CallingScript.ps1 +++ b/active-directory-new-domain-with-data/CallingScript.ps1 @@ -5,17 +5,16 @@ # Install the Azure Resource Manager modules from PowerShell Gallery # Takes a while to install 28 modules -Install-Module AzureRM -Force -Verbose -Install-AzureRM +# Install-Module Az -Force -Verbose -# Install the Azure Service Management module from PowerShell Gallery -Install-Module Azure -Force -Verbose +# # Install the Azure Service Management module from PowerShell Gallery +# Install-Module Azure -Force -Verbose -# Import AzureRM modules for the given version manifest in the AzureRM module -Import-AzureRM -Verbose +# # Import Az modules for the given version manifest in the Az module +# Import-Module Az -Verbose -# Import Azure Service Management module -Import-Module Azure -Verbose +# # Import Azure Service Management module +# Import-Module Azure -Verbose # Authenticate to your Azure account Login-AzAccount @@ -24,8 +23,8 @@ Login-AzAccount # something unique for you. Leave the last two characters in each. $URI = 'https://raw.githubusercontent.com/cloudwidth/ADDS-with-Data/master/active-directory-new-domain-with-data/azuredeploy.json' $Location = 'South Central US' -$rgname = 'RG-2019GAB' -$namePrefix = 'GAB2019Demo' # cannot start with numbers +$rgname = 'RG-ActiveDirectory' +$namePrefix = 'Cloudwidth' # cannot start with numbers $addnsName = ($namePrefix).ToLower() # Lowercase required @@ -45,7 +44,7 @@ $MyParams = @{ namePrefix = $namePrefix } -# Splat the parameters on New-AzureRmResourceGroupDeployment +# Splat the parameters on New-AzResourceGroupDeployment $SplatParams = @{ TemplateUri = $URI ResourceGroupName = $rgname