Category Archives: PowerShell

Guide: Find the Real Windows Process Behind a PID

Here’s a precise worthy guide to help you identify which Windows process is truly using a specific PID (Process ID)


🔍 1. Use Task Manager (Quick View)

  • Press Ctrl + Shift + Esc to open Task Manager.
  • Go to Details tab.
  • Locate the PID column (enable it via right-click on column headers if hidden).
  • Match your target PID to its Image Name (e.g., svchost.exe, chrome.exe).

⚠️ This shows the process name, but not the full command line or parent-child relationships.


🧰 2. Use Command Line (Precise & Scriptable)

A. Find Process by PID

tasklist /FI "PID eq 1234"

Replace 1234 with your actual PID.

B. Get Full Command Line

wmic process where processid=1234 get Caption,Commandline

C. Get Parent Process

wmic process where processid=1234 get ParentProcessId

Then:

tasklist /FI "PID eq <ParentPID>"

🧪 3. Use PowerShell (Editorial Precision)

A. Get Process Info

Get-Process -Id 1234 | Select-Object Name,Id,Path

B. Full Command Line

Get-CimInstance Win32_Process -Filter "ProcessId = 1234" | Select-Object CommandLine

C. Parent Process

(Get-CimInstance Win32_Process -Filter "ProcessId = 1234").ParentProcessId

🧠 4. Use Process Explorer (GUI + Deep Insight)

  • Download from Microsoft Sysinternals.
  • Launch as Administrator.
  • Press Ctrl + F and enter the PID.
  • View full tree, command line, DLLs, handles, and parent-child lineage.

Copy members from one Active directory group to another

How to copy members from security group to distribution groups or the other way around? This is how to copy members from one AD group to another with PowerShell.

In our example, we like to copy the users from the AD group Group-A to another AD group Group-B.

To copy members from one AD group to another will work for all group scopes and group types:

  • Group scope: Domain local / Global / Universal
  • Group type: Security / Distribution

Copy members from one AD group to another with PowerShell

PS C:\> Get-ADGroupMember -Identity "Group-A" | ForEach-Object {Add-ADGroupMember -Identity "Group-B" -Members $_.distinguishedName}