{"id":6428,"date":"2016-05-25T12:00:27","date_gmt":"2016-05-25T11:00:27","guid":{"rendered":"http:\/\/www.markwilson.co.uk\/blog\/?p=6428"},"modified":"2016-05-25T00:12:03","modified_gmt":"2016-05-24T23:12:03","slug":"scripting-azure-server-build-tasks","status":"publish","type":"post","link":"https:\/\/www.markwilson.co.uk\/blog\/2016\/05\/scripting-azure-server-build-tasks.htm","title":{"rendered":"Scripting Azure VM build tasks: static IP addresses, BGInfo and anti-malware extensions"},"content":{"rendered":"<p>Following on from yesterday&#8217;s blog post with a pile of PowerShell to <a href=\"https:\/\/www.markwilson.co.uk\/blog\/2016\/05\/building-multiple-nic-vm-azure.htm\">build a multiple-NIC VM in Azure<\/a>, here are some more snippets of PowerShell to carry out a few build-related activities.<\/p>\n<h3>Setting a static IP address on a NIC<\/h3>\n<p><code>$RGName = Read-Host \"Resource Group\"<\/code><br \/>\n<code>$VNICName = Read-Host \"vNIC Name\"<\/code><br \/>\n<code>$VNIC=Get-AzureRmNetworkInterface -Name $VNICName -ResourceGroupName $RGName<\/code><br \/>\n<code>$VNIC.IpConfigurations[0].PrivateIpAllocationMethod = \"Static\"<\/code><br \/>\n<code>Set-AzureRmNetworkInterface -NetworkInterface $VNIC<\/code><\/p>\n<h3>Installing BGInfo<\/h3>\n<p><code>$RGName = Read-Host \"Resource Group\"<\/code><br \/>\n<code>$VMName = Read-Host \"Virtual Machine Name\"<\/code><br \/>\n<code>$Location = Read-Host \"Region\/Location\"<\/code><br \/>\n<code>Set-AzureRmVMExtension -ExtensionName BGInfo -Publisher Microsoft.Compute -Version 2.1 -ExtensionType BGInfo -Location $Location -ResourceGroupName $RGName -VMName $VMName<\/code><\/p>\n<h3>Installing Microsoft Antimalware<\/h3>\n<p>This one is a little more difficult &#8211; the script is a development of Mitesh Chauhan&#8217;s work entitled <a href=\"https:\/\/miteshc.wordpress.com\/2016\/02\/18\/msav-extension-on-azurearm-vm\/\">Installing Microsoft Anti Virus Extension to Azure Resource Manager VM using Set-AzureRmVMExtension<\/a><\/p>\n<p>It&#8217;s worth reading Mitesh&#8217;s post for more background on the Microsoft Anti Virus Extension\u00a0(IaaS Antimalware) and also taking a look at the Security Health in the Azure Portal (currently in preview), which will highlight VMs that have no protection (amongst other things).<\/p>\n<p>Mitesh&#8217;s script uses a simple settings string, or for more complex\u00a0configuration, it\u00a0reads from a file. I tried to use a more complex setting and it just resulted in PowerShell errors, suggesting this wasn&#8217;t proper JSON (it isn&#8217;t):<\/p>\n<p><code>$AntiMalwareSettings = @{<\/code><br \/>\n<code>\"AntimalwareEnabled\" = $true;<\/code><br \/>\n<code>\"RealtimeProtectionEnabled\" = $true;<\/code><br \/>\n<code>\"ScheduledScanSettings\" = @{<\/code><br \/>\n<code>\"isEnabled\" = $true;<\/code><br \/>\n<code>\"day\" = 1;<\/code><br \/>\n<code>\"time\" = 180;<\/code><br \/>\n<code>\"scanType\" = \"Full\"<\/code><br \/>\n<code>};<\/code><br \/>\n<code>\"Exclusions\" = @{<\/code><br \/>\n<code>\"Extensions\" = \".mdf;.ldf;.ndf;.bak;.trn;\";<\/code><br \/>\n<code>\"Paths\" = \"D:\\\\Logs;E:\\\\Databases;C:\\\\Program Files\\\\Microsoft SQL Server\\\\MSSQL\\\\FTDATA\";<\/code><br \/>\n<code>\"Processes\" = \"SQLServr.exe;ReportingServicesService.exe;MSMDSrv.exe\"<\/code><br \/>\n<code>}<\/code><br \/>\n<code>}<\/code><\/p>\n<p><i>Set-AzureRmVMExtension : Error reading JObject from JsonReader. Current JsonReader item is not an object: Null. Path&#8221;, line 1, position 4.<\/i><\/p>\n<p>If I use the JSON form it&#8217;s no better:<\/p>\n<p><code>$AntiMalwareSettings = {<\/code><br \/>\n<code>\"AntimalwareEnabled\": true,<\/code><br \/>\n<code>\"RealtimeProtectionEnabled\": true,<\/code><br \/>\n<code>\"ScheduledScanSettings\": {<\/code><br \/>\n<code>\"isEnabled\": true,<\/code><br \/>\n<code>\"day\": 1,<\/code><br \/>\n<code>\"time\": 180,<\/code><br \/>\n<code>\"scanType\": \"Full\"<\/code><br \/>\n<code>},<\/code><br \/>\n<code>\"Exclusions\": {<\/code><br \/>\n<code>\"Extensions\": \".mdf;.ldf;.ndf;.bak;.trn\",<\/code><br \/>\n<code>\"Paths\": \"D:\\\\Logs;E:\\\\Databases;C:\\\\Program Files\\\\Microsoft SQL Server\\\\MSSQL\\\\FTDATA\",<\/code><br \/>\n<code>\"Processes\": \"SQLServr.exe;ReportingServicesService.exe;MSMDSrv.exe\"<\/code><br \/>\n<code>}<\/code><br \/>\n<code>}<\/code><\/p>\n<p><i>Set-AzureRmVMExtension : Unexpected character encountered while parsing value: S. Path &#8221;, line 0, position 0.<\/i><\/p>\n<p>So the actual script I used is below:<\/p>\n<p><code># Install Microsoft AntiMalware client on an ARM based Azure VM<\/code><br \/>\n<code># Check note at the end to be able to open up the SCEP antimalware console on the server if there are problems.<\/code><br \/>\n<code># Author \u2013 Mitesh Chauhan \u2013 miteshc.wordpress.com (updated by Mark Wilson - markwilson.co.uk)<\/code><br \/>\n<code># For Powershell 1.0.1 and above<\/code><br \/>\n<code># See https:\/\/miteshc.wordpress.com\/2016\/02\/18\/msav-extension-on-azurearm-vm\/<\/code><\/p>\n<p><code># Log in with credentials for subscription<\/code><br \/>\n<code># Login-AzureRmAccount<\/code><\/p>\n<p><code># Select your subscription if required (or default will be used)<\/code><br \/>\n<code># Select-AzureRmSubscription -SubscriptionId \"Your Sub ID here\"<\/code><\/p>\n<p><code>$RGName = Read-Host \"Resource Group\"<\/code><br \/>\n<code>$VMName = Read-Host \"Virtual Machine Name\"<\/code><br \/>\n<code>$Location = Read-Host \"Region\/Location\"<\/code><\/p>\n<p><code># Use this (-SettingString) for simple setup<\/code><br \/>\n<code># $AntiMalwareSettings = \u2018{ \"AntimalwareEnabled\": true,\"RealtimeProtectionEnabled\": true}\u2019;<\/code><\/p>\n<p><code># Use this (-SettingString) to configure from JSON file<\/code><br \/>\n<code>$AntiMalwareSettings = Get-Content \u2018.\\MSAVConfig.json\u2019 -Raw<\/code><\/p>\n<p><code>$allVersions= (Get-AzureRmVMExtensionImage -Location $location -PublisherName \"Microsoft.Azure.Security\" -Type \"IaaSAntimalware\").Version<\/code><br \/>\n<code>$typeHandlerVer = $allVersions[($allVersions.count)\u20131]<\/code><br \/>\n<code>$typeHandlerVerMjandMn = $typeHandlerVer.split(\".\")<\/code><br \/>\n<code>$typeHandlerVerMjandMn = $typeHandlerVerMjandMn[0] + \".\" + $typeHandlerVerMjandMn[1]<\/code><\/p>\n<p><code>Write-Host \"Installing Microsoft AntiMalware version\" $typeHandlerVerMjandMn \"to\" $vmName \"in\" $RGName \"(\"$location \")\"<\/code><br \/>\n<code>Write-Host \"Configuration:\"<\/code><br \/>\n<code>$AntiMalwareSettings<\/code><\/p>\n<p><code># Specify for -SettingString parameter here which option you want, simple $settingsstring or $MSAVConfigfile to sue json file.<\/code><br \/>\n<code>Set-AzureRmVMExtension -ResourceGroupName $RGName -VMName $vmName -Name \"IaaSAntimalware\" -Publisher \"Microsoft.Azure.Security\" -ExtensionType \"IaaSAntimalware\" -TypeHandlerVersion $typeHandlerVerMjandMn -SettingString $AntiMalwareSettings -Location $location<\/code><\/p>\n<p><code># To remove the AntiMalware extension<\/code><br \/>\n<code># Remove-AzureRmVMExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name \"IaaSAntimalware\"<\/code><\/p>\n<p><code># If you have error saying Admin has restricted this app, Navigate to \u201cC:\\Program Files\\Microsoft Security Client\u201d<\/code><br \/>\n<code># Run \"C:\\Program Files\\Microsoft Security Client\\ConfigSecurityPolicy.exe cleanuppolicy.xml\"<\/code><br \/>\n<code># Or simply drag the cleanuppolicy.xml file above onto the ConfigSecurityPolicy.exe to sort it and you should be in.<\/code><\/p>\n<p>The MSAVconfig.json file contains the JSON version of the Anti-Malware settings:<\/p>\n<p><code>{<\/code><br \/>\n<code>\"AntimalwareEnabled\": true,<\/code><br \/>\n<code>\"RealtimeProtectionEnabled\": true,<\/code><br \/>\n<code>\"ScheduledScanSettings\": {<\/code><br \/>\n<code>\"isEnabled\": true,<\/code><br \/>\n<code>\"day\": 1,<\/code><br \/>\n<code>\"time\": 180,<\/code><br \/>\n<code>\"scanType\": \"Full\"<\/code><br \/>\n<code>},<\/code><br \/>\n<code>\"Exclusions\": {<\/code><br \/>\n<code>\"Extensions\": \".mdf;.ldf;.ndf;.bak;.trn\",<\/code><br \/>\n<code>\"Paths\": \"D:\\\\Logs;E:\\\\Databases;C:\\\\Program Files\\\\Microsoft SQL Server\\\\MSSQL\\\\FTDATA\",<\/code><br \/>\n<code>\"Processes\": \"SQLServr.exe;ReportingServicesService.exe;MSMDSrv.exe\"<\/code><br \/>\n<code>}<\/code><br \/>\n<code>}<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Following on from yesterday&#8217;s blog post with a pile of PowerShell to build a multiple-NIC VM in Azure, here are some more snippets of PowerShell to carry out a few build-related activities. Setting a static IP address on a NIC $RGName = Read-Host &#8220;Resource Group&#8221; $VNICName = Read-Host &#8220;vNIC Name&#8221; $VNIC=Get-AzureRmNetworkInterface -Name $VNICName -ResourceGroupName $RGName &hellip; <a href=\"https:\/\/www.markwilson.co.uk\/blog\/2016\/05\/scripting-azure-server-build-tasks.htm\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Scripting Azure VM build tasks: static IP addresses, BGInfo and anti-malware extensions<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[218],"tags":[176,350],"class_list":["post-6428","post","type-post","status-publish","format-standard","hentry","category-technology","tag-azure","tag-powershell"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Scripting Azure VM build tasks: static IP addresses, BGInfo and anti-malware extensions - markwilson.it<\/title>\n<meta name=\"description\" content=\"Some PowerShell to carry out common Azure VM build tasks - including installing BGInfo, IaaS Antimalware and setting static IP addresses on NICs\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.markwilson.co.uk\/blog\/2016\/05\/scripting-azure-server-build-tasks.htm\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Scripting Azure VM build tasks: static IP addresses, BGInfo and anti-malware extensions - markwilson.it\" \/>\n<meta property=\"og:description\" content=\"Some PowerShell to carry out common Azure VM build tasks - including installing BGInfo, IaaS Antimalware and setting static IP addresses on NICs\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.markwilson.co.uk\/blog\/2016\/05\/scripting-azure-server-build-tasks.htm\" \/>\n<meta property=\"og:site_name\" content=\"markwilson.it\" \/>\n<meta property=\"article:published_time\" content=\"2016-05-25T11:00:27+00:00\" \/>\n<meta name=\"author\" content=\"Mark Wilson\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@markwilsonit\" \/>\n<meta name=\"twitter:site\" content=\"@markwilsonit\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Mark Wilson\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/2016\\\/05\\\/scripting-azure-server-build-tasks.htm#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/2016\\\/05\\\/scripting-azure-server-build-tasks.htm\"},\"author\":{\"name\":\"Mark Wilson\",\"@id\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/#\\\/schema\\\/person\\\/98f61365e7c39d6be942174b8c4de468\"},\"headline\":\"Scripting Azure VM build tasks: static IP addresses, BGInfo and anti-malware extensions\",\"datePublished\":\"2016-05-25T11:00:27+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/2016\\\/05\\\/scripting-azure-server-build-tasks.htm\"},\"wordCount\":234,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/#\\\/schema\\\/person\\\/98f61365e7c39d6be942174b8c4de468\"},\"keywords\":[\"Microsoft Azure\",\"Microsoft PowerShell\"],\"articleSection\":[\"Technology\"],\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/2016\\\/05\\\/scripting-azure-server-build-tasks.htm#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/2016\\\/05\\\/scripting-azure-server-build-tasks.htm\",\"url\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/2016\\\/05\\\/scripting-azure-server-build-tasks.htm\",\"name\":\"Scripting Azure VM build tasks: static IP addresses, BGInfo and anti-malware extensions - markwilson.it\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/#website\"},\"datePublished\":\"2016-05-25T11:00:27+00:00\",\"description\":\"Some PowerShell to carry out common Azure VM build tasks - including installing BGInfo, IaaS Antimalware and setting static IP addresses on NICs\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/2016\\\/05\\\/scripting-azure-server-build-tasks.htm#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/2016\\\/05\\\/scripting-azure-server-build-tasks.htm\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/2016\\\/05\\\/scripting-azure-server-build-tasks.htm#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Scripting Azure VM build tasks: static IP addresses, BGInfo and anti-malware extensions\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/\",\"name\":\"markwilson.it\",\"description\":\"get-info -class technology | write-output &gt; \\\/dev\\\/web\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/#\\\/schema\\\/person\\\/98f61365e7c39d6be942174b8c4de468\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/#\\\/schema\\\/person\\\/98f61365e7c39d6be942174b8c4de468\",\"name\":\"Mark Wilson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/i0.wp.com\\\/www.markwilson.co.uk\\\/blog\\\/uploads\\\/image-4.png?fit=800%2C800&ssl=1\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/www.markwilson.co.uk\\\/blog\\\/uploads\\\/image-4.png?fit=800%2C800&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/www.markwilson.co.uk\\\/blog\\\/uploads\\\/image-4.png?fit=800%2C800&ssl=1\",\"width\":800,\"height\":800,\"caption\":\"Mark Wilson\"},\"logo\":{\"@id\":\"https:\\\/\\\/i0.wp.com\\\/www.markwilson.co.uk\\\/blog\\\/uploads\\\/image-4.png?fit=800%2C800&ssl=1\"},\"description\":\"A Chartered IT Professional, with recent experience in technology leadership, IT strategy and practice management roles, Mark Wilson is an Enterprise Architect in the Advisory and Management Group at risual. During a career spanning more than two decades, Mark has gained widespread recognition as an expert in his field including both industry and national press exposure. In addition to certifications from Microsoft, VMware, Red Hat, The Open Group and Axelos, Mark held a Microsoft Most Valuable Professional (MVP) award for three years and is now part of the MVP Reconnect programme. Mark is also well-known on social media and maintains an award-winning blog.\",\"sameAs\":[\"http:\\\/\\\/www.markwilson.co.uk\\\/\",\"https:\\\/\\\/www.instagram.com\\\/markwilsonuk\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/markawilson\\\/\",\"https:\\\/\\\/x.com\\\/markwilsonit\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCWHlZCoHRTocdvtrOJ2IL4A\"],\"url\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/author\\\/mark-wilson\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Scripting Azure VM build tasks: static IP addresses, BGInfo and anti-malware extensions - markwilson.it","description":"Some PowerShell to carry out common Azure VM build tasks - including installing BGInfo, IaaS Antimalware and setting static IP addresses on NICs","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.markwilson.co.uk\/blog\/2016\/05\/scripting-azure-server-build-tasks.htm","og_locale":"en_GB","og_type":"article","og_title":"Scripting Azure VM build tasks: static IP addresses, BGInfo and anti-malware extensions - markwilson.it","og_description":"Some PowerShell to carry out common Azure VM build tasks - including installing BGInfo, IaaS Antimalware and setting static IP addresses on NICs","og_url":"https:\/\/www.markwilson.co.uk\/blog\/2016\/05\/scripting-azure-server-build-tasks.htm","og_site_name":"markwilson.it","article_published_time":"2016-05-25T11:00:27+00:00","author":"Mark Wilson","twitter_card":"summary_large_image","twitter_creator":"@markwilsonit","twitter_site":"@markwilsonit","twitter_misc":{"Written by":"Mark Wilson","Estimated reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.markwilson.co.uk\/blog\/2016\/05\/scripting-azure-server-build-tasks.htm#article","isPartOf":{"@id":"https:\/\/www.markwilson.co.uk\/blog\/2016\/05\/scripting-azure-server-build-tasks.htm"},"author":{"name":"Mark Wilson","@id":"https:\/\/www.markwilson.co.uk\/blog\/#\/schema\/person\/98f61365e7c39d6be942174b8c4de468"},"headline":"Scripting Azure VM build tasks: static IP addresses, BGInfo and anti-malware extensions","datePublished":"2016-05-25T11:00:27+00:00","mainEntityOfPage":{"@id":"https:\/\/www.markwilson.co.uk\/blog\/2016\/05\/scripting-azure-server-build-tasks.htm"},"wordCount":234,"commentCount":0,"publisher":{"@id":"https:\/\/www.markwilson.co.uk\/blog\/#\/schema\/person\/98f61365e7c39d6be942174b8c4de468"},"keywords":["Microsoft Azure","Microsoft PowerShell"],"articleSection":["Technology"],"inLanguage":"en-GB","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.markwilson.co.uk\/blog\/2016\/05\/scripting-azure-server-build-tasks.htm#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.markwilson.co.uk\/blog\/2016\/05\/scripting-azure-server-build-tasks.htm","url":"https:\/\/www.markwilson.co.uk\/blog\/2016\/05\/scripting-azure-server-build-tasks.htm","name":"Scripting Azure VM build tasks: static IP addresses, BGInfo and anti-malware extensions - markwilson.it","isPartOf":{"@id":"https:\/\/www.markwilson.co.uk\/blog\/#website"},"datePublished":"2016-05-25T11:00:27+00:00","description":"Some PowerShell to carry out common Azure VM build tasks - including installing BGInfo, IaaS Antimalware and setting static IP addresses on NICs","breadcrumb":{"@id":"https:\/\/www.markwilson.co.uk\/blog\/2016\/05\/scripting-azure-server-build-tasks.htm#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.markwilson.co.uk\/blog\/2016\/05\/scripting-azure-server-build-tasks.htm"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.markwilson.co.uk\/blog\/2016\/05\/scripting-azure-server-build-tasks.htm#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.markwilson.co.uk\/blog"},{"@type":"ListItem","position":2,"name":"Scripting Azure VM build tasks: static IP addresses, BGInfo and anti-malware extensions"}]},{"@type":"WebSite","@id":"https:\/\/www.markwilson.co.uk\/blog\/#website","url":"https:\/\/www.markwilson.co.uk\/blog\/","name":"markwilson.it","description":"get-info -class technology | write-output &gt; \/dev\/web","publisher":{"@id":"https:\/\/www.markwilson.co.uk\/blog\/#\/schema\/person\/98f61365e7c39d6be942174b8c4de468"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.markwilson.co.uk\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":["Person","Organization"],"@id":"https:\/\/www.markwilson.co.uk\/blog\/#\/schema\/person\/98f61365e7c39d6be942174b8c4de468","name":"Mark Wilson","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/i0.wp.com\/www.markwilson.co.uk\/blog\/uploads\/image-4.png?fit=800%2C800&ssl=1","url":"https:\/\/i0.wp.com\/www.markwilson.co.uk\/blog\/uploads\/image-4.png?fit=800%2C800&ssl=1","contentUrl":"https:\/\/i0.wp.com\/www.markwilson.co.uk\/blog\/uploads\/image-4.png?fit=800%2C800&ssl=1","width":800,"height":800,"caption":"Mark Wilson"},"logo":{"@id":"https:\/\/i0.wp.com\/www.markwilson.co.uk\/blog\/uploads\/image-4.png?fit=800%2C800&ssl=1"},"description":"A Chartered IT Professional, with recent experience in technology leadership, IT strategy and practice management roles, Mark Wilson is an Enterprise Architect in the Advisory and Management Group at risual. During a career spanning more than two decades, Mark has gained widespread recognition as an expert in his field including both industry and national press exposure. In addition to certifications from Microsoft, VMware, Red Hat, The Open Group and Axelos, Mark held a Microsoft Most Valuable Professional (MVP) award for three years and is now part of the MVP Reconnect programme. Mark is also well-known on social media and maintains an award-winning blog.","sameAs":["http:\/\/www.markwilson.co.uk\/","https:\/\/www.instagram.com\/markwilsonuk\/","https:\/\/www.linkedin.com\/in\/markawilson\/","https:\/\/x.com\/markwilsonit","https:\/\/www.youtube.com\/channel\/UCWHlZCoHRTocdvtrOJ2IL4A"],"url":"https:\/\/www.markwilson.co.uk\/blog\/author\/mark-wilson"}]}},"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":6421,"url":"https:\/\/www.markwilson.co.uk\/blog\/2016\/05\/building-multiple-nic-vm-azure.htm","url_meta":{"origin":6428,"position":0},"title":"Building a multiple NIC VM in Azure","author":"Mark Wilson","date":"Tuesday 24 May 2016","format":false,"excerpt":"I recently found myself in the situation where I wanted to build a virtual machine in Microsoft Azure (Resource Manager) with multiple network interface cards (vNICs). This isn't available from the portal, but it is possible from the command line. My colleague Leo D'Arcy pointed me to Samir Farhat's blog\u2026","rel":"","context":"In &quot;Technology&quot;","block_context":{"text":"Technology","link":"https:\/\/www.markwilson.co.uk\/blog\/topic\/technology"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":6382,"url":"https:\/\/www.markwilson.co.uk\/blog\/2016\/05\/reset-password-azure-virtual-machine.htm","url_meta":{"origin":6428,"position":1},"title":"Reset the password for a Windows virtual machine in Azure","author":"Mark Wilson","date":"Tuesday 10 May 2016","format":false,"excerpt":"Imagine the scenario: you have a virtual machine running in Azure but something's gone wrong\u00a0and you don't have Administrative credentials to log in to Windows. That's a more common occurrence than you might expect but there is a workaround: in Azure there an option to reset the local\u00a0administrator password. Unfortunately,\u2026","rel":"","context":"In &quot;Technology&quot;","block_context":{"text":"Technology","link":"https:\/\/www.markwilson.co.uk\/blog\/topic\/technology"},"img":{"alt_text":"Reset Password - Coming Soon","src":"https:\/\/i0.wp.com\/www.markwilson.co.uk\/blog\/images\/azure-reset-password.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.markwilson.co.uk\/blog\/images\/azure-reset-password.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.markwilson.co.uk\/blog\/images\/azure-reset-password.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.markwilson.co.uk\/blog\/images\/azure-reset-password.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":5247,"url":"https:\/\/www.markwilson.co.uk\/blog\/2014\/06\/short-takes-hosts-files-c-azure-vms-sleuthing-around-exchange-closing-windows-8-apps-and-managing-tabs-in-google-chrome.htm","url_meta":{"origin":6428,"position":2},"title":"Short takes: hosts files; C#; Azure VMs; sleuthing around Exchange; closing Windows 8 apps; and managing tabs in Google Chrome","author":"Mark Wilson","date":"Friday 27 June 2014","format":false,"excerpt":"Another dump of my open browser tabs to the web... Unable to edit hosts file in Windows One of the tools (read Excel\u00a0and lots of macros) that I use for financial forecasting said it couldn't find a server. \u00a0Of course the network's never broken - it must be the end\u2026","rel":"","context":"In &quot;Technology&quot;","block_context":{"text":"Technology","link":"https:\/\/www.markwilson.co.uk\/blog\/topic\/technology"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":7656,"url":"https:\/\/www.markwilson.co.uk\/blog\/2019\/03\/microsoft-ignite-the-tour-london-recap.htm","url_meta":{"origin":6428,"position":3},"title":"Microsoft Ignite | The Tour: London Recap","author":"Mark Wilson","date":"Tuesday 19 March 2019","format":false,"excerpt":"One of the most valuable personal development activities in my early career was a trip to the Microsoft TechEd conference in Amsterdam. I learned a lot - not just technically but about making the most of events to gather information, make new industry contacts, and generally top up my knowledge.\u2026","rel":"","context":"In &quot;Technology&quot;","block_context":{"text":"Technology","link":"https:\/\/www.markwilson.co.uk\/blog\/topic\/technology"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":4502,"url":"https:\/\/www.markwilson.co.uk\/blog\/2012\/10\/tech-days-online-2012-day-1-techdays2012.htm","url_meta":{"origin":6428,"position":4},"title":"Tech.Days Online 2012: Day 1 (#TechDays2012)","author":"Mark Wilson","date":"Wednesday 31 October 2012","format":false,"excerpt":"For the last couple of years, I've been concentrating on IT Strategy but I miss the hands-on technology. \u00a0I've kind of lost touch with what's been happening in my former world of Microsoft infrastructure and don't even get the chance to write about what's coming up in new releases as\u2026","rel":"","context":"In &quot;Technology&quot;","block_context":{"text":"Technology","link":"https:\/\/www.markwilson.co.uk\/blog\/topic\/technology"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.markwilson.co.uk\/blog\/images\/techdays-online-2012-1.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":5735,"url":"https:\/\/www.markwilson.co.uk\/blog\/2015\/07\/short-takes-reading-azure-ad-tenant-ids-in-powershell-and-a-script-to-retrieve-basic-tenant-details.htm","url_meta":{"origin":6428,"position":5},"title":"Short takes: PowerShell to examine Azure AD tenants; check which Office 365 datacentre you&#8217;re using","author":"Mark Wilson","date":"Friday 17 July 2015","format":false,"excerpt":"More snippets from my ever-growing browser full of tabs... PowerShell to get your Azure Active Directory tenant ID Whilst researching Office 365 tenant names and their significance, I stumbled across some potentially useful PowerShell to read your Azure Active Directory tenant ID. Get-AzureAccount I'm not sure how to map that\u2026","rel":"","context":"In &quot;Technology&quot;","block_context":{"text":"Technology","link":"https:\/\/www.markwilson.co.uk\/blog\/topic\/technology"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.markwilson.co.uk\/blog\/wp-json\/wp\/v2\/posts\/6428","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.markwilson.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.markwilson.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.markwilson.co.uk\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.markwilson.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=6428"}],"version-history":[{"count":5,"href":"https:\/\/www.markwilson.co.uk\/blog\/wp-json\/wp\/v2\/posts\/6428\/revisions"}],"predecessor-version":[{"id":6433,"href":"https:\/\/www.markwilson.co.uk\/blog\/wp-json\/wp\/v2\/posts\/6428\/revisions\/6433"}],"wp:attachment":[{"href":"https:\/\/www.markwilson.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=6428"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.markwilson.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=6428"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.markwilson.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=6428"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}