Показать сообщение отдельно
Старый 07.12.2017, 18:36   #2  
vmoskalenko is offline
vmoskalenko
Участник
Аватар для vmoskalenko
 
145 / 334 (12) ++++++
Регистрация: 25.01.2007
Адрес: Toronto
VS
D365Op, верно?

Исходя из предположений:
* Это локальная VM для разработки для одного программиста
* Жизненный цикл такой VM составляет 60-180 дней

Я для себя принял решение внутри этой VM вообще вырубить UAC как класс.
Ну и вот такой скриптик на PowerShell
PHP код:
    #Disable IE Enhanced Security Configuration
    
function Disable-IEESC
    
{
        
$AdminKey “HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}
        $UserKey 
“HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A8-37EF-4b3f-8CFC-4F3A74704073}
        Set
-ItemProperty -Path $AdminKey -Name “IsInstalled” -Value 0
        Set
-ItemProperty -Path $UserKey -Name “IsInstalled” -Value 0
        Stop
-Process -Name Explorer
        Write
-Host “IE Enhanced Security Configuration (ESChas been disabled.” -ForegroundColor Green
    
}
    
Disable-IEESC 
     
    
#Disable UAC
    
Write-Verbose"Disable UAC") -Verbose  # More details here https://www.powershellgallery.com/packages/cEPRSDisableUAC     
    
"$env:SystemRoot\System32\reg.exe" ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v ConsentPromptBehaviorAdmin /t REG_DWORD /d 4 /f
    
"$env:SystemRoot\System32\reg.exe" ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v EnableInstallerDetection /t REG_DWORD /d 1 /f
    
"$env:SystemRoot\System32\reg.exe" ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v EnableLUA /t REG_DWORD /d 0 /f
    gpupdate
     
    
#password age pop up
    
net accounts /maxpwage:unlimited
    
    
#Rename and restart
    
$NewComputerName 'PrjUpd10Valery'
    
$NewComputerNamelength $NewComputerName.Length
    
if($NewComputerNamelength -ge 15)
    {
        
Write-Host "Computer name should be less than 15 symbols. Current length is $NewComputerNamelength symbols. Please update computer name. And repeat last step" -ForegroundColor Red
    
}
    else
    {
        
Rename-Computer -NewName $NewComputerName
        Restart
-Computer   

За это сообщение автора поблагодарили: sukhanchik (2).