Windows server 2012: UAC

Установил я KpyM Telnet/SSH Server сервер Windows server 2012. Всё замечательно. Так как этот SSH сервер  для Windows является бесплатным и OpenSource, убрал запрос ключа, перекомпилировал при помощи Visual studio С++.

 

Всё бы ничего, но вот опечалило то, что если указать в качестве шела, Powershell 3, в конфигурации kts.ini

shell_command                =    «C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoExit -command set-location c:\»

Тогда при попытке к примеру создать новую виртуальную машину(при условии чо роль Hyper-V установлена уже)

new-vm Test_VM

Появляется ругательство, говорящее о том, что не хватает прав или hyper-v не работает и тд… обратитесь к админу.

new-vm : You do not have permission to perform the operation or the Virtual
Machine Management Service is not running on the target computer or
installation has been corrupted. Please run the cmdlet with proper privilege.
Contact your administrator if you believe you should have permission to
perform this operation, but don’t have it yet.
At line:1 char:1+ new-vm
+ ~~~~~~
+ CategoryInfo : PermissionDenied: (:) [New-VM], VirtualizationOp
erationFailedException
+ FullyQualifiedErrorId : AccessDenied,Microsoft.HyperV.PowerShell.Command
s.NewVMCommand

Так как запустить POSH с повышением привилегий у меня не вышло, решением для меня стало отключение UAC.

UAC можно отключить несколькими способами:

1) В реестре

ConsentPromptBehaviorAdmin

EnableLUA

при помощи командной строки:

%windir%\System32\cmd.exe /k %windir%\System32\reg.exe ADD HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f

%windir%\System32\cmd.exe /k %windir%\System32\reg.exe ADD HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v ConsentPromptBehaviorAdmin /t REG_DWORD /d 0 /f

Что бы обратно включит:

%windir%\System32\cmd.exe /k %windir%\System32\reg.exe ADD HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 1 /f

%windir%\System32\cmd.exe /k %windir%\System32\reg.exe ADD HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v ConsentPromptBehaviorAdmin /t REG_DWORD /d 2 /f

2)  При помощи групповых политик.

  1. Computer Configuration -> Windows Settings -> Security Settings -> Local Policies -> Security OptionsIn GPMC, browse to the required GPO which is linked to the domain or OU where the policy wants to apply.
  2. Locate the following policy in the right pane:User Account Control: Behavior of the elevation prompt for administrators in Admin Approval ModeSet its value to Elevate without prompt.
  3. Locate the following policy in the right pane:User Account Control: Detect application installations and prompt for elevationSet its value to Disabled.
  4. Locate the following policy in the right pane:User Account Control: Run all administrators in Admin Approval ModeSet its value to Disabled.
  5. Locate the following policy in the right pane:User Account Control: Only elevate UIAccess applications that are installed in secure locations Set its value to Disabled.

И перезагрузить компьютер!

Как то без отключения UAC, решить свою проблему пока не удалось.

Вот тут есть упоминание отключения запроса на повышение прав, но всё же не все операции будут работать при таком раскладе

Another option to avoid elevation prompts without disabling UAC is to set the security policy, User Account Control: Behavior of the elevation prompt for administrators in Admin Approval Mode to Elevate without prompting. By using this setting, elevation requests are silently approved if the user who is logged on is a member of the Administrators group. This option also leaves PMIE and other UAC features enabled. However, not all operations that require administrative rights request elevation. In this case, some of the user’s programs may be elevated, and some programs may not be elevated. Typically, there is no way to distinguish between these two kinds of programs. For example, most console utilities that require administrative rights expect to be started from an command prompt that is already elevated or from other elevated program. Such utilities merely fail when they are started from a command prompt that is not elevated.

По мотивам http://www.mydigitallife.info

 

Об авторе Alex

Работаю Администратором. В основном Windows. Специализируюсь на Hyper-V, поддержке продуктивных сред и во всём помогает POSH. Малость Sharepoint. Чуть чуть работаю с железом
Запись опубликована в рубрике Hyper-V, Powershell, Windows, Администрирование с метками , . Добавьте в закладки постоянную ссылку.

Добавить комментарий