PS: Managing Windows Services

List all services that a service is dependent on on: [5]: Get-Service -Name LanmanWorkstation -DependentServices Status   Name               DisplayName                           ——   —-               ———–                           Running  SessionEnv         Remote Desktop Configuration          Running  Netlogon           Netlogon                              Stopped  Browser            Computer Browser                        This will be helpful in identifying the possible service start up failures due to dependent service unavailability. List all services that depend/require a selected service: [6]: Get-Service -Name LanmanWorkstation -RequiredServices Status   Name               DisplayName                           ——   —-               ———–                           Running  MRxSmb10           SMB 1.x MiniRedirector                Running  NSI                Network Store Interface Service       Running  MRxSmb20           SMB 2.0 MiniRedirector                Running  Bowser             Browser Support Driver                This will be helpful in assessing the impact of […]

Read more

PS: Managing Disks and Space

List all locally installed disks along with their VolumeName, Drive Letter, Total Size and Free size: PS C:> GWMI -query “select * from Win32_LogicalDisk where DriveType =’3′” | ft -auto DeviceID,VolumeName,Size,FreeSpace DeviceID VolumeName        Size   FreeSpace ——– ———-        —-   ——— C:                  53684989952 23350935552 X:       New Volume 53683941376 48905629696 PS C:> Note: use DriveType ‘2’ for “Removable Disk” and ‘4’ for “Network Drive” Refer to Win32_LogicalDisk class document for more details. More to follow…

Read more

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