Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9248197
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T09:53:54+00:00 2026-06-18T09:53:54+00:00

The following does simply not work: Remove-DnsServerSigningKey -KeyId $key.KeyId -ZoneName $zonename -Force Where $zonename

  • 0

The following does simply not work:

Remove-DnsServerSigningKey -KeyId $key.KeyId -ZoneName $zonename -Force

Where $zonename is a valid zone, and the key-id exists and is valid.
This command works if i first unsign a zone, but i want to do this just after a resign.

Logic:

  • grab all current zone signing keys
  • Add one new ZSK
  • Resign the zone with the new ZSK
  • Sleep for 3 seconds (just for a grace period)
  • Loop through all previous keys (at this point, the new key is not in the list)
    • Delete previous key

When trying to delete previous keys i get:

Remove-DnsServerSigningKey : Failed to delete the signing key __[Key-ID]__ for the zone __[Key-ID]__ on server __[Server-addr]__ Please check 
extended error for additional details.
At C:\Users\Administrator\Desktop\dnssec.ps1:79 char:13
+             Remove-DnsServerSigningKey -KeyId $key.KeyId -ZoneName $zonename -Fo ...
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (__[Key-Id]__:root/Microsoft/...erverSigningKey) [Remove-DnsServerSigningKey], CimException
    + FullyQualifiedErrorId : WIN32 9119,Remove-DnsServerSigningKey

The code looks like this:

function resign {
    param(
        [string]$zonename
    )
    $zonename + " <- Re-Signing"

    ## Grab all current keys (incl active ones)
    $keys = Get-DnsServerSigningKey -ZoneName $zonename

    $zonename + " <- Creating new ZSK"
    #Add a new ZSK 
    Add-DnsServerSigningKey -ZoneName $zonename -ComputerName 127.0.0.1 -CryptoAlgorithm RsaSha256 -Type ZoneSigningKey

    #Resign the zone with the newly added key 
    Invoke-DnsServerZonesign -ZoneName $zonename –DoResign -Force

    Start-Sleep -s 1

    # After the resign, we delete all previous ZONE signing keys (but keep KSK)
    $zonename + " <- Removing ZSKeys"
    foreach ($key in $keys) {
        if ($key.KeyType -eq "ZoneSigningKey") {
            Remove-DnsServerSigningKey -ComputerName 127.0.0.1 -ZoneName $zonename -KeyId $key.KeyId -Force
        }
    }
}

Notabel might be that if i Unsign the zone completely and run the same delete-keys code, it works. It’s just when resigning a zone that it doesn’t work.
The key i’m trying to delete is of type ZoneSigningKey and not KeySigningKey (verified).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T09:53:54+00:00Added an answer on June 18, 2026 at 9:53 am

    Solved this by, in short, removing the signed zone,
    deleting the old ZSK and keeping the old KSK, generating a new ZSK and signed the zone again.

    Basically i called unsign and sign again within resign.. it’s ugly and not the way it’s intended to work.. but it works..

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I simply could not understand why the following code does not work. What could
I have the following call which simply does not work in ie7 or 8
The following does not work — handleSwipeUpTriple is never called: - (BOOL) application:(UIApplication *)application
I wonder why the following does not work with Visual studio typedef struct {
I am having problem with the following code. Delete function does not work (throws
I need to write a simple program for work that does the following: read
The following does not compile, and I cannot for the life of me see
The following does not compile: class Foo { public: Foo( boost::shared_ptr< Bar > arg
I have the following expression: ^\w(\s(+|-|/|*)\s\w)*$ This simply looks to match a mathematical expression,
It's quite simple, I don't understand why the following does match: preg_match('/\<td valign=top class=bericht\>(.*\s)*<\/td>/',$html,$matches3);

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.