Home > PowerShell > Get process details using window title:

Get process details using window title:

I came across a incident where I have to kill one of the running MMC(active directory users and computers) as it is not responding properly. I went to task manager and tried killing the process but in vain. I am sure this happens for many of the system administrations and they had to go to the processes tab and find-out the process and kill it. I thought of doing that but I have few more other important MMCs running which I don’t want to disturb.  I looked around for a quick way to find out which MMC process belongs to my “Active Directory Users and Computers” MMC and resulted in this small and power{full | shell} script.
PS C:> Get-Process | where {$_.mainwindowtitle -match “active directory users and computers”}
And to stop/kill that process I used powershell only as it is straight forward from here.

PS C:> Get-Process | where {$_.mainwindowtitle -match “active directory users and computers”} | stop-process

I am done with my task :-)
Happy Learning,
Sitaram Pamarthi
Categories: PowerShell
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>