{"id":100,"date":"2007-02-16T09:29:00","date_gmt":"2007-02-16T13:29:00","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/2007\/02\/16\/more-with-service-uptime\/"},"modified":"2009-08-05T13:09:52","modified_gmt":"2009-08-05T17:09:52","slug":"more-with-service-uptime","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/100\/more-with-service-uptime\/","title":{"rendered":"More with Service Uptime"},"content":{"rendered":"<p>I knew I wasn't totally satisfied with my <a href=\"http:\/\/jdhitsolutions.blogspot.com\/2007\/02\/powershell-process-uptime.html\">recent attempt<\/a> at listing service uptime.  I knew there was a more elegant solution and here it is:<\/p>\n<p><span style=\"font-family:Lucida Console;font-size:85%;color:#0000ff;\">$s=Get-WmiObject -query \"Select name,processId,state from Win32_service where state='running'\"<br \/>foreach ($item in $s) {<br \/>$p=(Get-Process | Where {$_.id -eq $item.ProcessID}).StartTime<br \/>$u=(get-date).Subtract($p)<br \/>Write-Host $item.Name `t $u.Days day $u.hours hours $u.minutes minutes and $u.seconds seconds<br \/>}<\/span><\/p>\n<p>It made more sense to only make one WMI call to get running services. Now don't get too excited about this.  There is yet another tweak to be had.  Even though the Get-Wmiobject cmdlet will let me connect to a remote system, the Get-Process cmdlet runs locally. To get this to work completely for a remote system I need to use Get-Wmiobject and query the Win32_process on the remote system.  <\/p>\n<p>For the most part that's not a problem. All I have to do is pass the processID of each service to another WMI query for the associated Win32_Process. <\/p>\n<p><span style=\"font-family:Lucida Console;font-size:85%;color:#0000ff;\">$s=Get-WmiObject -query \"Select name,processId,state from Win32_service where state='running'\" -computer $computer<br \/>foreach ($item in $s) {<br \/>$query=\"Select handle,creationdate from win32_process where handle='\"+$item.ProcessID+\"'\"<br \/>$p=Get-WmiObject -query $query -computer $computer<\/span><\/p>\n<p>The Win32_Process class includes a CreationDate property. However, it is in the unfriendly WMI time format. To PowerShell it is a string that looks like 20070214115312.491614-300. Fortunately, I have a VBSCript function to convert this to a date.  I modified the function so it would work in PowerShell. The trick was first building a string type object and then casting it as a datetime object. <\/p>\n<p><span style=\"font-family:Lucida Console;font-size:85%;color:#0000ff;\">Function Convert-WMITime{<br \/>param([string]$WMITime) <\/span> <\/p>\n<p><span style=\"font-family:Lucida Console;font-size:85%;color:#0000ff;\">$yr=[string]$WMITime.Substring(0,4)<br \/>$mo=[string]$WMITime.substring(4,2)<br \/>$dy=[string]$WMITime.substring(6,2)<br \/>$tm=[string]$WMITime.substring(8,6)<br \/>$hr=[string]$tm.Substring(0,2)<br \/>$min=[string]$tm.substring(2,2)<br \/>$sec=[string]$tm.substring(4,2)<br \/>#create string<br \/>$s=\"$mo\/$dy\/$yr \"+$hr+\":\"+$min+\":\"+$sec<br \/>#cast result as DateTime type<br \/>$result=[DateTime]$s<br \/>return $result<br \/>}<\/span>  <\/p>\n<p>To get the uptime I convert the WMITime to a DateTime object that PowerShell understands and then use the same code I've used before: <\/p>\n<p><span style=\"font-family:Lucida Console;font-size:85%;color:#0000ff;\">$start=Convert-WmiTime($p.CreationDate)<br \/>$u=(get-date).Subtract($start)<br \/>Write-Host $item.Name `t $u.Days day $u.hours hours $u.minutes minutes and $u.seconds seconds<\/span><br \/>Here's the complete script. The Convert-WMITime function needs to come before it if you use a script or be a part of your profile. <\/p>\n<p><span style=\"font-family:Lucida Console;font-size:85%;color:#0000ff;\">$computer=\"dc01\"<br \/>Write-Host -fore Green -back Black $computer.ToUpper()<br \/>$s=Get-WmiObject -query \"Select name,processId,state from Win32_service where state='running'\" -computer $computer<br \/>foreach ($item in $s) {<br \/>$query=\"Select handle,creationdate from win32_process where handle='\"+$item.ProcessID+\"'\"<br \/>$p=Get-WmiObject -query $query -computer $computer<br \/>$start=Convert-WmiTime($p.CreationDate)<br \/>$u=(get-date).Subtract($start)<br \/>Write-Host $item.Name `t $u.Days day $u.hours hours $u.minutes minutes and $u.seconds seconds<br \/>}<\/span> <\/p>\n<p> Again, this is more or less fast & furious coding. There's plenty of room for formatting improvements and other enhancements which I'll leave to you.<\/p>\n<div class=\"wlWriterSmartContent\" id=\"0767317B-992E-4b12-91E0-4F059A8CECA8:ab69eb95-a80c-4c13-b5e3-dedadc1cc563\" contenteditable=\"false\" style=\"margin: 0px; padding: 0px; display: inline; float: none;\"><span style=\"font-size:85%;\">Technorati tags: <a href=\"http:\/\/technorati.com\/tags\/PowerShell\" rel=\"tag\">PowerShell<\/a>, <a href=\"http:\/\/technorati.com\/tags\/Scripting\" rel=\"tag\">Scripting<\/a>, <a href=\"http:\/\/technorati.com\/tags\/Services\" rel=\"tag\">Services<\/a>, <a href=\"http:\/\/technorati.com\/tags\/Uptime\" rel=\"tag\">Uptime<\/a>, <a href=\"http:\/\/technorati.com\/tags\/Pipeline\" rel=\"tag\">Pipeline<\/a>, <a href=\"http:\/\/technorati.com\/tags\/TipSheet\" rel=\"tag\">TipSheet<\/a>, <a href=\"http:\/\/technorati.com\/tags\/WMI\" rel=\"tag\">WMI<\/a><\/span><\/div>\n","protected":false},"excerpt":{"rendered":"<p>I knew I wasn&#8217;t totally satisfied with my recent attempt at listing service uptime. I knew there was a more elegant solution and here it is: $s=Get-WmiObject -query &#8220;Select name,processId,state from Win32_service where state=&#8217;running'&#8221;foreach ($item in $s) {$p=(Get-Process | Where {$_.id -eq $item.ProcessID}).StartTime$u=(get-date).Subtract($p)Write-Host $item.Name `t $u.Days day $u.hours hours $u.minutes minutes and $u.seconds seconds} It&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","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":[4,8],"tags":[33,547],"class_list":["post-100","post","type-post","status-publish","format-standard","hentry","category-powershell","category-scripting","tag-uptime","tag-wmi"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>More with Service Uptime &#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\/powershell\/100\/more-with-service-uptime\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"More with Service Uptime &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"I knew I wasn&#039;t totally satisfied with my recent attempt at listing service uptime. I knew there was a more elegant solution and here it is: $s=Get-WmiObject -query &quot;Select name,processId,state from Win32_service where state=&#039;running&#039;&quot;foreach ($item in $s) {$p=(Get-Process | Where {$_.id -eq $item.ProcessID}).StartTime$u=(get-date).Subtract($p)Write-Host $item.Name `t $u.Days day $u.hours hours $u.minutes minutes and $u.seconds seconds} It...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/100\/more-with-service-uptime\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2007-02-16T13:29:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2009-08-05T17:09:52+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=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/100\\\/more-with-service-uptime\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/100\\\/more-with-service-uptime\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"More with Service Uptime\",\"datePublished\":\"2007-02-16T13:29:00+00:00\",\"dateModified\":\"2009-08-05T17:09:52+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/100\\\/more-with-service-uptime\\\/\"},\"wordCount\":510,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"keywords\":[\"Uptime\",\"WMI\"],\"articleSection\":[\"PowerShell\",\"Scripting\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/100\\\/more-with-service-uptime\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/100\\\/more-with-service-uptime\\\/\",\"name\":\"More with Service Uptime &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"datePublished\":\"2007-02-16T13:29:00+00:00\",\"dateModified\":\"2009-08-05T17:09:52+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/100\\\/more-with-service-uptime\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/100\\\/more-with-service-uptime\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/100\\\/more-with-service-uptime\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"PowerShell\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/powershell\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"More with Service Uptime\"}]},{\"@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":"More with Service Uptime &#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\/powershell\/100\/more-with-service-uptime\/","og_locale":"en_US","og_type":"article","og_title":"More with Service Uptime &#8226; The Lonely Administrator","og_description":"I knew I wasn't totally satisfied with my recent attempt at listing service uptime. I knew there was a more elegant solution and here it is: $s=Get-WmiObject -query \"Select name,processId,state from Win32_service where state='running'\"foreach ($item in $s) {$p=(Get-Process | Where {$_.id -eq $item.ProcessID}).StartTime$u=(get-date).Subtract($p)Write-Host $item.Name `t $u.Days day $u.hours hours $u.minutes minutes and $u.seconds seconds} It...","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/100\/more-with-service-uptime\/","og_site_name":"The Lonely Administrator","article_published_time":"2007-02-16T13:29:00+00:00","article_modified_time":"2009-08-05T17:09:52+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":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/100\/more-with-service-uptime\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/100\/more-with-service-uptime\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"More with Service Uptime","datePublished":"2007-02-16T13:29:00+00:00","dateModified":"2009-08-05T17:09:52+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/100\/more-with-service-uptime\/"},"wordCount":510,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"keywords":["Uptime","WMI"],"articleSection":["PowerShell","Scripting"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/100\/more-with-service-uptime\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/100\/more-with-service-uptime\/","name":"More with Service Uptime &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"datePublished":"2007-02-16T13:29:00+00:00","dateModified":"2009-08-05T17:09:52+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/100\/more-with-service-uptime\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/100\/more-with-service-uptime\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/100\/more-with-service-uptime\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"PowerShell","item":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},{"@type":"ListItem","position":2,"name":"More with Service Uptime"}]},{"@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":103,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/103\/more-with-process-and-service-uptime\/","url_meta":{"origin":100,"position":0},"title":"More with Process and Service uptime","author":"Jeffery Hicks","date":"February 20, 2007","format":false,"excerpt":"Like most things scripting, there's usually more than one way to do things. I thought I had a nice solution for getting service uptime via WMI. But alas, there is an even easier way. PowerShell has a ConvertToDateTime method which will convert a WMI time to a standard date time\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":99,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/99\/powershell-process-uptime\/","url_meta":{"origin":100,"position":1},"title":"PowerShell Process Uptime","author":"Jeffery Hicks","date":"February 15, 2007","format":false,"excerpt":"Not too long ago, I wrote an MCPMag Tip Sheet column on using the pipeline in PowerShell. I showed how you could get the start time of a specified service: $svcname=Read-Host \"Enter a service name\" ; get-process | where {$_.id -eq (get-wmiobject win32_service | where {$_.name -eq $svcname}).ProcessID} | select\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":515,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/515\/find-that-service\/","url_meta":{"origin":100,"position":2},"title":"Find That Service","author":"Jeffery Hicks","date":"November 19, 2009","format":false,"excerpt":"Once again, the fine forum members at ScriptingAnswers.com come through and help get my PowerShell idea engine revving. The latest post posed this basic question: \u201cI need to query my servers and find all services using a specific service account.\u201d The poster thought this would be a good opportunity to\u2026","rel":"","context":"In &quot;CommandLine&quot;","block_context":{"text":"CommandLine","link":"https:\/\/jdhitsolutions.com\/blog\/category\/commandline\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":995,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/995\/friday-fun-the-kitchen-sink-prompt\/","url_meta":{"origin":100,"position":3},"title":"Friday Fun &#8211; The Kitchen Sink Prompt","author":"Jeffery Hicks","date":"October 29, 2010","format":false,"excerpt":"On my last Friday Fun post on PowerShell prompts, I got a terrific comment from Bart Vandyck about his prompt which has just about everything you would want. I too have a \"kitchen sink\" prompt, that is to say, one with the proverbial \"everything but the kitchen sink\". Or you\u2026","rel":"","context":"In &quot;Friday Fun&quot;","block_context":{"text":"Friday Fun","link":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2010\/10\/everything-console-1024x798.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2010\/10\/everything-console-1024x798.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2010\/10\/everything-console-1024x798.png?resize=525%2C300 1.5x"},"classes":[]},{"id":1551,"url":"https:\/\/jdhitsolutions.com\/blog\/wmi\/1551\/find-non-system-service-accounts-with-powershell-and-wmi\/","url_meta":{"origin":100,"position":4},"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":1201,"url":"https:\/\/jdhitsolutions.com\/blog\/wmi\/1201\/new-event-report-revised\/","url_meta":{"origin":100,"position":5},"title":"New Event Report Revised","author":"Jeffery Hicks","date":"March 8, 2011","format":false,"excerpt":"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\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":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/100","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=100"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/100\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=100"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=100"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=100"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}