Configure Windows Server Roles
Example Prompt:
Example Response:
# Check if the DHCP Server role is already installed
$dhcpRole = Get-WindowsFeature -Name DHCP
if ($dhcpRole.Installed -eq $false) {
# Install the DHCP Server role
Install-WindowsFeature -Name DHCP -IncludeManagementTools
Write-Host 'DHCP Server role installed successfully.'
} else {
Write-Host 'DHCP Server role is already installed.'
}
# Configure DHCP Server settings
$dhcpServer = '192.168.1.10' # Replace with your DHCP server IP
$dhcpScopeName = 'MainScope'
$dhcpStartRange = '192.168.1.100'
$dhcpEndRange = '192.168.1.200'
$dhcpSubnetMask = '255.255.255.0'
$dhcpLeaseDuration = '8.00:00:00' # 8 days
# Create a new DHCP scope
Add-DhcpServerv4Scope -Name $dhcpScopeName -StartRange $dhcpStartRange -EndRange $dhcpEndRange -SubnetMask $dhcpSubnetMask -LeaseDuration $dhcpLeaseDuration
# Activate the DHCP scope
Set-DhcpServerv4Scope -ScopeId (Get-DhcpServerv4Scope | Where-Object {$_.Name -eq $dhcpScopeName}).ScopeId -State Active
# Optionally, configure additional DHCP options (e.g., router, DNS servers)
Set-DhcpServerv4OptionValue -ScopeId (Get-DhcpServerv4Scope | Where-Object {$_.Name -eq $dhcpScopeName}).ScopeId -Router '192.168.1.1' -DnsServer '8.8.8.8, 8.8.4.4'
Write-Host 'DHCP configuration completed successfully.'
Related Tasks:
Monitor Server Performance
Example Prompt:
Example Response:
Get-Process | Sort-Object CPU -Descending | Select-Object -First 10
Get-Counter '\Memory\Available MBytes'
Related Tasks:
Implement Security Policies
Example Prompt:
Example Response:
Related Tasks:
Create Backup Strategies
Example Prompt:
Example Response:
Related Tasks:
Diagnose Server Issues
Example Prompt:
Example Response:
chkdsk C: /f /r
sfc /scannow
Related Tasks: