In Agrabah Aladdin finds Genie in the Cave of Wonders along with the magic carpet.
In Kingdom Hearts Genie becomes one of Sora's summons.
Genie possessed unlimited cosmic powers but was bound into a lamp. And could only use his powers when wished upon by his masters. Even though he may use his powers when out of the lamp, but he doesn't do any world changing things. He is bound by a 3 laws rule. No one knows where these rules come from though, it may have been known when other Genies tried to do them. 1. Genie can't kill anyone. 2. He can't make anyone fall in love. 3. And eh can't revive the dead, nor in the movies can he kill anyone. He might be able to revive the dead but he said that's something he doesn't want to do. Each of his masters have 3 wishes and cannot get anymore.
The Genie first appears in Aladdin where he is released from a magical oil lamp by the titular character in the collapsed Cave of Wonders. After he reveals that he can grant three wishes, he is duped into freeing Aladdin and Abu from the cave without using a wish. At a faraway oasis, the Genie is asked by Aladdin what he would wish for. The Genie admits he would wish for freedom, since he is a prisoner to his lamp and must follow the orders of the lamp's master. After accepting a promise from Aladdin that Aladdin would use the third wish to set the Genie free, the Genie grants Aladdin his first wish: making him a prince so he can marry Jasmine. The Genie goes into hiding after leading a parade to the Agrabah palace. The Genie is released again when Aladdin is shackled, gagged, and thrown off a cliff into the ocean by Jafar's guards. The Genie rescues Aladdin as the second wish after liberally interpreting Aladdin's nodding head. Later, Genie began to lose his respect when he sees that Aladdin has to break his promise by using the wish for Aladdin himself. The Genie's lamp is later stolen and delivered to Jafar by Iago, making Jafar Genie's new master. The Genie has no choice but to grant Jafar's first and second wish to become Sultan of Agrabah and the world's most powerful sorcerer. He is then made a slave with no purpose in life but to entertain the sadistic Jafar by tormenting the former Sultan. During the final fight between Aladdin and Jafar, the Genie is forced to grant Jafar's final wish to become an all-powerful Genie. When Jafar is finally defeated, the Genie disposes of Jafar's lamp. While initially more than willing to sacrifice his freedom in order to allow Aladdin to be with Jasmine (saying, "You're not gonna find another girl like her in a million years. Believe me, I know. I've looked."), Aladdin decides to live up to his original promise and uses his final wish to free Genie from his lamp's power. The now-free Genie leaves Agrabah to explore the world.
In the direct-to-video sequel The Return to Jafar. the Genie returns to Agrabah, deciding that the world isn't all that great without Aladdin and Jasmine around him and that he can't live without them. He is later confronted by the newly-free Jafar in the Palace gardens and imprisoned alongside Abu. After being freed by a morally-confused Iago, the Genie informs Aladdin that the only way to dispose of Jafar permanently is to destroy his lamp before Jafar himself is wished free. The Genie later attempts to discreetly grab Jafar's lamp from Abis Mal but ultimately fails, and assists Aladdin in the final battle against Jafar by shapeshifting into Aladdin in an attempt to distract Jafar while Aladdin grabs his lamp, but this fails as well.
Genie was, before he got his freedom, the most powerful being in the Disney universe shown so far. As shown in the first movie, he could break the laws of nature, shapeshift into virtually anything, elasticity, detachment of limbs, break the fourth wall, fly, warp reality at a whim, lift the palace of Agrabah with no problems, give other people his power, undo the works of any magic, and escape a magically sealed cave. However, he had three limits to his powers;1.He cannot not kill, 2. He cannot make people fall in love with anybody else, and 3. He cannot raise the dead (he says its not a pretty picture and he does NOT LIKE DOING IT). Aside from these three limitations, he is almost omnipotent. After getting his freedom, his powers were reduced, as shown when he failed to lift the palace he had lifted before with ease (he explains that his "phenomenal cosmic powers" were now only "semi-phenomenal nearly-cosmic powers", and Jafar defeated him with almost no effort . However, he still had a unlimited amount of magical knowledge, and all his shapeshifting abilities. He also had high magic power, but was unable to undo any magic, a weakness with disastrous consequences; it is revealed in this film that he can also flawlessly imitate the voices of others, as seen when he shapeshifts into Aladdin in the ultimately failed attempt to distract Jafar while the real Aladdin grabs the latter's lamp. He appears to have gotten stronger in Aladdin and the King of Thieves where he had no problem with anything he tried.