*742OPINION BY
Before this court are the preliminary objections in the nature of a demurrer filed by the Pennsylvania Department of Corrections (DOC) to the petition for writ of mandamus filed by Jared Hoyt seeking to compel DOC to credit Hoyt for time served.1 We sustain DOC’s preliminary objections and dismiss Hoyt’s petition.
Hoyt, who is currently in DOC’s custody, filed a petition for writ of mandamus in this court’s original jurisdiction. According to the petition, police arrested Hoyt for a drug charge on August 6, 2008, and he was sentenced on March 23, 2010. DOC pre-released Hoyt to the ADAPT Rehabilitation Center (ADAPT) on September 7, 2010. Hoyt spent 61 days at ADAPT and was then transferred to a Community Correctional Center (CCC) on November 8, 2010, where he remained until August 16, 2011. (Pet., ¶¶ 1-2.)
On August 15, 2011, Hoyt violated the State Intermediate Punishment (SIP) program due to his escape and a new drug charge. The escape charge was dropped, and he was returned to DOC’s custody because of his violations of the pre-release condition and the SIP program. (Pet., ¶¶ 3, 5.)
On October 6, 2011, Hoyt was re-sentenced to three to eight years in prison for violating the conditions of the SIP program. Hoyt maintains that DOC has refused to credit him for the time spent at ADAPT and the CCC. Hoyt seeks credit for the period from September 7, 2010, to August 15, 2011. (Pet., ¶¶ 6-7,10.)
DOC filed preliminary objections in the nature of a demurrer.2 Although DOC believes that credit should be given to Hoyt, DOC maintains that it must adhere to the sentencing court’s order, and the sentencing order did not award credit. (Prelim. Obj., ¶¶ 15-16.)
A writ of mandamus is an extraordinary remedy. Taglienti v. Department of Corrections, 806 A.2d 988, 991 (Pa.Cmwlth.2002). “This [cjourt may only issue a writ of mandamus where the petitioner possesses a clear legal right to enforce the performance of a ministerial act or mandatory duty, the defendant possesses a corresponding duty to perform the act, and the petitioner possesses no other adequate or appropriate remedy.” Detar v. Beard, 898 A.2d 26, 29 (Pa.Cmwlth.2006).
Although Hoyt claims that he is entitled to 342 days of credit, the sentencing order is silent as to credit. Hoyt argues that because the sentencing order does not state that he should not be given credit for time served, he should be given credit for time served in DOC’s custody. As stated in Oakman v. Department of Corrections, 903 A.2d 106, 109 (Pa.Cmwlth.2006), DOC must follow the sentencing court’s order. Thus, even where, as here, DOC believes that credit should be given to Hoyt, because the sentencing order did not order credit, DOC cannot award it.3
*743 As stated in McCray v. Department of Corrections, 582 Pa. 440, 450-51, 872 A.2d 1127, 1133 (2005), where a sentencing court does not give an inmate full credit for time served, the inmate’s remedy is in the trial court and through the direct appeal process. According to his petition, Hoyt has filed a petition with the sentencing court. (Pet., ¶ 13.) Because Hoyt has an appropriate and adequate remedy, he has no right to mandamus relief.
Accordingly, we sustain the preliminary objections filed by DOC and dismiss Hoyt’s petition.
ORDER
AND NOW, this 30th day of October, 2013, we hereby sustain the preliminary objections in the nature of a demurrer filed by the Pennsylvania Department of Corrections and dismiss the petition for writ of mandamus filed by Jared Hoyt.