To find the priority of Threads of a process, copy the following script and execute in PowerShell
$timeoutInSeconds = 100;
$processName = "myExecutable.exe"
$processList = Get-WmiObject win32_process | where { $_.ProcessName -eq "$processName" } | select Handle
foreach ($processIds in $processList)
{
$processId = $processIds.Handle
Write-Host "process id = $processId"
}
Disclaimer: Use at your own risk. The author does not take any responsibility for the behavior of this script.
Showing posts with label PowerShell. Show all posts
Showing posts with label PowerShell. Show all posts
Wednesday, July 16, 2014
Kill Remote Process using PowerShell
Here are the steps to kill a process running on remote machine
1. Start PowerShell
2. $processes = Get-WmiObject -class win32_process -ComputerName <name_of_computer> -Filter "Name='notepad.exe'"
3. $x = $processes.terminate()
4. echo $x
Return value should be 0
1. Start PowerShell
2. $processes = Get-WmiObject -class win32_process -ComputerName <name_of_computer> -Filter "Name='notepad.exe'"
3. $x = $processes.terminate()
4. echo $x
Return value should be 0
Saturday, July 20, 2013
PowerShell - PSCredential
You can find the usage of PowerShell PSCredential from my other blog post on MSDN http://blogs.msdn.com/b/koteshb/archive/2010/02/13/powershell-creating-a-pscredential-object.aspx
Subscribe to:
Posts (Atom)