100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
Samenvatting [Windows System Administration] ITFactory eerste jaar $8.16   Add to cart

Summary

Samenvatting [Windows System Administration] ITFactory eerste jaar

1 review
 147 views  4 purchases
  • Course
  • Institution

Het vak wat je in het tweede semester krijgt op de IT Factory Thomas More, Windows System Administrator. Dit is heel het word document van Powershell Cursus samengevat en verkort tot de essentie!

Last document update: 4 year ago

Preview 10 out of 63  pages

  • April 11, 2020
  • June 1, 2020
  • 63
  • 2019/2020
  • Summary

1  review

review-writer-avatar

By: redwanhr • 1 year ago

avatar-seller
Windows System Admin – tweede
semester
1. INLEIDING............................................................................................................................................................................ 8
ONTWIKKELING IN EEN SHELL................................................................................................................................................................ 8
.NET CORE....................................................................................................................................................................................... 8
POWERSHELL - EDITORS.......................................................................................................................................................................8
2. POWERSHELL IS OBJECT-GEÖRIENTEERD:............................................................................................................................. 9
WAT IS EEN OBJECT?.......................................................................................................................................................................... 9
OBJECT – 2 REDENEN......................................................................................................................................................................... 9
Voorbeeld 1: Get-process.............................................................................................................................................................9
Voorbeeld 2: ipconfig/gip.............................................................................................................................................................9
COMMANDO: “GET-PROCESS”............................................................................................................................................................10
Opties voor 1 object:..................................................................................................................................................................10
Voor meerder objecten..............................................................................................................................................................10
AUTOMATISEREN............................................................................................................................................................................. 10
REMOTE EN LOCAAL DEZELFDE COMMANDO’S GEBRUIKEN........................................................................................................................10
INGEBOUWDE REMOTE BEVEILIGING.....................................................................................................................................................10
UITBREIDBAAR................................................................................................................................................................................. 10
CLOUD MANAGEMENT INTERFACE VOOR AZURE.....................................................................................................................................10
MAKKELIJK AAN TE LEREN VOOR ZOWEL PROGRAMMEURS ALS NIET PROGRAMMEURS....................................................................................11
4. WAT IS ER MET PYTHON..................................................................................................................................................... 11
Het verwarrende is echter wel dat je via Powershell en Python hetzelfde kunt verwezenlijken...............................................11
5. POWERSHELL: CMDLETS..................................................................................................................................................... 11
CMDLETS – NAMING CONVENTION...................................................................................................................................................... 11
Syntax.........................................................................................................................................................................................11
De twee eerste delen moeten steeds voorkomen!.....................................................................................................................11
Mogelijke verbs/werkwoorden zijn:...........................................................................................................................................11
Add, clear, new, set, start, stop, export...................................................................................................................................................11
mogelijke nouns.........................................................................................................................................................................11
Alle mogelijke parameters.........................................................................................................................................................12
argumenten................................................................................................................................................................................12
Placeholders / wildcards............................................................................................................................................................12
cmdlets zonder parameters.......................................................................................................................................................12
6. BASIS CMDLETS BINNEN POWERSHELL............................................................................................................................... 13
CMDLETS OM MEER INFORMATIE VRAGEN............................................................................................................................................. 13
GEDETAILLEERDE HELP.......................................................................................................................................................................13
ONLINE HELP-DOCUMENTEN............................................................................................................................................................... 13
DE -? PARAMETER........................................................................................................................................................................... 13
CMDLET GET-COMMAND....................................................................................................................................................................13
get-command -type cmdlet........................................................................................................................................................13
get-command -type alias...........................................................................................................................................................13
TAB EXPANSION............................................................................................................................................................................... 13
CMDLETS PROCESSEN:....................................................................................................................................................................... 14
6.5 CMDLETS: FILES/FOLDERS............................................................................................................................................................. 14
set-location / cd:........................................................................................................................................................................14
Get-location:..............................................................................................................................................................................14
Pop-location / Push-location:.....................................................................................................................................................14
1 Samenvatting Windows System Administraion – Jeroen Weber

, Get-childitem:.............................................................................................................................................................................15
Permissies:............................................................................................................................................................................................... 15
Parameter................................................................................................................................................................................................ 15
New-item....................................................................................................................................................................................15
Move-item:.................................................................................................................................................................................15
Copy-item:..................................................................................................................................................................................15
Rename-item:.............................................................................................................................................................................15
Remove-item:.............................................................................................................................................................................15
set-content:................................................................................................................................................................................15
Get-content................................................................................................................................................................................16
Add-content...............................................................................................................................................................................16
Clear-content..............................................................................................................................................................................16
Test-path....................................................................................................................................................................................16
CMDLETS: DNS DNS CLIENT MODULE..................................................................................................................................................17
Get-NetAdapter/Netadapter.....................................................................................................................................................17
Get-NetIPAddress:......................................................................................................................................................................17
Get-NetIPConfiguration / GIP:...................................................................................................................................................17
GIP levert:................................................................................................................................................................................................ 17
Set-Netadapter...........................................................................................................................................................................17
Enable-Netadapter, Disable-Netadapter en Restart-Netadapter..............................................................................................17
CMDLETS: DNS -DE DNSCLIENT MODULE.............................................................................................................................................18
DnsClient module.......................................................................................................................................................................18
CMDLETS: CONTROL PANEL................................................................................................................................................................18
Get-ControlPanelItem................................................................................................................................................................18
Cmdlet Rename-Computer:........................................................................................................................................................18
–Force –Restart:.........................................................................................................................................................................18
Get-Help / Set-Help....................................................................................................................................................................18
CMDLETS: SMBSHARE:...................................................................................................................................................................... 19
SmbShare:..................................................................................................................................................................................19
Syntax:..................................................................................................................................................................................................... 19
Remove-smbshare:.....................................................................................................................................................................19
Syntax:..................................................................................................................................................................................................... 19
CMDLETS SMBSHAREACCESS:.............................................................................................................................................................20
Get-SmbShareAccess:.................................................................................................................................................................20
Syntax:..................................................................................................................................................................................................... 20
Grant-SmbShareAccess:.............................................................................................................................................................20
Syntax:..................................................................................................................................................................................................... 20
Revoke-smbshareaccess:...........................................................................................................................................................20
Syntax:..................................................................................................................................................................................................... 20
Block-SmbShareAccess:..............................................................................................................................................................20
Syntax:..................................................................................................................................................................................................... 20
Unblock-SmbShareAccess:.........................................................................................................................................................20
Syntax:..................................................................................................................................................................................................... 20

7. PIPELINING........................................................................................................................................................................ 21
POWER-SHELL IS OBJECT-GEBASEERD....................................................................................................................................................21
VOORBEELD: CMDLET FORMAT-LIST:.................................................................................................................................................... 21
output als een lijst waarbij elke eigenschap op een nieuwe lijn wordt geplaatst.....................................................................21
Voorbeeld:............................................................................................................................................................................................... 21
EIGENSCHAPPEN PIPELINE:................................................................................................................................................................. 21
Eigenschappen...........................................................................................................................................................................21
Hoe?...........................................................................................................................................................................................21
Bijvoorbeeld:..............................................................................................................................................................................21
8. TOEPASSINGEN VAN PIPELINING:....................................................................................................................................... 22


2 Samenvatting Windows System Administraion – Jeroen Weber

, GET-DNSCLIENT:............................................................................................................................................................................. 22
C:\> Get-DnsClient | ? connectionspecificsuffix | Get-NetAdapter...........................................................................................22
Opmerking:.............................................................................................................................................................................................. 22
.................................................................................................................................................................................................... 22
ERRORACTION................................................................................................................................................................................. 23
Opmerking............................................................................................................................................................................................... 23
Opmerking............................................................................................................................................................................................... 23

9. ALIASEN............................................................................................................................................................................. 24
ALIASEN:........................................................................................................................................................................................ 24
= nickname = korte namen voor cmdlets...................................................................................................................................24
2 SOORTEN ALIASEN:........................................................................................................................................................................ 24
Built-in alias................................................................................................................................................................................24
Voorbeeld1:............................................................................................................................................................................................. 24
Voorbeeld2:............................................................................................................................................................................................. 24
User-defined aliassen.................................................................................................................................................................24
ALIASEN BEKIJKEN.............................................................................................................................................................................24
Commando get-alias..................................................................................................................................................................24
Parameters:................................................................................................................................................................................24
definition................................................................................................................................................................................................. 24
name........................................................................................................................................................................................................ 24
DE PROVIDER "ALIAS:":..................................................................................................................................................................... 25
ps-drive alias:........................................................................................................................................................................................... 25
get-childitem............................................................................................................................................................................................ 25
ALIASEN AANMAKEN:........................................................................................................................................................................ 25
set-alias:.....................................................................................................................................................................................25
Voorbeeld:............................................................................................................................................................................................... 25
Opmerking!!:........................................................................................................................................................................................... 25
NEW-ALIAS:..................................................................................................................................................................................... 25
new-alias alias command..........................................................................................................................................................25
FUNCTION:..................................................................................................................................................................................... 25
Je kan geen argumenten via parameters meegeven als je een cmdlet koppelt aan een alias..................................................25
Oplossing:................................................................................................................................................................................................ 25
NA AFSLUITEN SHELL......................................................................................................................................................................... 26
Hoe oplossen?............................................................................................................................................................................26
De alias exporteren/importeren..............................................................................................................................................................26
Power-shell profiles gebruiken................................................................................................................................................................26
alias exporteren/importeren.....................................................................................................................................................26
Hoe exporteren?...................................................................................................................................................................................... 26
Voorbeeld:............................................................................................................................................................................................... 26
Hoe importeren?..................................................................................................................................................................................... 26
Parameter -name:.................................................................................................................................................................................... 26
Voorbeeld:............................................................................................................................................................................................... 26

10. POWERSHELL PROFILES.................................................................................................................................................... 27
WAT IS EEN POWERSHELL PROFILE?.....................................................................................................................................................27
SOORTEN PROFILE FILES:....................................................................................................................................................................27
Je kan echter het Windows Powershell console geheugen herinstalleren bij het opstarten door gebruik te maken van
profielbestanden........................................................................................................................................................................27
$pshome\profile.ps1..................................................................................................................................................................27
$pshome\Microsoft.PowerShell_profile.ps1..............................................................................................................................27
$pshome\ Microsoft.PowerShellISE_profile.ps1........................................................................................................................27
$home\Documents\WindowsPowerShell\profile.ps1...............................................................................................................27
$home\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1...........................................................................27
$home\Documents\WindowsPowerShell\Microsoft.PowerShellISE_profile.ps1......................................................................27
CREËREN VAN DIT PROFIEL................................................................................................................................................................. 28

3 Samenvatting Windows System Administraion – Jeroen Weber

, Stap 1:........................................................................................................................................................................................28
Stap 2:........................................................................................................................................................................................28
Hoe?........................................................................................................................................................................................................ 28
Waarom de parameter -force?................................................................................................................................................................28
Stap 3:........................................................................................................................................................................................28
EXECUTION POLICY:.......................................................................................................................................................................... 28
Er zijn verschillende beveiligingsniveau’s betreffende het uitvoeren van scripts......................................................................28
Mogelijke waardes:....................................................................................................................................................................28
CUSTOMIZING THE POWERSHELL CONSOLE HOST....................................................................................................................................29
Je kan de prompt wijzigen door in je profielbestand zelf een prompt functie in op te nemen................................................................29
Tekstkleur en achtergrondkleur:................................................................................................................................................29
Properties opvragen van een Cmdlet.......................................................................................................................................................29
Mogelijke kleuren? - cmdlet "write-host":.................................................................................................................................29
Aanpassing in de huidige shell:................................................................................................................................................................30
Aanpassing doorvoeren in het profielbestand:........................................................................................................................................30
PACKAGE INSTALLATION CMDLETS........................................................................................................................................................31
Wat is Package Manager?.........................................................................................................................................................31
Alle packages installeren:..........................................................................................................................................................31
Een Package installeren:............................................................................................................................................................31
De lijst met folders kan je raadpegen en aanpassen.................................................................................................................31
Build a new Master PC Image....................................................................................................................................................32
Welke providers kunnen via deze weg beheerd worden...........................................................................................................32
BEHEER VAN MSI-GEÏNSTALLEERDE PROGRAMMA'S MET ONEGET EN PACKAGEMANAGEMENT.......................................................................32
11.OUTPUT FORMATTEREN................................................................................................................................................... 33
INLEIDING:...................................................................................................................................................................................... 33
HOE KOMT HET NU DAT POWERSHELL ENKEL DE "VOLGENS POWERSHELL" BELANGRIJKSTE VELDEN TOONT?......................................................33
FORMATTEREN VAN DE CMDLETS:........................................................................................................................................................33
Mogelijke formatteringscmdlets:...............................................................................................................................................33
Welke eigenschappen worden getoond in de lijst?...................................................................................................................33
WEERGEVEN VAN OBJECTEN IN EEN TABEL -- FORMAT-TABLE:...................................................................................................................34
Werking:.....................................................................................................................................................................................34
Parameters:................................................................................................................................................................................34
WEERGEVEN VAN OBJECTEN IN EEN LIJST -- FORMAT-LIST:.......................................................................................................................34
12. EXPORTEREN VAN OBJECTEN........................................................................................................................................... 35
CONVERTTOHTML:............................................................................................................................................................................35
EXPORT-CSV:.................................................................................................................................................................................. 35
Opmerking:.................................................................................................................................................................................35
13. INPUT EN OUTPUT........................................................................................................................................................... 35
Read-host:..................................................................................................................................................................................35
Write-host..................................................................................................................................................................................35
Write-output:.............................................................................................................................................................................35
14. WERKEN MET OBJECTEN................................................................................................................................................. 36
Voorbeeld:..................................................................................................................................................................................36
Parameters:................................................................................................................................................................................36
Dit cmdlet telt hoeveel lijnen (objecten) er zijn.........................................................................................................................37
where-object..............................................................................................................................................................................38
Eerste Voorbeeld:.......................................................................................................................................................................38
The where-object Operators:.....................................................................................................................................................38
Opbouwen van reguliere expressies:.........................................................................................................................................39
Voorbeelden:........................................................................................................................................................................................... 39
Quantifiers:................................................................................................................................................................................41

4 Samenvatting Windows System Administraion – Jeroen Weber

, Tweede Voorbeeld:....................................................................................................................................................................41
WERKEN MET INDIVIDUELE OBJECTEN -- FOREACH OBJECT.......................................................................................................................43
Voorbeeld 1................................................................................................................................................................................43
Voorbeeld 2................................................................................................................................................................................43
SORTEREN VAN OBJECTEN -- SORT-OBJECT:...........................................................................................................................................43
Bekijk de voorbeelden in de curcus!!!........................................................................................................................................43
INFRASTRUCTURE TESTING..................................................................................................................................................................44
Unit testing.................................................................................................................................................................................45
15. HISTORY........................................................................................................................................................................... 46
INLEIDING HISTORY:..........................................................................................................................................................................46
CMDLET "GET-HISTORY":.................................................................................................................................................................. 46
HERHALING VAN EEN COMMANDO: "INVOKE-HISTORY":..........................................................................................................................46
Opgelet!!:...................................................................................................................................................................................46
Het laatste commando:..............................................................................................................................................................47
Verschil: history - $^................................................................................................................................................................................ 47
CMDLET: "ADD-HISTORY":................................................................................................................................................................ 47
16. VARIABELEN..................................................................................................................................................................... 48
WELKE INFORMATIE?........................................................................................................................................................................ 48
INHOUD BEKIJKEN:............................................................................................................................................................................48
Cmdlet write-output...................................................................................................................................................................48
Variabele neerschrijven + <enter> drukken...............................................................................................................................48
Cmdlet write-host.......................................................................................................................................................................48
VOORAFGEDEFINIEERDE VARIABELEN OF AUTOMATIC VARIABELEN.............................................................................................................49
Doel variabelen $True en $False?..............................................................................................................................................49
toelichting bij enkele variabelen:...............................................................................................................................................49
Voorbeeld variabele OFS:...........................................................................................................................................................49
Voorbeeld variabelen $$ en $^:.................................................................................................................................................50
DATATYPES..................................................................................................................................................................................... 51
Basic Datatypes..........................................................................................................................................................................51
Basic Datatypes zijn:..................................................................................................................................................................51
Boolean:................................................................................................................................................................................................... 51
Byte:......................................................................................................................................................................................................... 51
Char:........................................................................................................................................................................................................ 51
Datetime:................................................................................................................................................................................................. 51
Decimal:................................................................................................................................................................................................... 51
Single: (=float).......................................................................................................................................................................................... 51
Double:.................................................................................................................................................................................................... 51
Integer:.................................................................................................................................................................................................... 52
Long:........................................................................................................................................................................................................ 52
Object:..................................................................................................................................................................................................... 52
String....................................................................................................................................................................................................... 52
DATA-TYPE DEFINIEREN -- EXPLICIET OF IMPLICIET?.................................................................................................................................53
Impliciete definiëring:................................................................................................................................................................53
opmerking 1:............................................................................................................................................................................................ 53
Opmerking 2:........................................................................................................................................................................................... 53
Samengevat:............................................................................................................................................................................................ 53
Expliciete definiëring:.................................................................................................................................................................54
Redenen:.................................................................................................................................................................................................. 54
Impliciete definiëring:.............................................................................................................................................................................. 55
Expliciete definiëring:.............................................................................................................................................................................. 55

17. TFS: WINDOWS FILE & FOLDER SECURITY......................................................................................................................... 56
.............................................................................................................................................................................................. 56
INHERITANCE................................................................................................................................................................................... 56
5 Samenvatting Windows System Administraion – Jeroen Weber

, Security.......................................................................................................................................................................................56
GROEPEN....................................................................................................................................................................................... 56
Impliciete groepen\Special groups:...........................................................................................................................................56
Authenticated users (geverifieerde gebruikers).......................................................................................................................................56
Everyone (iedereen)................................................................................................................................................................................ 56
Interactive (interactief)............................................................................................................................................................................56
Network (netwerk).................................................................................................................................................................................. 56
Anonymous logon.................................................................................................................................................................................... 56
System.................................................................................................................................................................................................... 56
User Account control en ntfs(UAC).............................................................................................................................................57
FILE/FOLDER PERMISSIONS................................................................................................................................................................. 57
NTFS-machtigingen voor een map.............................................................................................................................................57
Niveau 1:.................................................................................................................................................................................................. 57
Niveau 2:.................................................................................................................................................................................................. 57
Niveau 3:.................................................................................................................................................................................................. 57
Niveau 4:.................................................................................................................................................................................................. 57
Opmerking:.............................................................................................................................................................................................. 57
NTFS-machtigingen voor een bestand.......................................................................................................................................58
Let op!...................................................................................................................................................................................................... 58
Niveau 1:.................................................................................................................................................................................................. 58
Niveau 2:.................................................................................................................................................................................................. 58
Niveau 3:.................................................................................................................................................................................................. 58
Niveau 4:.................................................................................................................................................................................................. 58
NTFS-permissies / NTFS - Machtigingen:...................................................................................................................................58
Om NTFS-rechten te kunnen toewijzen......................................................................................................................................58
OVERLAPPING IN DE ACL...................................................................................................................................................................59
CONFLICT TUSSEN GEËRFDE EN OBJECTSPECIFIEKE PERMISSIES...................................................................................................................59
Expliciete permissies..................................................................................................................................................................59
Overgeërfde permissies.............................................................................................................................................................59
FILES COPIEREN OF VERPLAATSEN........................................................................................................................................................ 59
Overerving van de bestanden ingeschakeld:.............................................................................................................................59
Overerving van de bestanden is uitgeschakeld:.........................................................................................................................59
CONFLICT TUSSEN DENY EN ALLOW PERMISSIES......................................................................................................................................59
NTFS-machtigingen weigeren....................................................................................................................................................59
Bij NTFS 2 soorten permissies:...................................................................................................................................................59
Regel...........................................................................................................................................................................................59
OWNERSHIP.................................................................................................................................................................................60
Permissies Owner:......................................................................................................................................................................60
Opmerking:.............................................................................................................................................................................................. 60
Het recht “take ownership”.......................................................................................................................................................60
Dit recht is enkel toegekend aan de administrator..................................................................................................................................60
Opmerking:.............................................................................................................................................................................................. 60
Welke gebruiker(s) geniet(en) extra recht "Take ownership"?..................................................................................................60
Mogelijkheid om defaultwaarde aan te passen.......................................................................................................................................60
Verplaatsen en kopieren:...........................................................................................................................................................60
SHARE LEVEL-SECURITY...................................................................................................................................................................... 61
Mogelijke types sharemachtigingen:.........................................................................................................................................61
Lezen (Read):........................................................................................................................................................................................... 61
Wijzigen (Change):................................................................................................................................................................................... 61
Volledig beheer (Full Control).................................................................................................................................................................. 61
Connecteren met een aangemaakte share:...............................................................................................................................61
Hoe? ........................................................................................................................................................................................................ 61
Verborgen shares:......................................................................................................................................................................61
Probleem: ............................................................................................................................................................................................... 61
Oplossing: ............................................................................................................................................................................................... 61
Nut?......................................................................................................................................................................................................... 61
Hoe?........................................................................................................................................................................................................ 61
6 Samenvatting Windows System Administraion – Jeroen Weber

, Permissies: Verschillen tussen sharing en NFTS.........................................................................................................................62
Sharing + NTFS...........................................................................................................................................................................62
Share-sleutels:......................................................................................................................................................................................... 62
Er bestaan 3 share permissies..................................................................................................................................................................62
NTFS-sloten:............................................................................................................................................................................................. 62
Vermijd de sharing wizard.........................................................................................................................................................62
AUDITING....................................................................................................................................................................................... 63
Bekijken van gebeurtenissen:.....................................................................................................................................................63




7 Samenvatting Windows System Administraion – Jeroen Weber

, 1. Inleiding
Windows is een grafisch besturingssysteem waar je met de muis activiteiten start en stuurt. Om de
interface mooi en opgeruimd te houden, is maar een beperkt aantal functies direct toegankelijk. Voor andere
functies dien je dieper het systeem in te duiken.
PowerShell is de command-line-interface van Windows waar je tekstopdrachten aan het
besturingssysteem geeft. Met Windows PowerShell kun je complexe handelingen aan de hand van commando's
eenvoudiger maken.

ontwikkeling in een shell
Het ultieme doel: "Alles (locaal en remote) kunnen configureren via een command shell".

De shell zelf is geschreven in C#, maar de shell language is gebaseerd op drie verschillende talen: C#, Perl en sh/ksh
(UNIX).

.NET core
.net Core is de eerste versie van het .net Framework dat
PowerShell Version Default Windows
open source is en multi platform is. Het laat je toe om
Versions
dezelfde editor te gebruiken (Visual Studio Code Editor) op
Windows, MAC en Linux. Het .net Core framework zelf is PowerShell 1.0 Windows Server 2008 (*)
ook cross – platform. Je kunt het op MAC , Linux en
Windows draaien. PowerShell 2.0 Windows 7
Powershell - editors Windows Server 2008 R2
Een eerste mogelijkheid is Windows (**)
PowerShell rechtstreeks opstarten via het startscherm
van Windows 10. PowerShell 3.0 Windows 8
Windows Server 2012
Een tweede mogelijkheid is Visual Studio Code
installeren en dit als veelzijdige editor te gebruiken. PowerShell 4.0 Windows 8.1
Deze editor kan je gebruiken als alternatief voor Visual Windows Server 2012 R2
Studio. De editor bevat een aantal addons zodat je Python,
HTML, css, javascript, C sharp, … kunt schrijven. PowerShell 5.0 Windows 10
Een derde mogelijkheid is via de Windows
PowerShell 5.1 Windows 10 Anniversary
Powershell ISE. Dit is de oorspronkelijke powershell
Update
editor.
Windows Server 2016

Powershell 7.0 Windows 10




8 Samenvatting Windows System Administraion – Jeroen Weber

, 2. Powershell is object-geörienteerd:

Wat is een object?
Een object is een representatie/voorstelling van een computergebaseerd persoon, plaats of ding onder de vorm van
een hoeveelheid data.
Objecten hebben methodes om informatie uit of in het object te verkrijgen.
Hiernaast heeft een object eigenschappen (=attributen) die het object beschrijven.
De klasse is de blauwdruk (de originele versie) voor elk object van die klasse. Een specifiek object is dus altijd een
instantie (een soort van kopie) van een bepaalde klasse.

Een collectie is een verzameling van objecten.


Object – 2 redenen
1. De meeste software die op Windows loopt, is zelf object-geörienteerd.
Data zien als objecten wordt dan eenvoudig, mits het grootste deel van het besturingssysteem zelf deze
structuren herkend.
2. cmdlets van Powershell plaintext zouden opleveren als output.
Voorbeeld 1: Get-process
PS C:\> get-process
Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName
i. ------- ------ ----- ----- ----- ------ -- -----------
ii. 39 5 1876 4340 52 11.33 1920 conhost
iii. 31 4 792 2260 22 0.00 2460
iv. 29 4 828 2284 41 0.25 3192 conhost
v. 574 12 1864 3896 43 1.30 316 csrss
vi. 181 13 5892 6348 59 9.14 356 csrss
vii. 306 29 13936 18312 139 4.36 1300 dfsrs


Voorbeeld 2: ipconfig/gip
Binnen Powershell levert echter het cmdlet Get-NetIPConfiguration (gip) een object op.
Wanneer we dit commando uitvoeren, krijgen we een gelijkaardige output als het ipconfig
commando.
Wat is dan het precieze verschil?
Het verschil bevindt zich dieper. Met een object, hebben we onmiddellijk toegang tot de properties
van het object die informatie bevatten.




9 Samenvatting Windows System Administraion – Jeroen Weber

, Commando: “Get-process”
Het cmdlet "get-process" wordt binnen Powershell gebruikt om actieve processen te bekijken.
Output omzetten naar HTML: Get-Process | ConvertTo-HTML | Out-File processes.html

Opties voor 1 object:
1. Ronde haakjes: De waarde van een property kan je opvragen door het object (=output cmdlet) tussen ronde
haakjes te plaatsen, gevolgd door ".naamproperty".
Voorbeeld: (get-process).starttime
2. Toekenning van een variabele: $naamvariable=waarde
Voorbeeld:
$a=get-date
$a.addays(2)
$a.gettype()
3. Via de pipeline: Eerst definieer je van welke objecten de property dient opgevraagd te worden.Vervolgens
stuur je deze objecten via een pipeline door naar het volgende cmdlet.
Voorbeeld: get-process | get-member

Voor meerder objecten
1. Via pipeline Eerst definieer je op welke objecten de methode dient uitgevoerd te worden. Vervolgens stuur
je deze objecten via een pipeline door naar het volgende cmdlet
Voorbeeld: get-process | ForEach-Object {$_.gettype() }
Notepad | stop-process
| get-member


3. Voordelen van Powershell

Automatiseren
Via pipeline commando’s of via powershell scripts kan je taken automatiseren.

Remote en locaal dezelfde commando’s gebruiken
Pipeline commando’s, cmdlets, scripts kan je remote aansturen via een service die geëncrypteerde connecties
toelaat.

Ingebouwde remote beveiliging
Standaard zijn scripts disabled en zijn remote connecties beperkt. Eens we de remote connecties maken via de
WSMAN service zijn die connecties ook beveiligd en geëncrypteerd.
1.3.a.iv. Open Source
Dankzij de .net core ondersteuning op MAC, Windows, Linux en Docker kunnen we Powershell gebruiken op alle
toestellen waar .net core ook beschikbaar is.

Uitbreidbaar
Fabrikanten van software kunnen hun eigen cmdlets maken om de functionaliteit van Powershell uit te breiden.

Cloud management interface voor Azure
Beheer en configuratie van Azure omgevingen gebeurt grotendeels via Powershell




10 Samenvatting Windows System Administraion – Jeroen Weber

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller jeroen_weber. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $8.16. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

78252 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$8.16  4x  sold
  • (1)
  Add to cart