{"id":1201,"date":"2011-03-08T10:58:11","date_gmt":"2011-03-08T15:58:11","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/?p=1201"},"modified":"2011-03-08T10:58:11","modified_gmt":"2011-03-08T15:58:11","slug":"new-event-report-revised","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/wmi\/1201\/new-event-report-revised\/","title":{"rendered":"New Event Report Revised"},"content":{"rendered":"<p>Last year I <a href=\"http:\/\/jdhitsolutions.com\/blog\/2010\/09\/new-event-report\/\" target=\"_blank\">posted <\/a>an update to an old <a href=\"http:\/\/redmondmag.com\/articles\/2009\/02\/01\/event-reporting-revisited.aspx\" target=\"_blank\">Mr. Roboto<\/a> script that was an update to an even older VBScript. Still with me?  My last revision leveraged the new Get-WinEvent cmdlet to create an HTML report of recent error activity on one or more computers. The problem was that I didn't account for older computers that don't support Get-WinEvent. I finally have a version that does.<!--more--><\/p>\n<p>This latest, and hopefully last, version will now check the operating system of the computer you want to query.<\/p>\n<p>[cc lang=\"PowerShell\"]<br \/>\n $os=Get-WmiObject -Query \"Select Caption from Win32_OperatingSystem\" -EnableAllPrivileges -ComputerName $computer -ErrorAction \"Stop\"<br \/>\n[\/cc]<\/p>\n<p>I use a simple regular expression match to test the OS version.<\/p>\n<p>[cc lang=\"Powershell\"]<br \/>\nIf ($os.caption -match \"2000|XP|2003\") {<br \/>\n            #if computer is running an old OS then use Get-WMIobject<br \/>\n            #define some scriptblocks<br \/>\n[\/cc]<br \/>\nIf the Caption property indicates an OS that is Vista or later, then the rest of the function is pretty much unchanged.  Otherwise I use the code I had from my original version that uses Get-WMIObject. The benefit is that now with version 2 we have the -EnableAllPrivileges parameter with Get-WMIObject.<\/p>\n<p>[cc lang=\"PowerShell\"]<br \/>\n$query=\"Select ComputerName,Message,TimeGenerated,Type,SourceName,EventCode,Logfile from win32_NTLogEvent WHERE (Type='warning' OR Type='error' OR Type='Audit Failure') AND TimeWritten>'$dmtf'\"<br \/>\n            Write-Verbose $query<br \/>\n            $cmd='Get-WmiObject -ComputerName $computer -query $query -enableAllPrivileges'<\/p>\n<p>            if ($credential) {<br \/>\n                $cmd=$cmd + \" -credential `$credential\"<br \/>\n            }<br \/>\n            Write-Verbose $cmd<\/p>\n<p>            $status=\"Getting event log data from $computer\"<br \/>\n            Write-Progress -Activity $activity -Status $status -CurrentOperation \"Querying logs\"<\/p>\n<p>            $results+=Invoke-Expression $cmd  |<br \/>\n              select @{name=\"Computername\";Expression={($_.ComputerName).ToUpper()}},<br \/>\n                Type,@{name=\"TimeCreated\";Expression={$_.ConvertToDateTime($_.TimeGenerated)}},<br \/>\n                @{Name=\"ProviderName\";Expression={$_.SourceName}},<br \/>\n                @{Name=\"ID\";Expression={$_.EventCode}},Message,<br \/>\n                @{Name=\"LogName\";Expression={$_.Logfile}}<br \/>\n[\/cc]<\/p>\n<p>I wish I could use Get-Event but it doesn't have a parameter that supports alternate credentials.  I could have used remoting, but then I would also have had to assume that PowerShell 2 was installed on legacy systems with remoting enabled and I didn't want to force that assumption on people.<\/p>\n<p>The rest of the function works pretty much as before.  All the matching event logs are converted to an HTML file and I parse the HTML to adjust for style tags.<\/p>\n<p>[cc lang=\"PowerShell\"]<br \/>\n foreach ($line in $html) {<br \/>\n        $i++<br \/>\n        Write-Progress -Activity $activity -Status $status -CurrentOperation \"Colorizing\" -PercentComplete $($i\/($html.count)*100)<br \/>\n        Switch -regex ($line) {<br \/>\n          \"<\/p>\n<th>\\w+<\/th>\n<p>\"  {<br \/>\n                            Write-Verbose \"Colorizing header\"<br \/>\n                            $colorized+=$line.Replace(\"<\/p>\n<tr>\",\"<\/p>\n<tr class=\"\"header\"\">\")<br \/>\n                            }<br \/>\n          \"<\/p>\n<td>Error<\/td>\n<p>\"  {<br \/>\n                            Write-Verbose \"Colorizing Error\"<br \/>\n                            $colorized+=$line.Replace(\"<\/p>\n<tr>\",\"<\/p>\n<tr class=\"\"error\"\">\")<br \/>\n                            }<br \/>\n          \"<\/p>\n<td>Critical<\/td>\n<p>\"  {<br \/>\n                            Write-Verbose \"Colorizing Critical\"<br \/>\n                            $colorized+=$line.Replace(\"<\/p>\n<tr>\",\"<\/p>\n<tr class=\"\"critical\"\">\")<br \/>\n                            }  <\/p>\n<p>          \"<\/p>\n<td>Security<\/td>\n<p>\"  {<br \/>\n                            Write-Verbose \"Colorizing Audit Failure\"<br \/>\n                            $colorized+=$line.Replace(\"<\/p>\n<tr>\",\"<\/p>\n<tr class=\"\"audit\"\">\")<br \/>\n                              }<br \/>\n          \"<\/table>\n<p>\"  {<br \/>\n                            Write-Verbose \"Adding footer $($footer)\"<br \/>\n                            $colorized+=$line.Replace(\"<\/table>\n<p>\",$footer)<br \/>\n          }   <\/p>\n<p>        Default {<br \/>\n            $colorized+=$line<br \/>\n        }<br \/>\n       } #end Switch<br \/>\n    }<br \/>\n[\/cc]<\/p>\n<p>Download <a href='http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/03\/New-EventReport-v2.31.txt' target=\"_blank\">New-EventReport-v2.3<\/a> and dot source the script in your PowerShell session. The New-EventReport function has full comment-based help.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Last year I posted an update to an old Mr. Roboto script that was an update to an even older VBScript. Still with me? My last revision leveraged the new Get-WinEvent cmdlet to create an HTML report of recent error activity on one or more computers. The problem was that I didn&#8217;t account for older&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[74,75,99,19],"tags":[229,226,263,103,237,534,547],"class_list":["post-1201","post","type-post","status-publish","format-standard","hentry","category-mr-roboto","category-powershell-v2-0","category-windows-7","category-wmi","tag-convertto-html","tag-eventlog","tag-get-winevent","tag-get-wmiobject","tag-html","tag-powershell","tag-wmi"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>New Event Report Revised &#8226; The Lonely Administrator<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/jdhitsolutions.com\/blog\/wmi\/1201\/new-event-report-revised\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"New Event Report Revised &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"Last year I posted an update to an old Mr. Roboto script that was an update to an even older VBScript. Still with me? My last revision leveraged the new Get-WinEvent cmdlet to create an HTML report of recent error activity on one or more computers. The problem was that I didn&#039;t account for older...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/wmi\/1201\/new-event-report-revised\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2011-03-08T15:58:11+00:00\" \/>\n<meta name=\"author\" content=\"Jeffery Hicks\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@JeffHicks\" \/>\n<meta name=\"twitter:site\" content=\"@JeffHicks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jeffery Hicks\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wmi\\\/1201\\\/new-event-report-revised\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wmi\\\/1201\\\/new-event-report-revised\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"New Event Report Revised\",\"datePublished\":\"2011-03-08T15:58:11+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wmi\\\/1201\\\/new-event-report-revised\\\/\"},\"wordCount\":448,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"keywords\":[\"ConvertTo-HTML\",\"eventlog\",\"Get-WinEvent\",\"Get-WMIObject\",\"HTML\",\"PowerShell\",\"WMI\"],\"articleSection\":[\"Mr. Roboto\",\"PowerShell v2.0\",\"Windows 7\",\"WMI\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wmi\\\/1201\\\/new-event-report-revised\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wmi\\\/1201\\\/new-event-report-revised\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wmi\\\/1201\\\/new-event-report-revised\\\/\",\"name\":\"New Event Report Revised &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"datePublished\":\"2011-03-08T15:58:11+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wmi\\\/1201\\\/new-event-report-revised\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wmi\\\/1201\\\/new-event-report-revised\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wmi\\\/1201\\\/new-event-report-revised\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Mr. Roboto\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/mr-roboto\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"New Event Report Revised\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/\",\"name\":\"The Lonely Administrator\",\"description\":\"Practical Advice for the Automating IT Pro\",\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\",\"name\":\"Jeffery Hicks\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"caption\":\"Jeffery Hicks\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"New Event Report Revised &#8226; The Lonely Administrator","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/jdhitsolutions.com\/blog\/wmi\/1201\/new-event-report-revised\/","og_locale":"en_US","og_type":"article","og_title":"New Event Report Revised &#8226; The Lonely Administrator","og_description":"Last year I posted an update to an old Mr. Roboto script that was an update to an even older VBScript. Still with me? My last revision leveraged the new Get-WinEvent cmdlet to create an HTML report of recent error activity on one or more computers. The problem was that I didn't account for older...","og_url":"https:\/\/jdhitsolutions.com\/blog\/wmi\/1201\/new-event-report-revised\/","og_site_name":"The Lonely Administrator","article_published_time":"2011-03-08T15:58:11+00:00","author":"Jeffery Hicks","twitter_card":"summary_large_image","twitter_creator":"@JeffHicks","twitter_site":"@JeffHicks","twitter_misc":{"Written by":"Jeffery Hicks","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/wmi\/1201\/new-event-report-revised\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/wmi\/1201\/new-event-report-revised\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"New Event Report Revised","datePublished":"2011-03-08T15:58:11+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/wmi\/1201\/new-event-report-revised\/"},"wordCount":448,"commentCount":1,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"keywords":["ConvertTo-HTML","eventlog","Get-WinEvent","Get-WMIObject","HTML","PowerShell","WMI"],"articleSection":["Mr. Roboto","PowerShell v2.0","Windows 7","WMI"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/wmi\/1201\/new-event-report-revised\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/wmi\/1201\/new-event-report-revised\/","url":"https:\/\/jdhitsolutions.com\/blog\/wmi\/1201\/new-event-report-revised\/","name":"New Event Report Revised &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"datePublished":"2011-03-08T15:58:11+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/wmi\/1201\/new-event-report-revised\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/wmi\/1201\/new-event-report-revised\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/wmi\/1201\/new-event-report-revised\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Mr. Roboto","item":"https:\/\/jdhitsolutions.com\/blog\/category\/mr-roboto\/"},{"@type":"ListItem","position":2,"name":"New Event Report Revised"}]},{"@type":"WebSite","@id":"https:\/\/jdhitsolutions.com\/blog\/#website","url":"https:\/\/jdhitsolutions.com\/blog\/","name":"The Lonely Administrator","description":"Practical Advice for the Automating IT Pro","publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/jdhitsolutions.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9","name":"Jeffery Hicks","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","url":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","caption":"Jeffery Hicks"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg"}}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":945,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/945\/new-event-report\/","url_meta":{"origin":1201,"position":0},"title":"New Event Report","author":"Jeffery Hicks","date":"September 20, 2010","format":false,"excerpt":"For a number of years I wrote the popular Mr. Roboto column for REDMOND magazine. When I first started the column, many of my scripts were written in VBScript. Then as PowerShell came along that became the preferred tool. Over time I realized there were some VBScripts that could be\u2026","rel":"","context":"In &quot;Mr. Roboto&quot;","block_context":{"text":"Mr. Roboto","link":"https:\/\/jdhitsolutions.com\/blog\/category\/mr-roboto\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1532,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1532\/get-local-administrators-with-wmi-and-powershell\/","url_meta":{"origin":1201,"position":1},"title":"Get Local Administrators with WMI and PowerShell","author":"Jeffery Hicks","date":"July 1, 2011","format":false,"excerpt":"Earlier this week I was helping someone out on a problem working with the local administrators group. There are a variety of ways to enumerate the members of a local group. The code he was using involved WMI. I hadn't really worked with the WMI approach in any great detail\u2026","rel":"","context":"In &quot;PowerShell v2.0&quot;","block_context":{"text":"PowerShell v2.0","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell-v2-0\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1551,"url":"https:\/\/jdhitsolutions.com\/blog\/wmi\/1551\/find-non-system-service-accounts-with-powershell-and-wmi\/","url_meta":{"origin":1201,"position":2},"title":"Find Non System Service Accounts with PowerShell and WMI","author":"Jeffery Hicks","date":"July 5, 2011","format":false,"excerpt":"As easy as Get-Service is to use in PowerShell, it has one limitation for IT Pros: it can't show you what account the service is running under. In old school terms, \"What is the service account?\" Fortunately you can get that information using WMI. Here's a query you can use\u2026","rel":"","context":"In &quot;PowerShell v2.0&quot;","block_context":{"text":"PowerShell v2.0","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell-v2-0\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1687,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1687\/filter-left\/","url_meta":{"origin":1201,"position":3},"title":"Filter Left","author":"Jeffery Hicks","date":"October 14, 2011","format":false,"excerpt":"When writing WMI queries expressions in Windows PowerShell, it is recommended to use WMI filtering, as opposed to getting objects and then filtering with Where-Object. I see expressions like this quite often: [cc lang=\"PowerShell\"] get-wmiobject win32_process -computer $c | where {$_.name -eq \"notepad.exe\"} [\/cc] In this situation, ALL process objects\u2026","rel":"","context":"In &quot;Best Practices&quot;","block_context":{"text":"Best Practices","link":"https:\/\/jdhitsolutions.com\/blog\/category\/best-practices\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/10\/talkbubble.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1562,"url":"https:\/\/jdhitsolutions.com\/blog\/wmi\/1562\/get-shared-resource\/","url_meta":{"origin":1201,"position":4},"title":"Get Shared Resource","author":"Jeffery Hicks","date":"July 12, 2011","format":false,"excerpt":"I was poking around WMI the other day in PowerShell and was intrigued by the Win32_Share class. This is a great way to find out what items are shared on a server such as printers and folders, although it's not limited to those types of resources. I thought this would\u2026","rel":"","context":"In &quot;PowerShell v2.0&quot;","block_context":{"text":"PowerShell v2.0","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell-v2-0\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":530,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/530\/putting-the-squeeze-on-files-with-powershell\/","url_meta":{"origin":1201,"position":5},"title":"Putting the Squeeze on Files with PowerShell","author":"Jeffery Hicks","date":"December 9, 2009","format":false,"excerpt":"My December Mr. Roboto column is now online This month\u2019s tool is a PowerShell WinForm script that uses WMI to compress files. I used PrimalForms 2009 to build the graphical interface. The interface is essentially a wizard that lets you build a WMI query to find files and compress them.\u00a0\u2026","rel":"","context":"In &quot;Mr. Roboto&quot;","block_context":{"text":"Mr. Roboto","link":"https:\/\/jdhitsolutions.com\/blog\/category\/mr-roboto\/"},"img":{"alt_text":"captured_Image.png","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2009\/12\/captured_Image.png_thumb.png?resize=350%2C200","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1201","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=1201"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1201\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=1201"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=1201"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=1201"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}