Friday, June 23, 2017

Extract contents from msp file

Use the msix utility to extract the contents of your msp file.

https://onedrive.live.com/?id=9415F61CBB1A8030%211613&cid=9415F61CBB1A8030


C:\Parag\Tools\Temp>MsiX.exe SCSM2012R2_CU_KB3129780_AMD64_7.5.3079.607.msp
Target_MSIToFixed_MSI
#Target_MSIToFixed_MSI
PCW_CAB_SMHotfix

Rename the cab file by adding the extension .cab to it.

Now you can browse the file in Windows Explorer and extract the file you need.

Find the directory for your installation and search for this file.

Microsoft.EnterpriseManagement.Packaging.dll

Copy the location of that file in my case its

C:\Program Files\Microsoft System Center 2012 R2\Operations Manager\Setup

Thursday, June 22, 2017

VMWare monitoring using SCOM

The management pack for monitoring VMware is here.

https://github.com/Mitch-Luedy/Community.VMware

It's a very good management pack.and also has clear instructions for installation.


But after installation you may find that the required objects are not being discovered.
This is largely due to the fact that the powershell scripts which are running the discoveries have this

Try {
    Add-PSSnapin VMware.VimAutomation.Core
} Catch {
    Start-Sleep -Seconds 10
    Try {
        Add-PSSnapin VMware.VimAutomation.Core
    } Catch {
        DefaultErrorLogging
        Exit
    }
}

If the mp was unsealed then maybe I could have updated the code and added import-module instead of this one. But to fix it  try this.

1. Install the VMware powercli version from this link.

https://my.vmware.com/web/vmware/details?downloadGroup=PCLI550&productId=352

VMware-PowerCLI-5.1.0-793510.exe

After installation run the commands in powershell and if you do not get any errors then you are good to go.

Wednesday, June 7, 2017

How to make a parameter mandatory in powershell.

How to make a parameter mandatory in powershell.

Enter this at the start of your script.

param(
            [Parameter(Mandatory=$true)]
            [string]$Server
           )

A very good explanation and additional ways to do it is here.

https://blogs.technet.microsoft.com/heyscriptingguy/2011/05/22/use-powershell-to-make-mandatory-parameters/