0
需要幫助!我想使用powershell
來殺死特定所有者的特定(如:iexplore)運行過程(iexplore可能由許多用戶發起,但我想爲特定用戶殺掉iexplore)。get-wmiobject使用powershell殺死進程
任何人都可以幫助我。提前謝謝。
需要幫助!我想使用powershell
來殺死特定所有者的特定(如:iexplore)運行過程(iexplore可能由許多用戶發起,但我想爲特定用戶殺掉iexplore)。get-wmiobject使用powershell殺死進程
任何人都可以幫助我。提前謝謝。
你可以使用WMI類Win32_Process的
stop-process (gwmi win32_process | ?{$_.getOwner().user -eq "username" -and $_.name -match "iexplore"} | select -expand processid) -WhatIf #remove -whatif to effectively stop the process
感謝您的答覆。當我運行這個,我得到錯誤。 例外調用「GetOwner」:「未找到」 在線:1 char:38 + stop-process(gwmi win32_process |?{$ _。getOwner()。user -eq「gssmboop」 - and $ _。n ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ CategoryInfo:未指定:(:) [],MethodInvocationException + FullyQualifiedErrorId:WMIMethodException –