Анализ автоматически запускаемх процессов

param($computer="localhost", [switch]$full, [switch]$help)

function funHelp()
{
$helpText=@"
DESCRIPTION:
NAME: DetectStartUpPrograms.ps1 
Displays a listing of programs that automatically start

PARAMETERS: 
-computer    the name of the computer
-full        prints detailed information  
-help        prints help file

SYNTAX:
DetectStartUpPrograms.ps1 -computer munich -full

Displays name, command, location, and user information
about programs that automatically start on a computer 
named munich

DetectStartUpPrograms.ps1 -full

Displays name, command, location, and user information
about programs that automatically start on the local 
computer

DetectStartUpPrograms.ps1 -computer munich 

Displays a listing of programs that automatically start
on a computer named munich

DetectStartUpPrograms.ps1 -help ?

Displays the help topic for the script

"@
$helpText
exit
}

if($help){ "Obtaining help ..." ; funhelp }

if($full)
 { $property = "name", "command", "location", "user" }
else
 { $property = "name" }

Get-WmiObject -Class win32_startupcommand -computername $computer |
Sort-Object -property name  | 
format-list -property $property
0
Голосов пока нет

Оставить комментарий