Terminating Process in Terminal Server Environment
Hi,
objProcess.GetOwner should do the job, something like this (strUser
would be an input parameter to the function):
For Each objProcess In objProcesses
lngRet = objProcess.GetOwner(strProcUser, strProcDomain)
If lngRet = 0 Then
If LCase(strProcUser) = LCase(strUser) Then
objProcess.Terminate
End If
End If
Next
--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx
|