بنقرة واحدة
server-overview
Quick system summary including OS, uptime, hardware, and overall health
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Quick system summary including OS, uptime, hardware, and overall health
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Connect to Azure VMs via PowerShell remoting over public IP (HTTPS/5986)
Test connectivity and establish PowerShell remoting sessions to Windows Servers
Inventory installed applications and software on Windows Servers
Check installed Windows Server roles and features
Analyze disk space, volume health, and storage capacity on Windows Servers
Analyze Windows Event Logs for errors, warnings, and critical events
| name | server-overview |
| description | Quick system summary including OS, uptime, hardware, and overall health |
Get a high-level overview of the target Windows Server including hostname, OS version, uptime, last boot time, domain membership, and basic hardware information.
$ServerName = "TARGET_SERVER"
# For current user (default): no credential needed
# For explicit credentials: check if $credential variable exists (user must create BEFORE running gh copilot)
$scriptBlock = {
try {
# Operating System Info
$os = Get-CimInstance -ClassName Win32_OperatingSystem -ErrorAction Stop
# Computer System Info
$cs = Get-CimInstance -ClassName Win32_ComputerSystem -ErrorAction Stop
# BIOS Info
$bios = Get-CimInstance -ClassName Win32_BIOS -ErrorAction Stop
# Calculate uptime
$bootTime = $os.LastBootUpTime
$uptime = (Get-Date) - $bootTime
# Build structured result
[PSCustomObject]@{
Hostname = $cs.Name
FQDN = "$($cs.Name).$($cs.Domain)"
Domain = $cs.Domain
DomainRole = switch ($cs.DomainRole) {
0 { "Standalone Workstation" }
1 { "Member Workstation" }
2 { "Standalone Server" }
3 { "Member Server" }
4 { "Backup Domain Controller" }
5 { "Primary Domain Controller" }
default { "Unknown ($($cs.DomainRole))" }
}
PartOfDomain = $cs.PartOfDomain
OSName = $os.Caption
OSVersion = $os.Version
OSBuild = $os.BuildNumber
OSArchitecture = $os.OSArchitecture
ServicePackMajor = $os.ServicePackMajorVersion
InstallDate = $os.InstallDate
LastBootTime = $bootTime
UptimeDays = [math]::Round($uptime.TotalDays, 2)
UptimeFormatted = "$($uptime.Days)d $($uptime.Hours)h $($uptime.Minutes)m"
Manufacturer = $cs.Manufacturer
Model = $cs.Model
TotalPhysicalRAM_GB = [math]::Round($cs.TotalPhysicalMemory / 1GB, 2)
NumberOfProcessors = $cs.NumberOfProcessors
NumberOfLogicalProc = $cs.NumberOfLogicalProcessors
BIOSVersion = $bios.SMBIOSBIOSVersion
BIOSManufacturer = $bios.Manufacturer
TimeZone = $os.CurrentTimeZone / 60 # Hours from UTC
LocalDateTime = Get-Date
Status = "Online"
}
} catch {
[PSCustomObject]@{
Hostname = $env:COMPUTERNAME
Status = "Error"
Error = $_.Exception.Message
}
}
}
try {
$invokeParams = @{
ComputerName = $ServerName
ScriptBlock = $scriptBlock
ErrorAction = 'Stop'
UseSSL = $true
Port = 5986
SessionOption = (New-PSSessionOption -SkipCACheck -SkipCNCheck)
}
if ($credential) {
$invokeParams['Credential'] = $credential
}
$result = Invoke-Command @invokeParams
# Display results
Write-Host "`n=== Server Overview: $ServerName ===" -ForegroundColor Cyan
Write-Host ""
Write-Host "System Identity:" -ForegroundColor Yellow
Write-Host " Hostname: $($result.Hostname)"
Write-Host " FQDN: $($result.FQDN)"
Write-Host " Domain: $($result.Domain)"
Write-Host " Domain Role: $($result.DomainRole)"
Write-Host ""
Write-Host "Operating System:" -ForegroundColor Yellow
Write-Host " OS: $($result.OSName)"
Write-Host " Version: $($result.OSVersion) (Build $($result.OSBuild))"
Write-Host " Architecture: $($result.OSArchitecture)"
Write-Host " Installed: $($result.InstallDate)"
Write-Host ""
Write-Host "Uptime:" -ForegroundColor Yellow
Write-Host " Last Boot: $($result.LastBootTime)"
Write-Host " Uptime: $($result.UptimeFormatted) ($($result.UptimeDays) days)"
if ($result.UptimeDays -gt 90) {
Write-Host " ⚠ Server has been up for $($result.UptimeDays) days - consider patching/reboot" -ForegroundColor Yellow
} elseif ($result.UptimeDays -lt 1) {
Write-Host " ℹ Recent reboot detected" -ForegroundColor Cyan
}
Write-Host ""
Write-Host "Hardware:" -ForegroundColor Yellow
Write-Host " Manufacturer: $($result.Manufacturer)"
Write-Host " Model: $($result.Model)"
Write-Host " Total RAM: $($result.TotalPhysicalRAM_GB) GB"
Write-Host " Processors: $($result.NumberOfProcessors) physical, $($result.NumberOfLogicalProc) logical"
Write-Host " BIOS: $($result.BIOSManufacturer) $($result.BIOSVersion)"
Write-Host ""
# Return structured object for further processing
$result
} catch {
Write-Error "Failed to get server overview from $ServerName : $($_.Exception.Message)"
}
$ServerName = "TARGET_SERVER"
# For current user (default): no credential needed
# For explicit credentials: check if $credential variable exists (user must create BEFORE running gh copilot)
try {
$result = Invoke-Command -ComputerName $ServerName -Credential $Credential -UseSSL -Port 5986 -SessionOption (New-PSSessionOption -SkipCACheck -SkipCNCheck) -ScriptBlock {
$os = Get-CimInstance Win32_OperatingSystem
$cs = Get-CimInstance Win32_ComputerSystem
[PSCustomObject]@{
Name = $cs.Name
OS = $os.Caption
Build = $os.BuildNumber
Boot = $os.LastBootUpTime
Uptime = [math]::Round(((Get-Date) - $os.LastBootUpTime).TotalDays, 1)
Domain = $cs.Domain
RAM_GB = [math]::Round($cs.TotalPhysicalMemory / 1GB, 1)
}
} -ErrorAction Stop
Write-Host "$($result.Name): $($result.OS) | Up $($result.Uptime)d | $($result.RAM_GB) GB RAM"
$result
} catch {
Write-Warning "Cannot reach $ServerName : $($_.Exception.Message)"
}
| Metric | Good | Warning | Critical |
|---|---|---|---|
| Uptime | 7-60 days | 60-90 days | >90 days or <1 day (frequent reboots) |
| Domain Role | Member Server/DC | Standalone | Wrong role type |
| Install Date | Recent patches | >6 months old | >1 year old |
Uptime Concerns
Domain Membership
OS Version/Build
Hardware
| Finding | Likely Problem | Action |
|---|---|---|
| Uptime >100 days | Missing patches, updates not applied | Schedule maintenance window |
| PartOfDomain = False | Not domain joined | Check network, rejoin domain |
| Recent boot (<1 hour) with errors | System crashed and auto-rebooted | Check event logs for crash dump |
| Old OS build | Unpatched system | Run Windows Update |
| Low RAM with high page file use | Memory pressure | Add RAM or reduce workload |
# Timeout after 30 seconds if server is slow/hung
$ServerName = "TARGET_SERVER"
$job = Start-Job -ScriptBlock {
param($srv)
Invoke-Command -ComputerName $srv -UseSSL -Port 5986 -SessionOption (New-PSSessionOption -SkipCACheck -SkipCNCheck) -ScriptBlock {
Get-CimInstance Win32_OperatingSystem | Select-Object Caption, Version, LastBootUpTime
}
} -ArgumentList $ServerName
if (Wait-Job -Job $job -Timeout 30) {
$result = Receive-Job -Job $job
$result
} else {
Write-Warning "Connection to $ServerName timed out after 30 seconds"
Stop-Job -Job $job
}
Remove-Job -Job $job -Force
Based on overview results, proceed to: