20-sep: [automatizacion] Morning routine (Tapo + WoL + AutoLogon + Apertura de pestañas)

This commit is contained in:
juanminsanz
2026-09-20 16:37:53 +02:00
parent 93d402e1d5
commit 983c1a8bae
3 changed files with 85 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
param(
[Parameter(Mandatory=$true, HelpMessage="Introduce la contrasena/PIN de Windows")]
[string]$Password
)
# Detectar usuario actual
$username = $env:USERNAME
$domain = $env:USERDOMAIN
$winlogonPath = "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"
try {
Set-ItemProperty -Path $winlogonPath -Name "AutoAdminLogon" -Value "1"
Set-ItemProperty -Path $winlogonPath -Name "DefaultUserName" -Value $username
Set-ItemProperty -Path $winlogonPath -Name "DefaultPassword" -Value $Password
Set-ItemProperty -Path $winlogonPath -Name "DefaultDomainName" -Value $domain
Write-Host "[OK] AutoLogon habilitado correctamente para $domain\$username." -ForegroundColor Green
Write-Host "Al encenderse, el PC entrara directo a este escritorio sin pedir clave." -ForegroundColor Cyan
} catch {
Write-Host "[ERROR] Necesitas ejecutar este script como Administrador." -ForegroundColor Red
}