question

ccastelan avatar image
0 Votes"
ccastelan asked DSPatrick answered

I need to be able to stop and start the Dhcp Client service

For something I am working on, I need to be able to stop and start the Dhcp Client service. However, when I attempt to do so through elevated command prompt I am greeted with System error 5 has occurred and Access is denied. I believe the error is caused when Windows tries to stop the WinHttpAutoProxySvc since that is one of its dependencies, I am trying this on a windows server 2019 with an administrator account.

What can i do to fix it?

If I go directly to services, the control options for WinHttpAutoProxySvc appear disabled.

96115-image.png


windows-server-2019
image.png (339.4 KiB)
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi,


Just want to confirm the current situations.


Please feel free to let us know if you need further assistance.


Best Regards,
Sunny

0 Votes 0 ·

Hi,

Just checking in to see if the information provided was helpful.

If yes, you may accept useful reply as answer, if not, welcome to feedback.

Best Regards,
Sunny

0 Votes 0 ·
DSPatrick avatar image
0 Votes"
DSPatrick answered DSPatrick commented

You'll need to edit the registry, navigate to
HKLM\System\CurrentControlSet\Services\WinHttpAutoProxySvc
then set the "Start" DWORD to Value = 4 (Disabled) and reboot.

--please don't forget to Accept as answer if the reply is helpful--







· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I don't want to disable it permanently, I want to be able to stop and start again with a PowerShell script

0 Votes 0 ·

Then you may need to add or take ownership of the registry service keys.

--please don't forget to Accept as answer if the reply is helpful--





0 Votes 0 ·
SunnyQi-MSFT avatar image
0 Votes"
SunnyQi-MSFT answered ccastelan commented

Hi,

Thanks for posting in Q&A platform.

Please try make the permission changes in the registry by following the detailed steps to see if the issue can be resolved.

A.

  1. Click Start, click Run, type regedit and click OK

  2. Navigate to the following key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Dhcp

  3. Right click the key DHCP and click Permissions. Click Add, type network service and click OK

Select NETWORKSERVICE and check the Full control box to grant NETWORKSERVICE full control on the DHCP key.

Click OK to apply the changes and to close the window

B.

Also perform the same action on the following key:

  1. Click Start, click Run, type regedit and click OK

  2. Navigate to the following key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TcpIp

  3. Right click the key TcpIp and click Permissions. Click Add, type network service and click OK

  4. Select NETWORKSERVICE and check the Full control box to grant NETWORKSERVICE full control on the TcpIp key.

  5. Click OK to apply the changes and to close the window


And I checked the service WinHttpAutoProxySvc of DHCP client in my environment, the default status is Mamual, attaching the screenshot for your reference:

96236-image.png

Best Regards,
Sunny


If the Answer is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


image.png (99.4 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I already tried but it didn't work

0 Votes 0 ·
DSPatrick avatar image
0 Votes"
DSPatrick answered

Just checking if there's any progress or updates?

--please don't forget to Accept as answer if the reply is helpful--




5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.