Windows Server Top 200 Interview Questions Appendix A


Appendix A — Top 100 PowerShell Commands for Windows Server Administrators

1. PowerShell Basics and Help — 1 to 10

#PowerShell CommandPurpose
1Get-HelpDisplays help for cmdlets
2Get-CommandLists available commands
3Get-MemberShows properties and methods of an object
4Get-AliasLists PowerShell aliases
5Get-ModuleLists loaded modules
6Import-ModuleImports a PowerShell module
7Get-ExecutionPolicyDisplays the current script execution policy
8Set-ExecutionPolicyChanges the execution policy
9Get-HistoryDisplays command history
10Clear-HistoryClears PowerShell command history

2. System Information — 11 to 20

#PowerShell CommandPurpose
11Get-ComputerInfoDisplays detailed computer information
12Get-CimInstance Win32_OperatingSystemDisplays OS information
13Get-CimInstance Win32_ComputerSystemDisplays computer hardware information
14Get-CimInstance Win32_BIOSDisplays BIOS information
15Get-CimInstance Win32_ProcessorDisplays CPU information
16Get-HotFixLists installed Windows updates
17Get-DateDisplays the current date and time
18Get-TimeZoneDisplays the configured time zone
19Get-UptimeDisplays system uptime
20Restart-ComputerRestarts a local or remote computer

3. Services and Processes — 21 to 30

#PowerShell CommandPurpose
21Get-ServiceLists Windows services
22Start-ServiceStarts a service
23Stop-ServiceStops a service
24Restart-ServiceRestarts a service
25Set-ServiceChanges service configuration
26Get-ProcessLists running processes
27Stop-ProcessTerminates a process
28Start-ProcessStarts an application or process
29Wait-ProcessWaits for a process to stop
30Get-ScheduledTaskLists scheduled tasks

4. Files and Folders — 31 to 40

#PowerShell CommandPurpose
31Get-ChildItemLists files and folders
32Set-LocationChanges the current directory
33New-ItemCreates a file or folder
34Copy-ItemCopies files or folders
35Move-ItemMoves files or folders
36Remove-ItemDeletes files or folders
37Rename-ItemRenames a file or folder
38Get-ContentReads file content
39Set-ContentReplaces file content
40Add-ContentAppends content to a file

5. Networking — 41 to 50

#PowerShell CommandPurpose
41Get-NetIPAddressDisplays IP addresses
42New-NetIPAddressConfigures a new IP address
43Remove-NetIPAddressRemoves an IP address
44Get-NetAdapterLists network adapters
45Enable-NetAdapterEnables a network adapter
46Disable-NetAdapterDisables a network adapter
47Get-NetIPConfigurationDisplays network configuration
48Test-ConnectionTests network connectivity
49Test-NetConnectionTests host and TCP port connectivity
50Resolve-DnsNamePerforms DNS resolution

6. Active Directory — 51 to 65

Requires the Active Directory PowerShell module.

#PowerShell CommandPurpose
51Get-ADUserRetrieves AD users
52New-ADUserCreates an AD user
53Set-ADUserModifies an AD user
54Remove-ADUserDeletes an AD user
55Enable-ADAccountEnables an AD account
56Disable-ADAccountDisables an AD account
57Unlock-ADAccountUnlocks a locked AD account
58Set-ADAccountPasswordResets an AD password
59Get-ADGroupRetrieves AD groups
60New-ADGroupCreates an AD group
61Add-ADGroupMemberAdds members to an AD group
62Remove-ADGroupMemberRemoves members from an AD group
63Get-ADComputerRetrieves AD computer objects
64Get-ADDomainDisplays domain information
65Get-ADForestDisplays forest information

7. DNS and DHCP — 66 to 75

#PowerShell CommandPurpose
66Get-DnsServerZoneLists DNS zones
67Get-DnsServerResourceRecordLists DNS records
68Add-DnsServerResourceRecordACreates an A record
69Remove-DnsServerResourceRecordRemoves a DNS record
70Clear-DnsClientCacheClears the DNS client cache
71Get-DhcpServerv4ScopeLists DHCP scopes
72Add-DhcpServerv4ScopeCreates a DHCP scope
73Get-DhcpServerv4LeaseLists DHCP leases
74Add-DhcpServerv4ReservationCreates a DHCP reservation
75Get-DhcpServerv4FailoverDisplays DHCP failover configuration

8. Windows Server Roles and Features — 76 to 80

#PowerShell CommandPurpose
76Get-WindowsFeatureLists Windows Server roles and features
77Install-WindowsFeatureInstalls roles and features
78Uninstall-WindowsFeatureRemoves roles and features
79Get-WindowsCapabilityLists Windows capabilities
80Add-WindowsCapabilityInstalls a Windows capability

9. Storage and Disk Management — 81 to 90

#PowerShell CommandPurpose
81Get-DiskLists physical disks
82Initialize-DiskInitializes a disk
83Get-PartitionLists partitions
84New-PartitionCreates a partition
85Resize-PartitionResizes a partition
86Get-VolumeLists volumes
87Format-VolumeFormats a volume
88Get-PhysicalDiskLists physical disks used by Storage Spaces
89Get-StoragePoolLists storage pools
90New-StoragePoolCreates a storage pool

10. Logs, Security, Hyper-V and Remote Management — 91 to 100

#PowerShell CommandPurpose
91Get-WinEventReads Windows event logs
92Get-AclDisplays file or registry permissions
93Set-AclChanges permissions
94Get-BitLockerVolumeDisplays BitLocker status
95Get-VMLists Hyper-V virtual machines
96Start-VMStarts a Hyper-V VM
97Stop-VMStops a Hyper-V VM
98Enable-PSRemotingEnables PowerShell remoting
99Enter-PSSessionOpens an interactive remote PowerShell session
100Invoke-CommandExecutes commands on remote computers

Essential PowerShell examples

# Find stopped services
Get-Service | Where-Object Status -eq "Stopped"

# Test whether RDP port 3389 is reachable
Test-NetConnection -ComputerName SRV01 -Port 3389

# Find enabled AD users
Get-ADUser -Filter * -Properties Enabled |
Where-Object Enabled -eq $true

# Find locked AD accounts
Search-ADAccount -LockedOut

# Check installed server roles
Get-WindowsFeature | Where-Object InstallState -eq "Installed"

# Check recent System events
Get-WinEvent -LogName System -MaxEvents 20

# Run a command remotely
Invoke-Command -ComputerName SRV01 -ScriptBlock {
    Get-Service
}


Comments

Popular posts from this blog

How to install VNX Launcher that has embedded java and Firefox

DHCP FAILED APIPA IS USED

Zabbix Server is not working: the information dispaly may not be current