PS: Managing Windows Processes

List all manageable properties of Windows Processes: PS C:> GWmi Win32_process | Where-Object {$_.ProcessName -match “notepad2″} ProcessName                : Notepad2.exe Handles                    : 66 VM                         : 83861504 WS                         : 8183808 Path                       : C:tempnotepad2.exe __GENUS                    : 2 __CLASS                    : Win32_Process __SUPERCLASS               : CIM_Process __DYNASTY                  : CIM_ManagedSystemElement __RELPATH                  : Win32_Process.Handle=”4716″ __PROPERTY_COUNT           : 45 __DERIVATION               : {CIM_Process, CIM_LogicalElement, CIM_ManagedSystemElement} __SERVER                   : Test-PC1 __NAMESPACE                : rootcimv2 __PATH                     : \Test-PC1rootcimv2:Win32_Process.Handle=”4716” Caption                    : Notepad2.exe CommandLine                : “C:tempnotepad2.exe” CreationClassName          : Win32_Process CreationDate               : 20110221055250.819087+000 CSCreationClassName        : Win32_ComputerSystem CSName                     : TDI-GOT1027 Description                : Notepad2.exe ExecutablePath             : C:tempnotepad2.exe ExecutionState             : Handle                     : 4716 HandleCount                : 66 InstallDate                : KernelModeTime             : 1560010 […]

Read more

Working with PowerShell Modules

List all installed modules: PS C:>Get-Module -ListAvailable ModuleType Name                      ExportedCommands                                                           ———- —-                      —————-                                                           Manifest   ActiveDirectory           {}                                                                         Manifest   AppLocker                 {}                                                                         Manifest   BitsTransfer              {}                                                                         Manifest   FailoverClusters          {}                                                                         Manifest   GroupPolicy               {}                                                                         Manifest   NetworkLoadBalancingCl… {}                                                                         Manifest   PSDiagnostics             {Enable-PSTrace, Enable-WSManTrace, Start-Trace, Disable-PSWSManCombined… Manifest   TroubleshootingPack       {}                                                                         PS C:> List all snap-ins loaded: PS C:> get-pssnapin | ft -Auto Name                             PSVersion Description                                                                                                         —-                             ——— ———–                                                                                                         Microsoft.PowerShell.Diagnostics 2.0       This Windows PowerShell snap-in contains Windows Eventing and Performance Counter cmdlets.                          Microsoft.WSMan.Management       2.0       This Windows PowerShell snap-in contains cmdlets (such as Get-WSManInstance and Set-WSManInstance) that are used … Microsoft.PowerShell.Core        2.0       This Windows PowerShell snap-in contains cmdlets used to manage components of Windows PowerShell.                   Microsoft.PowerShell.Utility     2.0       This Windows PowerShell snap-in contains utility […]

Read more

Installing new PowerShell Snapin

You need to install new PS snapins as admin user using PoweShell.exe: PS C:> powershell “C:DownloadsSoftwarePowerShellWASPWASPInstall.ps1” -Force You’re running PowerShell 2.0, so you don’t need to Install this as a PSSnapin, you can use Import-Module (or Add-Module in CTP2) to load it.  If you still want to install it as a PSSnapin, re-run this script with -Force Microsoft (R) .NET Framework Installation utility Version 2.0.50727.4927 Copyright (c) Microsoft Corporation.  All rights reserved. Running a transacted installation. Beginning the Install phase of the installation. See the contents of the log file for the C:DownloadsSoftwarePowerShellWASPWASPWASP.dll assembly’s progress. The file is located at […]

Read more