- 최신
- 최다 투표
- 가장 많은 댓글
Dear Customer , Hope you are doing good!!
The error message "Illegal operation attempted on a registry key that has been marked for deletion" typically indicates an issue with accessing or modifying registry keys during the execution of PowerShell scripts. Here are a few steps you can take to troubleshoot and potentially resolve this issue:
[1] Check Service Dependencies: Ensure that the service you're trying to stop doesn't have dependencies that are preventing it from stopping properly. You can use the Get-Service
cmdlet to check the service dependencies.
[2] Run PowerShell Script Locally : Try running your PowerShell script locally on the EC2 instance to see if you encounter the same error. This can help determine if the issue is specific to running the script remotely.
[3] Use the -Force
Parameter**: When stopping a service with Stop-Service
, you can use the -Force
parameter to forcefully stop the service, which might help bypass any issues related to dependencies or conflicting operations.
[4] Check Permissions: Ensure that the user account running the PowerShell script has the necessary permissions to stop and start services on the system. You may need administrative privileges.
[5] Review System Event Logs : Check the system event logs on the EC2 instance for any relevant error messages or warnings that might provide additional insight into why the service stop operation is failing.
[6]Alternative Methods : If Stop-Service
continues to fail, you can try alternative methods for stopping the service, such as using sc.exe
or net stop
commands directly. Make sure to include error handling in your script to capture any potential errors and debug the issue further.
Thanks and Regards, Damini
관련 콘텐츠
- AWS 공식업데이트됨 일 년 전