<# .SYNOPSIS Bölüm 03 · Adım 3.3 — Zero-AD WIN11-02 (Cloud-Native Intune) VM Hazırlığı ve Dual-Model Doğrulama .DESCRIPTION Şirket içi AD DNS'inden tamamen bağımsız (DNS 1.1.1.1) WIN11-02 sanal makinesini oluşturmak ve WIN11-01 (Co-Managed) ile WIN11-02 (Cloud-Native Intune) farkını doğrulamak için kullanılır. .EXAMPLE powershell -ExecutionPolicy Bypass -File "D:\Lab\Scripts\03-Deploy-WIN11-02-CloudNative.ps1" #> #Requires -RunAsAdministrator param( [string]$LabRoot = "D:\Lab", [string]$VmName = "WIN11-02", [string]$SwitchName = "Lab-Internal-NAT", [string]$IsoFilter = "*windows_11*.iso" ) $ErrorActionPreference = "Stop" $Win11Iso = (Get-ChildItem "$LabRoot\ISOs" -Filter $IsoFilter -ErrorAction SilentlyContinue | Select-Object -First 1).FullName if (-not $Win11Iso) { throw "$LabRoot\ISOs altında '$IsoFilter' bulunamadı." } $VmDir = Join-Path $LabRoot "VMs\$VmName" $VhdPath = Join-Path $VmDir "$VmName.vhdx" New-Item -ItemType Directory -Path $VmDir -Force | Out-Null if (-not (Test-Path $VhdPath)) { New-VHD -Path $VhdPath -SizeBytes 60GB -Dynamic | Out-Null } if (-not (Get-VM -Name $VmName -ErrorAction SilentlyContinue)) { New-VM -Name $VmName -MemoryStartupBytes 4GB -Generation 2 -VHDPath $VhdPath -SwitchName $SwitchName | Out-Null } Set-VM -Name $VmName -ProcessorCount 4 -DynamicMemory -MemoryMinimumBytes 2GB -MemoryMaximumBytes 4GB -AutomaticCheckpointsEnabled $false Set-VMFirmware -VMName $VmName -EnableSecureBoot On Set-VMKeyProtector -VMName $VmName -NewLocalKeyProtector Enable-VMTPM -VMName $VmName $dvd = Get-VMDvdDrive -VMName $VmName -ErrorAction SilentlyContinue if (-not $dvd) { $dvd = Add-VMDvdDrive -VMName $VmName -Path $Win11Iso -Passthru } Set-VMFirmware -VMName $VmName -FirstBootDevice $dvd Start-VM -Name $VmName vmconnect.exe localhost $VmName Write-Host "[+] $VmName başlatıldı. Kurulum sonrası IP 10.10.20.52/24, Gateway 10.10.20.1, DNS 1.1.1.1 verip Settings -> Access work or school -> Join Microsoft Entra ID ile katılın." -ForegroundColor Green