|
|
@@ -44,9 +44,6 @@ export function generateWindowsPassword(length = 16): string {
|
|
|
export function generateUserData(machineGuid: string, adminPassword: string): string {
|
|
|
const script = [
|
|
|
'<powershell>',
|
|
|
- `Set-ItemProperty -Path "HKLM:\\SOFTWARE\\Microsoft\\Cryptography" -Name "MachineGuid" -Value "${machineGuid}"`,
|
|
|
- `net user Administrator '${adminPassword}'`,
|
|
|
- '',
|
|
|
'# Configure GlobalProtect portal registry settings',
|
|
|
'New-Item -Path "HKLM:\\SOFTWARE\\Palo Alto Networks\\GlobalProtect\\PanSetup" -Force | Out-Null',
|
|
|
'Set-ItemProperty -Path "HKLM:\\SOFTWARE\\Palo Alto Networks\\GlobalProtect\\PanSetup" -Name "Portal" -Value "yidingyingecv.lab.gpcloudservice.com"',
|
|
|
@@ -58,6 +55,9 @@ export function generateUserData(machineGuid: string, adminPassword: string): st
|
|
|
'if (-not (Test-Path "C:\\Program Files\\Palo Alto Networks\\GlobalProtect\\PanGPS.exe")) {',
|
|
|
' Start-Process msiexec.exe -ArgumentList \'/i "C:\\Users\\Administrator\\Downloads\\GlobalProtect64.msi" DEFAULTBROWSER=YES /quiet /norestart\' -Wait',
|
|
|
'}',
|
|
|
+ '',
|
|
|
+ `Set-ItemProperty -Path "HKLM:\\SOFTWARE\\Microsoft\\Cryptography" -Name "MachineGuid" -Value "${machineGuid}"`,
|
|
|
+ `net user Administrator '${adminPassword}'`,
|
|
|
'</powershell>',
|
|
|
'<persist>true</persist>',
|
|
|
].join('\n');
|