Lindsay Lohan admitted to violating the terms of her probation in court today … and Los Angeles Superior Court Judge Stephanie Sautner sentenced the troubled actress to 30 days in prison!

She must surrender by November 9th and begin her time without eligibility for house arrest or early release.

Judge Sautner told Lindsay that because she got kicked out of the Downtown Women’s Center in L.A. (where she was supposed to do some community service) and she also refused to attend therapy sessions as required by the court, she must now complete ALL of her community service hours at the L.A. County Morgue, which, fortunately for her, she has been doing (and doing it well) lately.

The judge also gave Lindsay a stern warning that if she doesn’t adhere to the new terms of her probation, a warrant for her arrest willl be issued, and she WILL be sentenced to an additional 270 days in jail.

“These are very strict rules,” Judge Sautner told LiLo. “You don’t have to accept them.”

According to TMZ:

Judge Stephanie Sautner gave Lindsay a strict schedule on completing the rest of her probation — by December 14, she must have completed 12 days at the morgue and 4 psychotherapy sessions. By January 17, another 12 days at morgue and 4 psychotherapy sessions. And so on. Everything must be completed by March 29 — or she goes directly to jail for 270 days.

With these new probation terms, Sautner said she was “putting the keys to the jail in the defendant’s hands.”

Among the terms of her probation include a stipulation that Lindsay is NOT to leave the country. If she completes everything outlined above by March 29th, Lindsay will be allowed to go on with her life.

“If you do this all by March 29th, you just go about your business and obey all laws and all this ends,” the judge told Lindsay.

At the end of the court hearing, Lindsay seemed to be in good spirits. As she walked out of the courtroom, sources say they heard her mumble “Thank God” under hear breath.

Sources in the courtroom also told TMZ that when the judge got off the bench, she said Lindsay “looks good today.”

Due to jail overcrowding, of the 30 days Lindsay Lohan was sentenced to, she will only be required to serve 6 of them.