The demons were of greatest service to Solomon during the erection of the Temple. It came about in this wise: When Solomon began the building of the Temple, it once happened that a malicious spirit snatched away the money and the food of one of the king's favorite pages. This occurred several times, and Solomon was not able to lay hold on the malefactor. The king besought God fervently to deliver the wicked spirit into his hands.
His prayer was granted. The archangel Michael appeared to him, and gave him a small ring having a seal consisting of an engraved stone, and he said to him: "Take, O Solomon, king, son of David, the gift which the Lord God, the highest Zebaot, hath sent unto thee. With it thou shalt lock up all the demons of the earth, male and female; and with their help thou shalt build up Jerusalem. But thou must wear this seal of God; and this engraving of the seal of the ring sent thee is a Pentalpha."
Armed with it, Solomon called up all the demons before him, and he asked of each in turn his or her name, as well as the name of the star or constellation or zodiacal sign and of the particular angel to the influence of which each is subject. One after another the spirits were vanquished, and compelled by Solomon to aid in the construction of the Temple.