Sunday, 15 May 2016

Use PowerShell to Create an Azure VM report.

Hi,

This post is to simplify things on getting Azure classic VM report in a nice format. I wrote PowerShell script to collect azure VM information in html format. 




You can download script from here.
https://onedrive.live.com/redir?resid=2976E7AE701BC07C!158&authkey=!AE-BWeCcsiGHwvo&ithint=file%2cps1 

 Make sure you have Azure PowerShell module installed.


1. To check the module


Get-Module -ListAvailable

You should be able to see Azure module
ModuleType Version    Name                                ExportedCommands                                                                                                                                  
---------- -------    ----                                ----------------                                                                                                                                  
Manifest   1.2.3      Azure                               {Disable-AzureServiceProjectRemoteDesktop, Enable-AzureServiceProjectRemoteDesktop, Get-AzureServiceProjectRoleRuntime, Save-AzureServiceProject...


2. Login to Azure classic subscription.


Run
Add-AzureAccount


You will be popped up with login windows. Provide your Credential




You will see your Azure subscription ID and tenants ID.


3. Select-AzureSubscription -SubscriptionName 'your sub. name'

     4. Before extracting VM report you will have to know the name of your cloud service.
    Check your cloud service you want to take VM report from.



     5. Create folder structure C:\temp\Reports\Azure_VM_Info” this is the location where will we save your report.


6. Change you cloud service name and run your PowerShell command to get the nice report.

$cloudsname = 'Your azure cloud service name'

$getvm = Get-AzureVM -ServiceName $cloudsname | select -Property Name,IpAddress,InstanceSize,Status | ConvertTo-Html -Fragment


$getvm = $getvm | foreach {

      $_ -replace "<td>ReadyRole</td>","<td style='color:green'>Running</td>"

}


$getvm = $getvm | foreach {

      $_ -replace "<td>StoppedDeallocated</td>","<td style='color:red'>Stopped</td>"

      }



$date = Get-Date -UFormat "%m-%d-%y"
$filename = "AzureVM_Info"+"$date"


$HTML = ConvertTo-Html -Body "<H2> AzureVMInfo - </H2>", "$getvm" -Head "<style> body {background-color: lightblue; } table {background-color: white; margin 5px; float: left; top: 0px; display: inline-block; padding: 5px; border: 1px solid black} tr:nth-child(odd) {background-color: lightgray} </style>"

$HTML | Out-File C:\temp\Reports\Azure_VM_Info\$filename.html

Invoke-Item C:\temp\Reports\Azure_VM_Info\$filename.html




Hope this post will be informative to you.

“Have a nice day”

Digvijay


Friday, 28 November 2014

Upgrade from SCCM 2007 to SCCM 2012 - Point of View

This is a white paper that my buddy Sandeep Chadda and I wrote on upgrade strategy from SCCM 2007 to SCCM 2012. A quick over view of the white paper before you can download the rest of the document:


  Executive Summary :

This document reviews the impact of most of the aspects, objects, and features of System Center Configuration Manager when migrated from legacy SCCM 2007 to SCCM 2012. As part of this exercise, we assessed all components of SCCM by dividing them into 3 categories:
1.       Administration
2.       Software Library
3.       Assets and Compliance
We considered 104 use cases of SCCM spanned across the 3 categories for the purpose of this white paper. A high level summary of the components assessed is as follows:

SCCM Components
# of use cases
Successfully Migrated
Not Migrated Automatically
Migrated with Limited Capability
Administration
27
09
17
1
Software Library
39
22
15
2
Assets and Compliance
38
19
14
5
Total
104
50
46
8

Interpretation of the Data
·         Most of the components of SCCM related with packages, collections, advertisements etc. are successfully migrated automatically. These components will be migrated from SCCM 2007 to SCCM 2012 as-is.
·         Some of the components and aspects of SCCM such as site servers, SCCM roles, maintenance tasks, SCCM Client Agents etc. need to be setup manually. There is no migration path for these components.
·      
      in addition, aspects such as boundaries, boundary groups, collection settings, and boot media settings are migrated automatically however certain settings require additional manual intervention















Based on the use cases reviewed, we found that
·         48% of the SCCM components migrated as-is automatically without any intervention
·         44% of the SCCM components did not migrate at all
·         8% of the SCCM components migrated successfully but manual interventions were required



Download
Link