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 –