Posts

Lesson -4 : Using Powershell Pipeline

Image
19. Introduction to the Pipeline What is a Pipeline? 👉 A pipeline passes the output of one command as input to another command Command1 | Command2 Simple Meaning 👉 Pipeline = “Take result from one command and send it to the next command”   Basic Example  >>> Get-Process | Sort-Object CPU   What happens: Get-Process → gets all processes Output goes to Sort-Object Processes sorted by CPU Another Example  >>> Get-Service | Where-Object {$_.Status -eq "Running"}   Select Specific Data >>> Get-Process | Select-Object Name, Id PS C:\Windows\System32> Get-Process | Get-Member    TypeName: System.Diagnostics.Process Name                       MemberType     Definition ----                       ----------     ---------- Handles            ...

Lesson -3 : Using the command line for Administration

Image
 General Server Management  >>> Get-ComputerInfo  // same as systeminfo     What is Get-WindowsFeature ? Get-WindowsFeature is a PowerShell cmdlet used to: ✔️ View all Windows Server roles and features ✔️ Check which features are installed or available ✔️ Manage server components It’s part of Windows Server administration tools.   What does Add-Computer do? 👉 It allows you to: Join a PC to an Active Directory domain Move a computer to a different domain Add it to a workgroup What does Remove-Computer do? 👉 It: Disconnects the PC from an Active Directory domain Moves it to a workgroup Requires a restart to complete Remove-Computer -UnjoinDomainCredential (Get-Credential) What does Rename-Computer do? 👉 It: Changes the system (host) name Can be used on local or remote computers Usually requires a restart Rename-Computer -NewName "NewPCName" Restart-Computer -ComputerName <server_name> -Wait -For PowerShell ; Writ...