Microsoft® Windows® 2000 Scripting Guide
« Previous | Next »
Because processes represent such things as software applications or services, they need to carry out actions on a computer. For example, a process might write data to a particular folder, modify a specific registry key, or connect to a remote computer. The ability of a process to carry out these actions depends on the security context under which the action is attempted. Processes generally run under the security context of the user who started the process. (This user is known as the process owner.) If the user account that owns the process has the appropriate access rights, the action succeeds; if it does not, the action fails.
By identifying the owner of a process, you can tell which account the process is running under. This information can help you:
To retrieve the owner of a process, use the Win32_Process class GetOwner method. GetOwner returns the user account name for the process owner as well as the domain for that user account.
Listing 14.8 contains a script that determines the owner of each process running on a computer. To carry out this task, the script must perform the following steps:
Process Winword.exe is owned by Fabrikam\kmyer.
Listing 14.8 Determining Process Ownership
|
|
Send us your feedback | « Previous | Next » |