{"id":1625,"date":"2011-08-25T10:08:01","date_gmt":"2011-08-25T14:08:01","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/?p=1625"},"modified":"2011-08-27T07:24:28","modified_gmt":"2011-08-27T11:24:28","slug":"get-process-owner","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1625\/get-process-owner\/","title":{"rendered":"Get Process Owner"},"content":{"rendered":"<p>I've been working on my second training course for <a href=\"http:\/\/www.trainsignal.com\/\" title=\"Check out their training offerings\" target=\"_blank\">Train Signal<\/a> on managing Windows Server 2008 with Windows PowerShell, specifically the lesson on managing processes. I thought I'd share a little tidbit I worked out. In fact, I hope you'll stay tuned for other little goodies over the next several weeks. The training video will have a large amount of demonstration and a lot of sample code and scripts. Here's one on finding the owner of a process.<!--more--><\/p>\n<p>We will need to use WMI for this task. The Win32_Process object has a GetOwner() method which returns an object with properties that reflect the identity of the process owner.<\/p>\n<p>[cc lang=\"PowerShell\"]<br \/>\nPS C:\\> (get-wmiobject win32_process -filter \"name='Notepad.exe'\").GetOwner()<\/p>\n<p>__GENUS          : 2<br \/>\n__CLASS          : __PARAMETERS<br \/>\n__SUPERCLASS     :<br \/>\n__DYNASTY        : __PARAMETERS<br \/>\n__RELPATH        :<br \/>\n__PROPERTY_COUNT : 3<br \/>\n__DERIVATION     : {}<br \/>\n__SERVER         :<br \/>\n__NAMESPACE      :<br \/>\n__PATH           :<br \/>\nDomain           : QUARK<br \/>\nReturnValue      : 0<br \/>\nUser             : Jeff<br \/>\n[\/cc]<\/p>\n<p>Here's how you might structure a PowerShell expression:<\/p>\n<p>[cc lang=\"PowerShell\"]<br \/>\nGet-WMIObject win32_Process -computername $Computername  | Foreach {<br \/>\n$owner = $_.GetOwner()<br \/>\n$_ | Add-Member -MemberType \"Noteproperty\" -name \"Owner\" -value $(\"{0}\\{1}\" -f $owner.Domain, $owner.User) -passthru<br \/>\n} | Select Handle,Name,WorkingSetSize,Owner<br \/>\n[\/cc]<\/p>\n<p>Personally, that's a lot to keep re-typing. Although on a side note this would be a good candidate for a format and type extension. Or you could use a script block.<\/p>\n<p>[cc lang=\"PowerShell\"]<br \/>\n$GetOwner={<br \/>\nParam([system.management.managementobject]$wmi)<br \/>\nProcess {<br \/>\n $owner=$_.GetOwner()<br \/>\n $_ | Add-Member -MemberType \"Noteproperty\" -name \"Owner\" -value $(\"{0}\\{1}\" -f $owner.Domain, $owner.User) -passthru<br \/>\n }<br \/>\n}<br \/>\n[\/cc]<\/p>\n<p>The script block takes a WMI object as a piped parameter value. Here's how you might use it:<\/p>\n<p>[cc lang=\"PowerShell\"]<br \/>\nget-wmiobject -class win32_process -computername $computername | &$getowner | Select Name,ProcessID,Path,Owner,<br \/>\n@{Name=\"Computername\";Expression={$_.CSName}}<br \/>\n[\/cc]<\/p>\n<p>Personally, I find remembering to use the invoke operator (&) a bit cumbersome. So why not create a function?<\/p>\n<p>[cc lang=\"PowerShell\"]<br \/>\nFunction Get-ProcessOwner {<\/p>\n<p>[cmdletbinding()]<\/p>\n<p>Param(<br \/>\n[Parameter(Position=0,ValuefromPipeline=$True)]<br \/>\n[ValidateScript({$_.__CLASS -eq \"Win32_Process\"})]<br \/>\n[System.Management.ManagementObject]$Inputobject<br \/>\n)<\/p>\n<p>Begin {<br \/>\n    Write-Verbose \"Starting $($myinvocation.mycommand)\"<br \/>\n}<\/p>\n<p>Process {<br \/>\n Try {<br \/>\n    Write-Verbose (\"Process ID {0} {1}\" -f $_.processID,$_.name)<br \/>\n    $owner=$_.GetOwner()<br \/>\n    if ($owner.user) {<br \/>\n        #did we get a value back?<br \/>\n        $ownername=\"{0}\\{1}\" -f $owner.Domain, $owner.User<br \/>\n        Write-Verbose (\"Adding owner {0}\" -f $ownername)<br \/>\n    }<br \/>\n    else {<br \/>\n        $ownername=$null<br \/>\n    }<br \/>\n }<br \/>\n Catch {<br \/>\n write-warning \"oops\"<br \/>\n    Write-Warning (\"Failed to get an owner for process ID {0} {1}\" -f $_.ProcessID,$_.name)<br \/>\n    $ownername=$NULL<br \/>\n }<br \/>\n Finally {<br \/>\n    $_ | Add-Member -MemberType \"Noteproperty\" -name \"Computername\" -value $_.CSName<br \/>\n    $_ | Add-Member -MemberType \"Noteproperty\" -name \"Owner\" -value $ownername -passthru<br \/>\n }<br \/>\n}<\/p>\n<p>End {<br \/>\n    Write-Verbose \"Ending $($myinvocation.mycommand)\"<br \/>\n}<\/p>\n<p>} #end function<br \/>\n[\/cc]<\/p>\n<p>This is essentially the same code as the script block but with some additional features such as verifying the incoming object win a Win32_Process. To use this function, pipe WMI objects to it.<\/p>\n<p>[cc lang=\"PowerShell\"]<br \/>\nPS C:\\> get-wmiobject win32_process -comp quark | Get-ProcessOwner | Select Name,ProcessID,Path,Owner,Computername<\/p>\n<p>Name         : csrss.exe<br \/>\nProcessID    : 524<br \/>\nPath         : C:\\Windows\\system32\\csrss.exe<br \/>\nOwner        : NT AUTHORITY\\SYSTEM<br \/>\nComputername : QUARK<\/p>\n<p>Name         : wininit.exe<br \/>\nProcessID    : 580<br \/>\nPath         : C:\\Windows\\system32\\wininit.exe<br \/>\nOwner        : NT AUTHORITY\\SYSTEM<br \/>\nComputername : QUARK<br \/>\n...<br \/>\nName         : chrome.exe<br \/>\nProcessID    : 5512<br \/>\nPath         : C:\\Users\\Jeff\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe<br \/>\nOwner        : QUARK\\Jeff<br \/>\nComputername : QUARK<\/p>\n<p>Name         : notepad.exe<br \/>\nProcessID    : 6032<br \/>\nPath         : C:\\Windows\\system32\\notepad.exe<br \/>\nOwner        : QUARK\\Jeff<br \/>\nComputername : QUARK<br \/>\n[\/cc]<\/p>\n<p>The download script has comment based help and an optional alias. One more thing, the function requires administrative credentials. Even using Get-ACL requires an elevated session locally.<\/p>\n<p>Download <a href='http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/08\/Get-ProcessOwner.txt' target='_blank'>Get-ProcessOwner<\/a> and let me know what you think.<\/p>\n<p>Update: I've revised this from the original post removing the Get-ACL references. I don't know what I was thinking, perhaps it was just wishful. Anyway, some of the comments might not make sense because of the edit. The bottom line is use WMI to get the process owner.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been working on my second training course for Train Signal on managing Windows Server 2008 with Windows PowerShell, specifically the lesson on managing processes. I thought I&#8217;d share a little tidbit I worked out. In fact, I hope you&#8217;ll stay tuned for other little goodies over the next several weeks. The training video will&#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":[4,318,9,19],"tags":[320,534,547],"class_list":["post-1625","post","type-post","status-publish","format-standard","hentry","category-powershell","category-train-signal","category-training","category-wmi","tag-get-wmiobkect-get-acl","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>Get Process Owner &#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\/1625\/get-process-owner\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Get Process Owner &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"I&#039;ve been working on my second training course for Train Signal on managing Windows Server 2008 with Windows PowerShell, specifically the lesson on managing processes. I thought I&#039;d share a little tidbit I worked out. In fact, I hope you&#039;ll stay tuned for other little goodies over the next several weeks. The training video will...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/1625\/get-process-owner\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2011-08-25T14:08:01+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2011-08-27T11:24:28+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\\\/1625\\\/get-process-owner\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1625\\\/get-process-owner\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Get Process Owner\",\"datePublished\":\"2011-08-25T14:08:01+00:00\",\"dateModified\":\"2011-08-27T11:24:28+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1625\\\/get-process-owner\\\/\"},\"wordCount\":603,\"commentCount\":3,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"keywords\":[\"Get-WMIObkect. Get-ACL\",\"PowerShell\",\"WMI\"],\"articleSection\":[\"PowerShell\",\"Train Signal\",\"Training\",\"WMI\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1625\\\/get-process-owner\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1625\\\/get-process-owner\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1625\\\/get-process-owner\\\/\",\"name\":\"Get Process Owner &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"datePublished\":\"2011-08-25T14:08:01+00:00\",\"dateModified\":\"2011-08-27T11:24:28+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1625\\\/get-process-owner\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1625\\\/get-process-owner\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1625\\\/get-process-owner\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"PowerShell\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/powershell\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Get Process Owner\"}]},{\"@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":"Get Process Owner &#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\/1625\/get-process-owner\/","og_locale":"en_US","og_type":"article","og_title":"Get Process Owner &#8226; The Lonely Administrator","og_description":"I've been working on my second training course for Train Signal on managing Windows Server 2008 with Windows PowerShell, specifically the lesson on managing processes. I thought I'd share a little tidbit I worked out. In fact, I hope you'll stay tuned for other little goodies over the next several weeks. The training video will...","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1625\/get-process-owner\/","og_site_name":"The Lonely Administrator","article_published_time":"2011-08-25T14:08:01+00:00","article_modified_time":"2011-08-27T11:24:28+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\/1625\/get-process-owner\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1625\/get-process-owner\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Get Process Owner","datePublished":"2011-08-25T14:08:01+00:00","dateModified":"2011-08-27T11:24:28+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1625\/get-process-owner\/"},"wordCount":603,"commentCount":3,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"keywords":["Get-WMIObkect. Get-ACL","PowerShell","WMI"],"articleSection":["PowerShell","Train Signal","Training","WMI"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/1625\/get-process-owner\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1625\/get-process-owner\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1625\/get-process-owner\/","name":"Get Process Owner &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"datePublished":"2011-08-25T14:08:01+00:00","dateModified":"2011-08-27T11:24:28+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1625\/get-process-owner\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/1625\/get-process-owner\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1625\/get-process-owner\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"PowerShell","item":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},{"@type":"ListItem","position":2,"name":"Get Process Owner"}]},{"@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":1687,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1687\/filter-left\/","url_meta":{"origin":1625,"position":0},"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":100,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/100\/more-with-service-uptime\/","url_meta":{"origin":1625,"position":1},"title":"More with Service Uptime","author":"Jeffery Hicks","date":"February 16, 2007","format":false,"excerpt":"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\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":103,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/103\/more-with-process-and-service-uptime\/","url_meta":{"origin":1625,"position":2},"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":1551,"url":"https:\/\/jdhitsolutions.com\/blog\/wmi\/1551\/find-non-system-service-accounts-with-powershell-and-wmi\/","url_meta":{"origin":1625,"position":3},"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":615,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/615\/remote-powershell-performance-comparison\/","url_meta":{"origin":1625,"position":4},"title":"Remote PowerShell Performance Comparison","author":"Jeffery Hicks","date":"April 5, 2010","format":false,"excerpt":"Fellow Windows PowerShell MVP Marco Shaw clued me in on a Microsoft blog post that did a terrific job of comparing, from a performance perspective the different PowerShell 2.0 techniques you can use when managing remote computers. The results are pretty much as I would expect. Cmdlets with a \u2013computername\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":1806,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1806\/wmi-powershell-tricks-for-windows-server\/","url_meta":{"origin":1625,"position":5},"title":"WMI PowerShell Tricks for Windows Server&#8230;","author":"Jeffery Hicks","date":"November 15, 2011","format":false,"excerpt":"WMI PowerShell Tricks for Windows Server Management*My first article for @petri_co_il on WMI PowerShell Tricks http:\/\/bit.ly\/rx1YrD Get-WMIObject - PowerShell Tricks Windows Server Management Get-WMIObject in Windows Powershell makes it easier to utilize Windows Management Instrumentation (WMI) and makes managing windows servers much easier.","rel":"","context":"In &quot;Google Plus&quot;","block_context":{"text":"Google Plus","link":"https:\/\/jdhitsolutions.com\/blog\/category\/google-plus\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1625","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=1625"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1625\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=1625"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=1625"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=1625"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}