Nitin_ted
Well-Known Member
- Messages
- 86
- Solutions
- 1
- Reaction score
- 2
- Points
- 8
Hi Guys, my company devices auto installed some certificate that cause them to disable wifi and outlook slowness etc.. After i remove certificate manually users device works fine.
Its stored in below location.
Cerlm-->Certificate-localComputer-->Personal-->certificate folder.
I prepared 1 script. Manually its works fine but when i try to package in Ps1 or add in script i got error "Script for Package:RHB000C1, Program: Delete Cert failed with exit code 1"
# Specify the thumbprint of the certificate to delete
$thumbprint = "93e288fafb4cb3153c6e5d380227b16767d47070"
# Get the certificate from the user's certificate store
$cert = Get-ChildItem -Path Cert:\CurrentUser\My | Where-Object {$_.Thumbprint -eq $thumbprint}
# If the certificate is found, delete it
if ($cert) {
Remove-Item $cert.PSPath
Write-Host "Certificate deleted successfully."
}
else {
Write-Host "Certificate not found."
}
Its stored in below location.
Cerlm-->Certificate-localComputer-->Personal-->certificate folder.
I prepared 1 script. Manually its works fine but when i try to package in Ps1 or add in script i got error "Script for Package:RHB000C1, Program: Delete Cert failed with exit code 1"
# Specify the thumbprint of the certificate to delete
$thumbprint = "93e288fafb4cb3153c6e5d380227b16767d47070"
# Get the certificate from the user's certificate store
$cert = Get-ChildItem -Path Cert:\CurrentUser\My | Where-Object {$_.Thumbprint -eq $thumbprint}
# If the certificate is found, delete it
if ($cert) {
Remove-Item $cert.PSPath
Write-Host "Certificate deleted successfully."
}
else {
Write-Host "Certificate not found."
}