TestimoX

ComputerX PowerShell Module

Edit on GitHub

Install and use the ComputerX PowerShell module for Windows system inventory, security hardening, and configuration management.

ComputerX PowerShell Module

The ComputerX module provides a broad cmdlet surface for Windows system inventory, security configuration, and hardening. All cmdlets use the Cx noun prefix.

Installation

Install-Module -Name ComputerX -Scope CurrentUser
Import-Module ComputerX

Key Cmdlets by Area

System Inventory

# Operating system details
Get-CxOsInfo

# Computer system information (name, domain, model)
Get-CxComputerSystem

# CPU details
Get-CxProcessor

# Disk information
Get-CxDisk
Get-CxLogicalDisk

# Installed applications
Get-CxInstalledApplication

# Server roles and features
Get-CxServerFeature
Get-CxWindowsOptionalFeature

Security Configuration

# Query password and lockout policy
Get-CxAccountPolicy

# Set minimum password length
Set-CxAccountPolicy -MinimumPasswordLength 14 -PasswordComplexity $true

# Query security options
Get-CxSecurityOption

# List user rights assignments
Get-CxUserRight

# Detect security configuration gaps
Get-CxSecurityGaps

Firewall Management

# Check firewall profile status
Get-CxFirewallProfile

# List firewall rules
Get-CxFirewallRule

# Query firewall logging
Get-CxFirewallLogging

# Set firewall defaults (block inbound, allow outbound)
Set-CxFirewallDefault -Profile Domain -InboundAction Block -OutboundAction Allow

# Configure firewall logging
Set-CxFirewallLogging -Profile Domain -Enabled $true -LogFilePath "C:\Windows\System32\LogFiles\Firewall\pfirewall.log"

Windows Defender

# Check Defender status
Get-CxDefenderStatus

# Enable real-time protection
Set-CxDefenderRealtime -Enabled $true

# Configure MAPS reporting
Set-CxDefenderMapsReporting -Level Advanced

Services

# List all services with status
Get-CxServices

# Configure a service
Set-CxService -Name "W32Time" -StartType Automatic

# Set service recovery actions
Set-CxServiceRecovery -Name "W32Time" -FirstAction Restart -SecondAction Restart

# Restart a service
Restart-CxService -Name "W32Time"

# Query scheduled tasks
Get-CxScheduledTask

Patches and Updates

# Patch summary with age analysis
Get-CxPatchSummary

# Detailed patch information
Get-CxPatchDetails

# Installed updates
Get-CxUpdatesInstalled

# Pending updates
Get-CxUpdatesPending

Audit Policy

# Configure advanced audit policy
Set-CxAuditPolicy -Category "Account Logon" -Subcategory "Credential Validation" -Success Enable -Failure Enable

# Query audit policy options
Get-CxAuditPolicyOption

# Set resource SACLs
Set-CxAuditResourceSacl -ResourceType File -Path "C:\Windows\SYSVOL"

Registry

# Read a registry key
Get-CxRegistryKey -Path "HKLM:\SYSTEM\CurrentControlSet\Services\W32Time\Parameters"

# Read a specific value
Get-CxRegistryValue -Path "HKLM:\SYSTEM\CurrentControlSet\Services\W32Time\Parameters" -Name "Type"

# Set a registry value
Set-CxRegistryValue -Path "HKLM:\SOFTWARE\Policies\Microsoft" -Name "TestValue" -Value 1 -Type DWord

Permissions

# Query file permissions
Get-CxFilePermissions -Path "C:\Windows\SYSVOL"

# Add a file permission
Add-CxFilePermission -Path "C:\Shared" -Identity "CORP\IT-Admins" -Rights FullControl

# Query SMB share permissions
Get-CxSmbShareAcl -ShareName "NETLOGON"

# Query service DACL
Get-CxServices | Select-Object Name, StartType, Status
Add-CxServicePermission -Name "W32Time" -Identity "CORP\ServiceAdmins" -Rights Start,Stop

Network

# Active TCP connections
Get-CxTcpConnection

# NTP configuration
Get-CxNtp

# Configure NTP
Set-CxNtp -Server "time.windows.com" -Type NTP

# RDP settings
Get-CxRdp

Tips

  • Cmdlets work locally by default. Many support -ComputerName for remote targets.
  • Get-CxSecurityGaps provides a quick overview of common misconfigurations on a Windows system.
  • Use Compare-CxSmbSecurity to diff SMB security settings between two machines or baselines.
  • The Export-CxPolToReg and Import-CxPolToRegistry cmdlets bridge GPO POL files and the registry.

Generated Reference