# Copy installation script to AD2

$password = ConvertTo-SecureString 'Paper123!@#' -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential('INTRANET\sysadmin', $password)

Write-Host "[INFO] Copying installation script to AD2..."

New-PSDrive -Name AD2 -PSProvider FileSystem -Root "\\192.168.0.6\C$" -Credential $cred | Out-Null

Copy-Item -Path "D:\ClaudeTools\install-agent-on-ad2.ps1" -Destination "AD2:\Temp\install-agent-on-ad2.ps1" -Force

Write-Host "[OK] Script copied to C:\Temp\install-agent-on-ad2.ps1"

Remove-PSDrive -Name AD2

Write-Host ""
Write-Host "[INFO] Installation script is ready on AD2"
Write-Host "Please run the following on AD2 (as Administrator):"
Write-Host "powershell -ExecutionPolicy Bypass -File C:\Temp\install-agent-on-ad2.ps1"
