Thursday, 24 March 2016

Powershell: WMI or CMI?

It is recommended to use CIM whenever possible. See my other article which talks about differences between CIM and WMI.

Understandning WMI and CIM in Powershell


 

Understanding WMI and CIM in Powershell



Windows Management Instrumentation (WMI) and Common Information Model (CIM). both are  technologies based on industry standards defined by the Distributed Management Task Force (DMTF).

WMI is Microsoft’s implementation of the Web-Based Enterprise Management (WBEM) standard and is based on preliminary standards and proprietary technology. WMI has been available on the Windows
operating system since Windows NT 4.0.

CIM is a newer technology, and is based on open, cross-platform standards.

Both technologies provide a way to connect to a common information repository (aka WMI
repository). This repository holds management information that you can query and manipulate.

Windows PowerShell™ 3.0 and later supports both technologies.

CIM Commands:

CIM commands provide many different cross-platform and cross-version capabilities.

There are 3 types of connections possible with CIM.
  1. Connection to local Computer using DCOM.
  2. Ad hoc connection to remote computer using WS-MAN
  3. Session based connection to remote computer using DCOM or WS-MAN
You can use CIM commands in two ways.
  1. The first way requires the remote computer to have WinRM installed and enabled.
  2. The second way to use CIM commands is to use the earlier WMI technology for CIM commands.

WMI Commands:

Difference between WMI and CIM is that the way WMI connects to remote system.

WMI commands do not support session-based connections. The commands support only ad hoc
connections over DCOM.

WMI commands communicate with the WMI service. WMI commands are typically necessary only when you have to make an ad hoc connection to a computer that does not have Windows PowerShell remoting enabled.

Use CIM commands primarily, and use WMI commands only when CIM commands cannot be used.

Tuesday, 22 March 2016

Powershell Comparison Operators

Comparison operators are commonly used with numerical values, although can be used when working with dates or version numbers and other variable types. The following table contains the comparison operators.



The -match operator can be used when looking for a portion of a string, or -like can be used to perform wildcard searches. PowerShell can also be used to search for a particular value within an array by using -in, -notin, -contains, or -notcontains.

Sunday, 20 March 2016

Update powershell help from local source instead of internet

Instead of updating powershell help from internet, we can also update the help for powershell using local source like file share or local drive. This is an useful option for systems that are not connected to internet.

  • Save powershell help files to file server shared folder from system that has updated powershell help. In my case I have used local folder for demo.




  • If you open the folder after saving help, it should look something like below as combination of  archives (.cab) and XML files.
  • On the system where you want to update powershell help, start powershell and run following command
 
 
Note:  You can update system powershell help only once in 24 hrs unless you use -Force option. You can opt to update all modules or go for selective module update only as per requirement.

WMF 3.0 (Powershell) and SCCM 2012, Exchange 2010, SCVMM, Sharepoint 2010 Compatitbility

Windows Management Framework 3.0 (WMF 3.0) has compatibility issues with the following applications.

-         System Center 2012 Configuration Manager
http://support.microsoft.com/kb/2796086  (Configuration Manager Management Points collocated with clients fail after installing Windows Management Framework 3.0 and running Client Health Evaluation)

-         System Center Virtual Machine Manager
http://support.microsoft.com/kb/2795043 (Managing Hyper-V hosts using Virtual Machine Manager fails with Error: 0x8033803b after installing WMF 3.0)

-         Microsoft Exchange Server 2007 and Microsoft Exchange Server 2010

-         Microsoft SharePoint 2010

-         Windows Small Business Server 2008 and Windows Small Business Server 2011
http://blogs.technet.com/b/sbs/archive/2012/12/15/windows-management-framework-3-0-applicability-on-windows-small-business-server-2008-2011-standard.aspx  (Windows Management Framework 3.0 applicability on Windows Small Business Server 2008/2011 Standard)



Reference:  https://blogs.msdn.microsoft.com/powershell/2012/12/19/windows-management-framework-3-0-compatibility-update/

Powershell versions and compatible Windows OS versions

Popular Posts This Week