Skip to content
TheChatArchiveThe Chat Archive
Claudeclaude-2.0· AnthropicHugging Face Arena Human Preference 55K

Write a Powershell script that checks for a remote computer's certificate that is close…

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with Googlepalm-2’s answer.
  1. User

    Write a Powershell script that checks for a remote computer's certificate that is close to expiration and manually re-enroll that certificate

  2. Claude Assistant

    Here is a Powershell script that checks for a remote computer's certificate that is close to expiration and re-enrolls it:

    $computer = "remotecomputername" 
    
    $cert = Invoke-Command -ComputerName $computer -ScriptBlock {
        Get-ChildItem -Path Cert:\LocalMachine\My | Where-Object {$_.NotAfter -lt (Get-Date).AddDays(30)} | Select-Object -First 1
    }
    
    if($cert) {
        Write-Host "Certificate $($cert.Subject) on $computer expires on $($cert.NotAfter) and will be renewed."
        Invoke-Command -ComputerName $computer -ScriptBlock {
            certutil -pulse
        }
        Write-Host "Certificate renewed successfully on $computer"
    }
    else {
        Write-Host "No certificates expiring within 30 days found on $computer" 
    }
    

    This first gets any certificates on the remote computer that will expire within 30 days. If one is found, it prints a message and re-enrolls the certificate using certutil -pulse. Otherwise it prints a message that no expiring certs were found.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.

Identical first prompt