{"id":1261,"date":"2015-02-27T16:56:00","date_gmt":"2015-02-27T16:56:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/powershell\/2015\/02\/27\/introducing-get-azurevmdscextensionstatus-cmdlet-for-azure-powershell-dsc-extension\/"},"modified":"2019-02-28T09:01:58","modified_gmt":"2019-02-28T17:01:58","slug":"introducing-get-azurevmdscextensionstatus-cmdlet-for-azure-powershell-dsc-extension","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/powershell\/introducing-get-azurevmdscextensionstatus-cmdlet-for-azure-powershell-dsc-extension\/","title":{"rendered":"Introducing Get-AzureVMDscExtensionStatus cmdlet for Azure Powershell DSC Extension"},"content":{"rendered":"<p>ast August we introduced PowerShell Desired State Configuration (DSC) Extension for Azure VMs.\nThrough cmdlets released in the\u00a0<a href=\"http:\/\/azure.microsoft.com\/en-us\/downloads\/\">Azure PowerShell SDK<\/a>, you can upload and apply a PowerShell DSC configuration to an Azure VM.\nNow, we are introducing a new cmdlet<code>Get-AzureVMDscExtensionStatus<\/code>\nThis new cmdlet retrieves the status of the DSC Extension in all the VMs deployed in a cloud service or a particular VM.\nIt allows you to monitor the progress of the extension and the current status along with the detailed configuration logs.<\/p>\n<p>Once you have updated the DSC Extension to version 1.7 and the Azure Powershell to 0.8.14, you can use the\u00a0<code>Get-AzureVMDscExtensionStatus<\/code>\u00a0cmdlet to get the extension status.<\/p>\n<h2>How to use the cmdlet<\/h2>\n<p>There are two ways you can use this cmdlet :<\/p>\n<ol>\n<li>By specifying the service name.\nService name is a mandatory parameter for this parameter set.\nA cloud service can have one or more virtual machines deployed.\nWhen the service name is specified as the parameter, the cmdlet brings back the status for all the VM(s) deployed in that specific service.\nWhen the service name and name both are specified as parameters, the cmdlet returns the status for the VM specified provided there exists a VM with that name in the given cloud service.<\/li>\n<li>By specifying a VM object.\nYou can specify a VM object (as returned by Get-AzureVM cmdlet) as a parameter to this cmdlet. You can pass the VM object through the pipeline.<\/li>\n<\/ol>\n<div class=\"highlight highlight-powershell\">\n<pre wp-pre-tag-0=\"\"><\/pre>\n<\/div>\n<p>&#8216;example-service&#8217; is the name of the cloud service and &#8216;example-0&#8217; is the name of the virtual machine deployed in &#8216;example-service&#8217;.<\/p>\n<div class=\"highlight highlight-powershell\">\n<pre wp-pre-tag-1=\"\"><\/pre>\n<\/div>\n<p>The\u00a0<code>$status<\/code>\u00a0object returned by the cmdlet, contains a status (Success, Transitioning, Error, Warning),\nStatus Code and Status Message from the\u00a0<code>DSCExtensionStatus.psm1<\/code>\u00a0file (in the bin folder of the DSC Extension Handler install directory) for the DSC Extension handler.\nIt also returns a timestamp and configuration logs.\nNow let us push a sample configuration to a VM and see how the cmdlet retrieves the status and the configuration logs.<\/p>\n<pre wp-pre-tag-2=\"\"><\/pre>\n<pre wp-pre-tag-3=\"\"><\/pre>\n<p>The Configuration hasn&#8217;t finish yet. When we run\u00a0<code>Get-AzureVMDscExtensionStatus<\/code>\u00a0again after some time we see that configuration succeed.<\/p>\n<pre wp-pre-tag-4=\"\"><\/pre>\n<pre wp-pre-tag-5=\"\"><\/pre>\n<p>The cmdlet retrieves new events captured by the extension handler as they occur on the machine providing status updates and configuration logs.\nThere is a delay of a few minutes introduced by the Azure status caching layer.\nThe timestamp field helps differentiate between the old and the new status.<\/p>\n<p>In the event of an error or warning while running a configuration, the appropriate status message will appear, along with a detailed log containing the error or warning stream.\nAs you can see, the configuration that we just pushed to the Extension Handler completed successfully.<\/p>\n<p>Detailed logs will still persist on the VM under\u00a0<code>C:\\WindowsAzure\\Logs<\/code>, but\u00a0<code>Get-AzureVMDscExtensionStatus<\/code>\u00a0gives you ability to monitor the result of an ongoing configuration without logging onto the machine.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>ast August we introduced PowerShell Desired State Configuration (DSC) Extension for Azure VMs. Through cmdlets released in the\u00a0Azure PowerShell SDK, you can upload and apply a PowerShell DSC configuration to an Azure VM. Now, we are introducing a new cmdletGet-AzureVMDscExtensionStatus This new cmdlet retrieves the status of the DSC Extension in all the VMs deployed [&hellip;]<\/p>\n","protected":false},"author":600,"featured_media":13641,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[99,150],"class_list":["post-1261","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-powershell","tag-azure","tag-dsc"],"acf":[],"blog_post_summary":"<p>ast August we introduced PowerShell Desired State Configuration (DSC) Extension for Azure VMs. Through cmdlets released in the\u00a0Azure PowerShell SDK, you can upload and apply a PowerShell DSC configuration to an Azure VM. Now, we are introducing a new cmdletGet-AzureVMDscExtensionStatus This new cmdlet retrieves the status of the DSC Extension in all the VMs deployed [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/1261","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/users\/600"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/comments?post=1261"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/1261\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/media\/13641"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/media?parent=1261"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/categories?post=1261"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/tags?post=1261"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}