{"id":4126,"date":"2013-02-22T00:01:00","date_gmt":"2013-02-22T00:01:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2013\/02\/22\/use-powershell-to-find-installed-video-codecs-on-windows-8\/"},"modified":"2013-02-22T00:01:00","modified_gmt":"2013-02-22T00:01:00","slug":"use-powershell-to-find-installed-video-codecs-on-windows-8","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/use-powershell-to-find-installed-video-codecs-on-windows-8\/","title":{"rendered":"Use PowerShell to Find Installed Video Codecs on Windows 8"},"content":{"rendered":"<p><strong style=\"font-size: 12px\">Summary:<\/strong><span style=\"font-size: 12px\"> Microsoft Scripting Guy, Ed Wilson, talks about using Windows PowerShell to find installed video codecs on Windows&nbsp;8.<\/span><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/q-for-powertip.jpg\" alt=\"Hey, Scripting Guy! Question\" \/>&nbsp;Hey, Scripting Guy! Dude, I am in trouble. Big time! Last week, I installed Windows&nbsp;8 on the laptops used by all our department heads and front-line supervisors. I thought the responsiveness and the apps would be very useful and a welcome upgrade&mdash;I mean, Windows&nbsp;8 has gotten great reviews, and personally, I love it. But no!!!!! Come to find out, I guess the only thing these people use their laptops for is to watch DVDs when they are on the road. (I imagine they also check their email, but they could use their phones to do that.) Anyway, I never noticed that Windows&nbsp;8 does not ship with a CODEC to enable someone to watch a DVD. Huh? I mean, get real, this is ridiculous. Personally, I like Media Player and have used it for years, but not if it is going to get me fired. I need a way to find out if a laptop has a particular CODEC, AND I need to find a DVD CODEC now. Can you help me?<\/p>\n<p>&mdash;ML<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/a-for-powertip.jpg\" alt=\"Hey, Scripting Guy! Answer\" \/>&nbsp;Hello ML,<\/p>\n<p>Microsoft Scripting Guy, Ed Wilson, is here. WOW, ML, I am sorry you are in trouble. I can imagine that I might have gotten into a similar predicament because I also would not consider watching a DVD on my laptop as a mission-critical use case scenario, and it would have fallen out of the test specs.<\/p>\n<p>Yes, there has been some mixed messaging around playing DVDs on Windows&nbsp;8. A quick search via Bing reveals lots of blog posts that state that Media Center would be in Windows&nbsp;8, and not so much that says it will not be in Windows&nbsp;8. And since we have had Media Center in various editions of Windows for several releases now, I can also expect that you might have missed it. The good news is that you can download the Windows&nbsp;8 Media Center Pack for Windows&nbsp;8 Pro for $9.99 USD. <a href=\"http:\/\/windows.microsoft.com\/en-US\/windows-8\/feature-packs\" target=\"_blank\">The details are available via this web page<\/a>. Also, if you are not running Windows&nbsp;8 Pro, we have an upgrade that is available&mdash;this upgrade also includes Windows&nbsp;8 Media Center. I actually did this for one of the Scripting Wife&rsquo;s computers and it worked very slick, and kept all of her settings (of course, I backed everything up first, just in case).<\/p>\n<h2>Finding installed video codecs<\/h2>\n<p>To find video codecs installed on your computers, use the <strong>Win32_VideoCodec <\/strong>WMI class. You can query it via the old <strong>Get-WmiObject<\/strong> cmdlet, as shown here.<\/p>\n<p style=\"padding-left: 30px\">Get-WmiObject win32_codecfile -Filter &#8216;group = &#8220;video&#8221;&#8216;<\/p>\n<p>But because you are targeting computers running Windows&nbsp;8, you can also use the <strong>Get-CimInstance<\/strong> cmdlet, as shown here.<\/p>\n<p style=\"padding-left: 30px\">Get-CimInstance win32_codecfile -Filter &#8216;group = &#8220;video&#8221;&#8216;<\/p>\n<h2>Querying multiple remote computers<\/h2>\n<p>To query multiple remote computers, by using the <strong>Get-WmiObject<\/strong> cmdlet, you can simply add multiple computer names, and specify the appropriate credentials. This technique is shown here.<\/p>\n<p style=\"padding-left: 30px\">Get-WmiObject win32_codecfile -Filter &#8216;group = &#8220;video&#8221;&#8216; -Credential iammred\\administrator -ComputerName ws1,ws2,ws3<\/p>\n<p>To query multiple computers by using the CIM cmdlets, first create a <strong>cim<\/strong> session, and then do the query. This is shown here.<\/p>\n<p style=\"padding-left: 30px\">$session = New-CimSession -ComputerName ws1,ws2,ws3 -Credential iammred\\adminIstrator<\/p>\n<p style=\"padding-left: 30px\">Get-CimInstance win32_codecfile -Filter &#8216;group = &#8220;video&#8221;&#8216; -CimSession $session<\/p>\n<h2>Examine the data<\/h2>\n<p>After you have the data, you can examine it by piping it to the <strong>Format-List<\/strong> cmdlet and selecting all of the properties. You can then peruse the output to see what properties are most useful for you. Here is an example.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/0474.HSG-2-22-13-01.png\"><img decoding=\"async\" title=\"Image of command output\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/0474.HSG-2-22-13-01.png\" alt=\"Image of command output\" \/><\/a><\/p>\n<p>ML, that is all there is to using WMI to examine video codecs. Join me tomorrow for the Weekend Scripter, when I will talk about creating test log files on Saturday and about parsing those log files on Sunday. It will be fun, I promise.<\/p>\n<p>I invite you to follow me on <a href=\"http:\/\/bit.ly\/scriptingguystwitter\" target=\"_blank\">Twitter<\/a> and <a href=\"http:\/\/bit.ly\/scriptingguysfacebook\" target=\"_blank\">Facebook<\/a>. If you have any questions, send email to me at <a href=\"mailto:scripter@microsoft.com\" target=\"_blank\">scripter@microsoft.com<\/a>, or post your questions on the <a href=\"http:\/\/bit.ly\/scriptingforum\" target=\"_blank\">Official Scripting Guys Forum<\/a>. See you tomorrow. Until then, peace.<\/p>\n<p><strong>Ed Wilson, Microsoft Scripting Guy<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Summary: Microsoft Scripting Guy, Ed Wilson, talks about using Windows PowerShell to find installed video codecs on Windows&nbsp;8. &nbsp;Hey, Scripting Guy! Dude, I am in trouble. Big time! Last week, I installed Windows&nbsp;8 on the laptops used by all our department heads and front-line supervisors. I thought the responsiveness and the apps would be very [&hellip;]<\/p>\n","protected":false},"author":596,"featured_media":87096,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[385,123,3,4,192,45,6],"class_list":["post-4126","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-cim","tag-multimedia","tag-scripting-guy","tag-scripting-techniques","tag-windows-media-player-and-audio","tag-windows-powershell","tag-wmi"],"acf":[],"blog_post_summary":"<p>Summary: Microsoft Scripting Guy, Ed Wilson, talks about using Windows PowerShell to find installed video codecs on Windows&nbsp;8. &nbsp;Hey, Scripting Guy! Dude, I am in trouble. Big time! Last week, I installed Windows&nbsp;8 on the laptops used by all our department heads and front-line supervisors. I thought the responsiveness and the apps would be very [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/4126","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/users\/596"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/comments?post=4126"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/4126\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media\/87096"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media?parent=4126"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=4126"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=4126"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}