A comprehensive, enterprise-grade PowerShell toolkit for secure VMware WorkspaceONE UEM (Airwatch) administration. This toolkit provides secure credential management, audit logging, compliance reporting, and device lifecycle management for enterprise mobility environments.
Project Board: https://github.com/users/E7H31234L/projects/6
FOR AUTHORIZED ENTERPRISE ADMINISTRATORS ONLY - REQUIRES PROPER UEM CONSOLE ACCESS
This toolkit contains:
- π Enterprise-grade credential management with encryption
- π Comprehensive audit logging for compliance
- π‘οΈ Secure API communication with WorkspaceONE UEM
- π Batch operations with validation and error handling
- π Compliance reporting and security monitoring
- β NEVER use without proper WorkspaceONE UEM authorization
- β NEVER deploy in unauthorized environments
- β NEVER use for personal device management
VMware-WorkspaceONE-UEM-Airwatch/
βββ π§ Modules/
β βββ Airwatch-DeviceManagement.psm1 # Core device operations
β βββ Airwatch-Configuration.psm1 # Secure credential storage
β βββ Airwatch-Logging.psm1 # Audit logging & compliance
βββ π Scripts/
β βββ Initialize-Environment.ps1 # Environment setup
β βββ Batch-DeviceOperations.ps1 # Bulk device management
β βββ Compliance-Reporting.ps1 # Automated reports
βββ π Documentation/
β βββ SECURITY.md # Security guidelines
β βββ API-Reference.md # Complete API documentation
β βββ Deployment-Guide.md # Enterprise deployment guide
βββ π CI/CD/
β βββ security-scans.yml # Security scanning pipeline
β βββ quality-checks.yml # Code quality validation
βββ βοΈ Configuration/
βββ config-template.json # Configuration template
βββ compliance-audit.json # Compliance settings
- PowerShell 5.1+ (PowerShell Core 7+ recommended)
- WorkspaceONE UEM Console access with admin privileges
- API Credentials from UEM console settings
- Windows 10/11 or Windows Server 2016+
- Network access to WorkspaceONE UEM endpoints
# Clone repository
git clone https://github.com/E7H31234L/VMware-WorkspaceONE-UEM-Airwatch.git
cd VMware-WorkspaceONE-UEM-Airwatch
# Import all modules
Import-Module .\Airwatch-DeviceManagement.psm1 -Force
Import-Module .\Airwatch-Configuration.psm1 -Force
Import-Module .\Airwatch-Logging.psm1 -Force
# Initialize secure environment
Initialize-AirwatchEnvironment -ConfigPath ".\config\production.json"
# Test configuration
Test-AirwatchConfiguration -Environment production# Step 1: Configure secure credential storage
Set-AirwatchCredentials `
-Environment production `
-Credential (Get-Credential -Message "WorkspaceONE UEM Production") `
-ApiHost "https://cnXXXX.awmdm.com/api" `
-TokenUrl "https://na.uemauth.vmwservices.com/connect/token" `
-ApiKey "your-api-key" `
-ClientId "your-client-id" `
-ClientSecret "your-client-secret"
# Step 2: Validate configuration
Test-AirwatchConfiguration -Environment production
# Step 3: Enable logging
Initialize-AirwatchLogging -LogPath ".\logs\operations.log" -Level INFO| Feature | Implementation | Security Level |
|---|---|---|
| Credential Encryption | Windows Data Protection API | π Enterprise |
| Input Validation | Device ID format validation | π‘οΈ Comprehensive |
| Secure Communication | TLS 1.3+ with certificate validation | π Encrypted |
| Audit Logging | Tamper-evident structured logs | π Complete |
| Access Control | Role-based and MFA required | π Multi-factor |
| Compliance Tracking | GDPR/CCPA compliant event logging | βοΈ Regulatory |
# Comprehensive device ID validation
Test-AirwatchDeviceId -DeviceId "A1:B2:C3:D4:E5:F6" -SearchBy "MacAddress"
Test-AirwatchDeviceId -DeviceId "123456789012345" -SearchBy "SerialNumber"
Test-AirwatchDeviceId -DeviceId "4901542032375185" -SearchBy "ImeiNumber"
Test-AirwatchDeviceId -DeviceId "abcdef1234567890abcdef1234567890" -SearchBy "Udid"# Structured logging with compliance tracking
Write-AirwatchLog -Message "Device deletion initiated" -Level INFO -Component "DeviceManagement"
Log-AirwatchComplianceEvent -Action "DEVICE_DELETION" -DeviceId "12345" -Success $true# Encrypted credential storage
$credential = Get-AirwatchSecureCredential -Environment production
# Automatic credential caching with 30-minute expiry
# Windows Data Protection API for encryption
# Secure memory cleanup after operations# Remove a single device with validation
Remove-AirwatchDevice -DeviceId "12345" -SearchBy "SerialNumber" -Environment production
# Batch device removal with error handling
"serial1", "serial2", "serial3" | Remove-AirwatchDevice -SearchBy "SerialNumber" -BatchMode -Environment production# Import device list from CSV
$devices = Import-Csv "device-list.csv"
foreach ($device in $devices) {
Remove-AirwatchDevice -DeviceId $device.SerialNumber -SearchBy "SerialNumber" -BatchMode
}# Direct API calls with full error handling
$response = Invoke-AirwatchApiRequest `
-Endpoint "/devices" `
-Method "DELETE" `
-SearchBy "SerialNumber" `
-DeviceId "123456789" `
-Environment production
# Automatic token management and renewal
# Secure header construction with tenant code
# Request/response logging for audit trails# Generate compliance reports
New-AirwatchComplianceReport -Period WEEKLY -OutputPath ".\reports\compliance.json"
# Compliance event tracking
Log-AirwatchComplianceEvent -Action "POLICY_CHANGE" -Success $true -TargetUser "admin@company.com"| Environment | API Host | Auth Endpoint | Region |
|---|---|---|---|
| Production | https://cnXXXX.awmdm.com/api | https://na.uemauth.vmwservices.com/connect/token | North America |
| Staging | https://cnXXXX.awmdm-staging.com/api | https://na.uemauth.vmwservices.com/connect/token | North America |
| EU Production | https://cnXXXX.awmdm.com/api | https://eu.uemauth.vmwservices.com/connect/token | Europe |
| APAC Production | https://cnXXXX.awmdm.com/api | https://apac.uemauth.vmwservices.com/connect/token | Asia Pacific |
| Operation | HTTP Method | Endpoint | Purpose |
|---|---|---|---|
| Device Search | GET | /devices | Find devices by criteria |
| Device Details | GET | /devices/{id} | Get device information |
| Device Delete | DELETE | /devices?searchby={type}&id={id} | Remove device from UEM |
| Device Lock | POST | /devices/{id}/commands | Lock device remotely |
| Device Wipe | POST | /devices/{id}/commands | Full device wipe |
| Profile Assign | POST | /devices/{id}/profiles | Assign compliance profiles |
| Apps Management | GET/POST | /apps | Application deployment |
{
"Version": "2.0",
"Created": "2024-01-24T12:00:00Z",
"Environments": {
"production": {
"ApiHost": "https://cnXXXX.awmdm.com/api",
"TokenUrl": "https://na.uemauth.vmwservices.com/connect/token",
"Username": "uem-admin@company.com",
"IsEncrypted": true,
"Description": "Production WorkspaceONE UEM Environment"
},
"staging": {
"ApiHost": "https://cnXXXX.awmdm-staging.com/api",
"TokenUrl": "https://na.uemauth.vmwservices.com/connect/token",
"Username": "uem-admin@company.com",
"IsEncrypted": true,
"Description": "Staging WorkspaceONE UEM Environment"
}
},
"Security": {
"RequireMultiFactor": true,
"SessionTimeout": 30,
"AuditLogging": true,
"RequireAdminApproval": true,
"MaxConcurrentSessions": 5
},
"Logging": {
"Level": "INFO",
"File": "%USERPROFILE%\\.airwatch\\logs\\operations.log",
"MaxSizeMB": 100,
"RetentionDays": 90,
"StructuredLogging": true
}
}# Override configuration with environment variables
$env:AIRWATCH_CONFIG_PATH = "C:\\WorkspaceONE\\config\\production.json"
$env:AIRWATCH_LOG_LEVEL = "INFO"
$env:AIRWATCH_ENVIRONMENT = "production"
$env:AIRWATCH_COMPLIANCE_DB = "C:\\WorkspaceONE\\compliance\\audit.sqlite"# Enable comprehensive logging
Initialize-AirwatchLogging -LogPath ".\\logs\\realtime.log" -Level DEBUG
# Monitor device operations
$successEvents = Get-EventLog -LogName Application -Source "WorkspaceONE-UEM" | Where-Object { $_.Message -match "successfully" }
$failureEvents = Get-EventLog -LogName Application -Source "WorkspaceONE-UEM" | Where-Object { $_.Message -match "failed|error" }
# Generate compliance metrics
$complianceReport = New-AirwatchComplianceReport -Period DAILY# Configure automated alerting
$securityThresholds = @{
FailedLoginAttempts = 5
BulkDeviceOperations = 50
APIErrorsPerMinute = 10
CredentialUseWithoutMFA = 1
}
# Monitor for security violations
# Automatic escalation to security team
# Integration with SIEM systems- SECURITY.md - Comprehensive security documentation
- API-Reference.md - Complete API documentation
- Best-Practices.md - Enterprise deployment guidelines
- Troubleshooting.md - Common issues and solutions
- WorkspaceONE UEM Administration - Official VMware training
- PowerShell Security Best Practices - Microsoft security guidelines
- Enterprise Mobility Management - Industry best practices
- Compliance Frameworks - GDPR, CCPA, HIPAA guidelines
# Create custom device management workflows
function Remove-CorporateDevices {
param([string[]]$SerialNumbers)
foreach ($serial in $SerialNumbers) {
try {
# Validate corporate device ownership
if (Test-CorporateDevice -SerialNumber $serial) {
Remove-AirwatchDevice -DeviceId $serial -SearchBy "SerialNumber" -Environment production
Log-AirwatchComplianceEvent -Action "CORPORATE_DEVICE_REMOVAL" -DeviceId $serial -Success $true
} else {
Write-AirwatchLog -Message "Non-corporate device rejected: $serial" -Level WARN -Component "CorporatePolicy"
}
}
catch {
Log-AirwatchComplianceEvent -Action "DEVICE_REMOVAL_ERROR" -DeviceId $serial -Success $false -ErrorDetails $_.Exception.Message
}
}
}# Integration with ServiceNow
Invoke-AirwatchApiRequest -Endpoint "/incidents" -Method POST -Body $incidentData | ConvertTo-Json
# Integration with Microsoft Endpoint Manager
$syncData = @{
WorkspaceONEDevices = Get-AirwatchDeviceInventory
EndpointManagerDevices = Get-EndpointManagerDevices
}
Sync-DeviceManagementSystems -Data $syncData
# Integration with SIEM (Splunk example)
$complianceEvents = Get-AirwatchComplianceEvents -StartDate (Get-Date).AddDays(-7)
Send-SplunkEvent -Data $complianceEvents -Index "uem_compliance"| Issue | Solution |
|---|---|
| Authentication failed | Verify API credentials and check system clock sync |
| Device not found | Validate device ID format and search method |
| Network timeout | Check firewall rules and proxy settings |
| Permission denied | Verify user has UEM admin rights and MFA |
| Configuration corrupt | Use backup or reinitialize with Initialize-AirwatchEnvironment |
# Enable debug logging
$env:AIRWATCH_DEBUG = $true
$env:AIRWATCH_LOG_LEVEL = "DEBUG"
# Enable API request/response logging
$env:AIRWATCH_LOG_API_REQUESTS = $true
# Run with verbose output
Import-Module .\Airwatch-DeviceManagement.psm1 -Force -Verbose# Comprehensive system health check
function Test-AirwatchSystemHealth {
Write-Host "π Testing WorkspaceONE UEM system health..."
# Test PowerShell version
if ($PSVersionTable.PSVersion.Major -lt 5) {
Write-Host "β PowerShell version too old: $($PSVersionTable.PSVersion)" -ForegroundColor Red
return $false
}
# Test network connectivity
try {
$response = Invoke-WebRequest -Uri "https://cnXXXX.awmdm.com/api/system/health" -TimeoutSec 10
if ($response.StatusCode -eq 200) {
Write-Host "β
API connectivity test passed" -ForegroundColor Green
}
}
catch {
Write-Host "β API connectivity test failed" -ForegroundColor Red
return $false
}
# Test credential encryption
try {
$testCredential = Get-AirwatchSecureCredential -Environment production
if ($testCredential) {
Write-Host "β
Credential encryption test passed" -ForegroundColor Green
}
}
catch {
Write-Host "β Credential encryption test failed" -ForegroundColor Red
return $false
}
Write-Host "β
All health checks passed" -ForegroundColor Green
return $true
}
# Run health check
Test-AirwatchSystemHealthThis toolkit is designed for:
- β Authorized enterprise administrators with proper WorkspaceONE UEM access
- β Corporate device management in compliance with company policies
- β Regulatory compliance (GDPR, CCPA, HIPAA, SOX)
- β Audit trail maintenance for internal and external audits
- β Security incident response with proper documentation
- π All credentials encrypted using Windows Data Protection API
- π Comprehensive audit logging for all operations
- π Device data handling with privacy-by-design principles
- βοΈ Compliance reporting for regulatory requirements
- ποΈ Secure data retention and deletion policies
PROHIBITED ACTIVITIES:
- β Unauthorized device management
- β Personal device administration without consent
- β Bypass of corporate security policies
- β Data extraction from managed devices
- β Use without proper enterprise authorization
We welcome contributions from enterprise mobility administrators!
# Clone development environment
git clone https://github.com/E7H31234L/VMware-WorkspaceONE-UEM-Airwatch.git
cd VMware-WorkspaceONE-UEM-Airwatch
# Set up development configuration
Initialize-AirwatchEnvironment -ConfigPath ".\config\development.json"
# Run tests
.\tests\Run-All-Tests.ps1- π Security-first development with comprehensive testing
- β Enterprise-grade documentation with examples and best practices
- π§ͺ Automated testing for all functions and edge cases
- π Compliance validation for all regulatory requirements
- π Code review process with security focus
- VMware Support: Official WorkspaceONE UEM technical support
- Enterprise Documentation: VMware knowledge base and community forums
- Security Incidents: enterprise-security@company.com
- Compliance Questions: compliance@company.com
- PowerShell Gallery: Enterprise scripts and modules
- VMware {code}: Community contributions and examples
- Tech Community: WorkspaceONE user community and forums
- GitHub Issues: Bug reports and feature requests
- π Complete credential encryption using Windows Data Protection API
- π‘οΈ Comprehensive input validation and sanitization
- π Structured audit logging with SIEM integration
- π Multi-environment configuration management
- π Automated compliance reporting and monitoring
- π§ Modular PowerShell module architecture
- π Batch operations with error handling and validation
- π Secure API communication with token management
- βοΈ Complete compliance framework (GDPR/CCPA/HIPAA)
- π Basic device deletion script
- π§ Hardcoded credential management
- π Minimal documentation
β οΈ Security limitations and input validation gaps
This project is licensed under the MIT License - see LICENSE file for details.
- VMware Inc. - WorkspaceONE UEM platform and API
- Microsoft - PowerShell security best practices and Data Protection API
- Enterprise Community - Security frameworks and compliance guidelines
- UEM Administrators - Real-world requirements and feedback
Repository URL: https://github.com/E7H31234L/VMware-WorkspaceONE-UEM-Airwatch
Version: v2.0.0 - Enterprise Security Toolkit π
Perfect For:
- π’ Enterprise IT departments managing large device fleets
- π Security teams requiring audit trails and compliance
- π Compliance officers needing regulatory reporting
- π οΈ Managed Service Providers (MSP) serving multiple clients
- π Training organizations teaching UEM administration
FOR AUTHORIZED ENTERPRISE ADMINISTRATORS ONLY - This toolkit manages sensitive corporate mobility infrastructure and requires proper WorkspaceONE UEM console access with multi-factor authentication.
Enterprise-grade security, compliance, and audit capabilities ready for production deployment! π’ππ