Execution Policy
PS C:\Users\837853> get-executionpolicy
Unrestricted
Set-ExecutionPolicy [-executionPolicy] Policy
{ Unrestricted | RemoteSigned | AllSigned | Restricted | Default | Bypass | Undefined}
[[-Scope] ExecutionPolicyScope ] [-Force]
[-whatIf] [-confirm]
Ref-
http://ss64.com/ps/set-executionpolicy.html
Enable Remote Managemnt of a System
PS C:\Users\837853> winrm quickconfig
WinRM is not set up to receive requests on this machine.
The following changes must be made:
Set the WinRM service type to delayed auto start.
Start the WinRM service.
Make these changes [y/n]? y
WinRM has been updated to receive requests.
WinRM service type changed successfully.
WinRM service started.
WinRM is not set up to allow remote access to this machine for management.
The following changes must be made:
Create a WinRM listener on HTTP://* to accept WS-Man requests to any IP on this machine.
Enable the WinRM firewall exception.
Make these changes [y/n]? y
WinRM has been updated for remote management.
Created a WinRM listener on HTTP://* to accept WS-Man requests to any IP on this machine.
WinRM firewall exception enabled.
PS C:\Users\837853> winrm quickconfig
WinRM already is set up to receive requests on this machine.
WinRM already is set up for remote management on this machine.
Get Command Help related to Windows Service
PS C:\Users\837853> get-command -noun service
CommandType Name Definition
----------- ---- ----------
Cmdlet Get-Service Get-Service [[-Name] <String[]>] [-ComputerName ...
Cmdlet New-Service New-Service [-Name] <String> [-BinaryPathName] <...
Cmdlet Restart-Service Restart-Service [-Name] <String[]> [-Force] [-Pa...
Cmdlet Resume-Service Resume-Service [-Name] <String[]> [-PassThru] [-...
Cmdlet Set-Service Set-Service [-Name] <String> [-ComputerName <Str...
Cmdlet Start-Service Start-Service [-Name] <String[]> [-PassThru] [-I...
Cmdlet Stop-Service Stop-Service [-Name] <String[]> [-Force] [-PassT...
Cmdlet Suspend-Service Suspend-Service [-Name] <String[]> [-PassThru] [...
Get Status of a Particular Windows Service
PS C:\Users\837853> get-service TestWindowsservice
Status Name DisplayName
------ ---- -----------
Stopped TestWindowsService TestWindowsservice
PS C:\Users\837853> get-service -ComputerName "01hw808400" -Name "TestWindowsservice"
Status Name DisplayName
------ ---- -----------
Stopped TestWindowsService TestWindowsservice
Start of a Particular Windows Service
PS C:\Users\837853> Start-service "TestWindowsService" -Passthru
Status Name DisplayName
------ ---- -----------
Running TestWindowsService TestWindowsService
PS C:\Users\837853> start-service TestWindowsService
Stop a Particular Windows Service
PS C:\Users\837853> stop-service TestWindowsService -Passthru
Status Name DisplayName
------ ---- -----------
Stopped TestWindowsService TestWindowsService
PS C:\Users\837853> stop-service TestWindowsService
Get Date
PS C:\Users\837853> get-date
Tuesday, April 19, 2016 5:26:19 PM
Get Processes in a System
PS C:\Users\837853> get-process
Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName
------- ------ ----- ----- ----- ------ -- -----------
544 18 5244 3508 115 0.59 2440 ac.activclient.gui.scagent
490 15 6160 6628 97 5.62 2264 acevents
69 4 1892 1072 35 0.08 1728 armsvc
1127 28 19636 32828 160 27.71 8392 ccmexec
534 27 28032 24448 237 6.29 9424 CDViewer
259 15 40276 64916 224 13.31 224 chrome
199 11 28668 36224 290 2.40 2492 chrome
258 14 40492 59976 300 7.44 2944 chrome
206 12 43072 59140 217 9.38 3688 chrome
102 5 1248 1060 47 0.11 3832 chrome
153 9 30016 1360 160 1.53 8196 chrome
1432 36 90852 89320 353 176.86 9396 chrome
253 13 37912 50720 315 5.16 9872 chrome
263 14 35356 57028 312 5.82 12136 chrome
198 12 41236 54396 224 4.87 13004 chrome
30 4 2080 260 34 0.02 2224 cmd
26 2 1864 260 21 0.02 4908 cmd
163 75 26368 3728 79 0.19 13496 CmRcService
362 14 11932 3472 168 0.36 6412 concentr
48 5 1248 524 49 0.00 928 conhost
33 2 612 320 24 0.02 1452 conhost
31 2 588 400 24 0.02 2156 conhost
30 4 832 264 21 0.00 5924 conhost
32 2 616 388 24 0.00 6176 conhost
51 5 1312 556 50 0.06 7196 conhost
54 5 2060 1516 50 0.62 10076 conhost
33 4 1020 3188 34 0.02 14012 conhost
157 6 2120 11332 60 0.14 6156 cscript
1462 9 2572 2060 42 4.85 532 csrss
1080 11 2340 4280 41 49.47 608 csrss
1149 56 171724 142092 601 157.78 6372 devenv
269 9 8332 4608 66 2.78 1700 dllhost
190 9 4104 1648 38 0.62 5824 dllhost
70 6 2468 1520 71 0.12 7468 Dserui
455 55 46056 13308 131 104.77 12424 dsSamProxy
178 10 4576 4688 81 3.32 4280 dsSamUI
90 5 1712 1756 51 0.03 7696 dwm
262 77 4092 2056 67 0.48 1808 DWRCS
107 7 1824 1104 58 0.08 7460 DWRCST
650 19 110580 18016 288 60.84 3936 EndPointClassifier
99 6 2236 4572 75 0.14 3284 ErgoCare
1075 42 75924 41020 295 85.25 7760 explorer
160 7 16268 1328 43 0.02 5916 fdhost
76 6 2156 1152 35 0.08 5716 fdlauncher
416 15 25724 13120 123 25.77 1996 FireSvc
450 84 12320 2280 117 30.05 1308 FrameworkService
235 10 19196 4340 136 0.47 164 GoGreenService
156 10 19176 5764 154 0.75 5144 GoGreenTool
133 6 1788 532 51 0.41 7960 GoogleUpdate
239 9 5464 6012 67 9.30 552 HipMgmt
0 0 0 24 0 0 Idle
426 24 28216 23876 145 2.67 8556 iexplore
955 40 43544 40540 275 3.46 11780 iexplore
293 16 5776 2960 97 0.64 3304 JuniperSetupClient
74 6 2372 312 55 0.03 6336 jusched
30 3 1396 932 32 0.00 752 kvoop
40 4 1604 2740 39 0.19 1424 kvoop
30 3 1236 296 32 0.02 1460 kvoop
34 3 1788 2928 37 0.06 2228 kvoop
36 4 1632 2952 40 0.05 2256 kvoop
30 3 1160 268 32 0.00 2260 kvoop
1508 45 10612 10524 51 182.07 664 lsass
252 5 2332 1932 25 22.37 672 lsm
595 15 97012 56276 216 8,203.92 3440 mcshield
326 16 7208 2508 109 0.56 6460 McTray
241 10 4496 1612 63 0.23 2140 mfeann
135 7 2136 1432 38 0.95 3528 mfefire
193 6 4824 4676 52 121.98 1896 mfevtps
215 9 22404 27572 152 0.42 1236 MSBuild
149 9 3604 1080 42 0.11 6112 msdtc
145 9 5064 2564 65 7.24 2416 naPrdMgr
526 20 57836 35324 270 15.82 9484 nlnotes
61 5 1404 5368 60 0.05 7868 notepad
1397 127 229696 127924 854 108.72 7192 notes2
70 4 11908 1084 66 0.03 688 nsd
270 13 28188 7016 186 11.67 9180 ntaskldr
71 4 1740 1240 47 5.21 2680 ntmulti
223 9 12532 2252 134 0.39 2760 PFERemediation
281 12 32184 7828 171 1.37 6256 powershell
398 19 69616 33196 282 100.62 6692 powershell_ise
174 9 13868 13444 154 0.11 13500 PowerShellExecution.vshost
148 6 13300 2092 116 0.17 8112 PresentationFontCache
299 18 8140 6324 142 100.62 5160 Receiver
85 5 1744 552 50 0.70 6440 redirector
22 2 836 248 16 0.02 3752 reg
637 29 99516 32796 651 3.51 2812 ReportingServicesService
32 4 916 2720 40 0.06 13492 scalc
231 46 27532 30864 208 0.41 3508 SCNotification
113 4 3076 6160 39 0.16 12788 SearchFilterHost
1110 35 49676 30500 161 271.36 5900 SearchIndexer
287 6 3072 3536 46 3.78 12540 SearchProtocolHost
263 14 14104 4412 180 0.45 6632 SelfServicePlugin
377 16 7944 5452 48 95.97 648 services
32 1 316 176 3 0.05 344 smss
61 7 1884 4792 64 0.09 7140 soffice
387 32 68912 117332 348 29.20 5384 soffice.bin
406 16 9896 8008 88 9.45 1512 spoolsv
94 6 2064 904 25 0.05 2932 sqlbrowser
522 90 81772 12944 337 648.75 2360 sqlservr
641 97 220912 82664 488 40.84 2576 sqlservr
86 5 2492 1012 31 0.11 2996 sqlwriter
145 11 4296 1828 76 0.16 6512 StikyNot
109 5 2480 1008 62 0.08 1192 SUService
406 8 4708 3240 62 10.55 828 svchost
478 43 5700 4340 52 10.36 908 svchost
537 27 17076 8824 72 123.43 1000 svchost
410 12 115808 106972 208 176.76 1040 svchost
770 24 11508 9800 105 25.55 1064 svchost
2929 49 66356 56656 623 457.27 1096 svchost
604 20 12572 6512 82 22.48 1356 svchost
411 16 6072 5376 47 8.88 1544 svchost
344 26 10948 4444 63 4.24 1584 svchost
98 6 4288 1432 34 0.11 1768 svchost
154 8 4464 1512 36 0.06 2036 svchost
160 7 9528 8428 42 0.59 3324 svchost
312 9 3500 1556 50 0.22 3888 svchost
215 8 5836 4360 57 3.76 5744 svchost
106 15 2508 936 27 0.16 6068 svchost
5750 0 48 1396 4 4 System
101 4 1260 1600 24 0.12 7652 taskeng
268 17 12584 3780 98 1.33 7452 taskhost
181 6 6616 8848 112 0.09 9400 TestWindowsService
993 30 50772 25980 310 11.70 3200 TFSJobAgent
129 9 2952 2504 75 2.64 6284 UdaterUI
344 14 10212 2520 90 2.50 1628 vstskmgr
308 14 14984 5140 111 143.93 3348 wepsvc
366 17 7924 6488 119 1.12 1160 wfcrun32
714 32 62684 44288 245 37.38 13640 wfica32
83 12 956 344 33 0.12 596 wininit
112 4 2244 404 40 0.37 756 winlogon
138 7 6248 9664 39 0.61 1412 WmiPrvSE
335 11 17508 13076 117 40.12 6276 WmiPrvSE
315 8 8084 10228 54 7.85 7928 WmiPrvSE
125 5 2204 2704 27 0.06 7932 WmiPrvSE
138 6 6680 6144 42 3.71 13276 WmiPrvSE
227 11 3512 2860 86 10.16 5516 wscript
193 4 1288 1684 27 0.33 784 WUDFHost