04-oct: fix USERDOMAIN->COMPUTERNAME en tareas (mapeo cuenta fallaba en workgroup/SSH)
This commit is contained in:
@@ -30,7 +30,7 @@ $ScriptPath = Join-Path $PSScriptRoot 'omniroute_watchdog.ps1'
|
|||||||
$PwshExe = Join-Path $env:SystemRoot 'System32\WindowsPowerShell\v1.0\powershell.exe'
|
$PwshExe = Join-Path $env:SystemRoot 'System32\WindowsPowerShell\v1.0\powershell.exe'
|
||||||
$NodeExe = 'C:\Program Files\nodejs\node.exe'
|
$NodeExe = 'C:\Program Files\nodejs\node.exe'
|
||||||
$OmniRouteMjs = Join-Path $env:APPDATA 'npm\node_modules\omniroute\bin\omniroute.mjs'
|
$OmniRouteMjs = Join-Path $env:APPDATA 'npm\node_modules\omniroute\bin\omniroute.mjs'
|
||||||
$UserId = "$env:USERDOMAIN\$env:USERNAME"
|
$UserId = "$env:COMPUTERNAME\$env:USERNAME"
|
||||||
|
|
||||||
Write-Host '== Instalando arranque fiable de OmniRoute ==' -ForegroundColor Cyan
|
Write-Host '== Instalando arranque fiable de OmniRoute ==' -ForegroundColor Cyan
|
||||||
|
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ try {
|
|||||||
$action = New-ScheduledTaskAction -Execute $pwsh -Argument "-WindowStyle Hidden -ExecutionPolicy Bypass -File `"$infra\scripts\morning_routine\arranque_apps.ps1`""
|
$action = New-ScheduledTaskAction -Execute $pwsh -Argument "-WindowStyle Hidden -ExecutionPolicy Bypass -File `"$infra\scripts\morning_routine\arranque_apps.ps1`""
|
||||||
$trigger = New-ScheduledTaskTrigger -AtLogOn -User $env:USERNAME
|
$trigger = New-ScheduledTaskTrigger -AtLogOn -User $env:USERNAME
|
||||||
$settings = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries -StartWhenAvailable -MultipleInstances IgnoreNew
|
$settings = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries -StartWhenAvailable -MultipleInstances IgnoreNew
|
||||||
$principal = New-ScheduledTaskPrincipal -UserId "$env:USERDOMAIN\$env:USERNAME" -LogonType Interactive -RunLevel Limited
|
$principal = New-ScheduledTaskPrincipal -UserId "$env:COMPUTERNAME\$env:USERNAME" -LogonType Interactive -RunLevel Limited
|
||||||
Register-ScheduledTask -TaskName 'MorningRoutine Prolongo' -Action $action -Trigger $trigger -Settings $settings -Principal $principal -Description 'Abre apps al iniciar sesion (migrado a cuenta autologon).' -Force | Out-Null
|
Register-ScheduledTask -TaskName 'MorningRoutine Prolongo' -Action $action -Trigger $trigger -Settings $settings -Principal $principal -Description 'Abre apps al iniciar sesion (migrado a cuenta autologon).' -Force | Out-Null
|
||||||
Write-Output "[OK] MorningRoutine Prolongo registrada."
|
Write-Output "[OK] MorningRoutine Prolongo registrada."
|
||||||
} catch { Write-Output "[ERROR] MorningRoutine: $_" }
|
} catch { Write-Output "[ERROR] MorningRoutine: $_" }
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ $Watchdog = Join-Path $RepoRoot 'omniroute\omniroute_watchdog.ps1'
|
|||||||
$PluginSrc = Join-Path $RepoRoot 'opencode\omniroute-bootstrap.ts'
|
$PluginSrc = Join-Path $RepoRoot 'opencode\omniroute-bootstrap.ts'
|
||||||
$PluginDir = Join-Path $env:USERPROFILE '.config\opencode\plugins'
|
$PluginDir = Join-Path $env:USERPROFILE '.config\opencode\plugins'
|
||||||
$PluginDst = Join-Path $PluginDir 'omniroute-bootstrap.ts'
|
$PluginDst = Join-Path $PluginDir 'omniroute-bootstrap.ts'
|
||||||
$UserId = "$env:USERDOMAIN\$env:USERNAME"
|
$UserId = "$env:COMPUTERNAME\$env:USERNAME"
|
||||||
|
|
||||||
# Monitor de estado (Telegram + correo + Jira)
|
# Monitor de estado (Telegram + correo + Jira)
|
||||||
$TaskMonitor = 'Monitor Estado'
|
$TaskMonitor = 'Monitor Estado'
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ $ErrorActionPreference = 'Stop'
|
|||||||
|
|
||||||
$RepoRoot = Split-Path -Parent $PSScriptRoot
|
$RepoRoot = Split-Path -Parent $PSScriptRoot
|
||||||
$PwshExe = Join-Path $env:SystemRoot 'System32\WindowsPowerShell\v1.0\powershell.exe'
|
$PwshExe = Join-Path $env:SystemRoot 'System32\WindowsPowerShell\v1.0\powershell.exe'
|
||||||
$UserId = "$env:USERDOMAIN\$env:USERNAME"
|
$UserId = "$env:COMPUTERNAME\$env:USERNAME"
|
||||||
|
|
||||||
# Resolver el interprete de Python
|
# Resolver el interprete de Python
|
||||||
$Python = (Get-Command python -ErrorAction SilentlyContinue).Source
|
$Python = (Get-Command python -ErrorAction SilentlyContinue).Source
|
||||||
|
|||||||
Reference in New Issue
Block a user