Case
Defiant for anyone other than their teacher

The students in my class are very well behaved for their teacher but any time someone else is in the room watching them they mis behave. How can I better manage this behavior?

Solution #1
Perhaps your students have a lot of respect for you as their teacher, but maybe not the classroom as a whole. Issues like this typically stem from miscommunication in classroom procedures-- try adding a new rule to your classroom procedures involving the respect of everyone in the class including peers, teacher, guest speakers, and so on...
Solution #2
Since the students respond well to their teacher maybe she/he can explain that they must behave the same way for others. If this needs to be enforced as a classroom rule, it's perfectly okay to make some changes to the rules to better address the behavior. Also, if you are the intern for that room, it would be beneficial to come up with your own set of rules so students know your expectations.

making a new rule for when other guests are in the classroom is a good idea.

If I were in this situation, I would exactly do this.

Solution #3
It does sound like they do not have respect for the classroom as a whole but it also sounds like they want attention from new comers that Enter the classroom. My solution would be to provide positive reinforcement when students are displaying desired behavior and discipline or write them if the behavior occurs.
Solution #4
If it is a substitute or intern watching over the class without the teacher present I would begin with going over the rules and expectations and be honest with the kids in the fact that you are not their teacher, but you want to help them just as she does so open yourself up to them by allowing questions or even giving them some personal attention. Students respect their teacher because they have built a relationship and an open safe line of communication, while this doesn't happen overnight students can sniff out a genuine attempt to help and relate to them and will respect the effort and in turn work for a new person if they make the honest effort. This has worked for me with various grade levels when I had to step in place of the teacher.
Solution #5
I would remind them of the classroom expectations and the consequences for breaking the classroom rules. Remind the students their behavior should be as if the teacher is here and the classroom should run the as if she was there. Let them know that you will be recording their behavior and progress for the day so the teacher will know. A lot of the time this will help the student to know they are being monitored for both good and bad behavior.
Solution #6
I would remind them before you leave or when another teacher walks in, to remain silent and be respectful while you are engaging in a conversation with someone else. If you know that you are going to be absent, I would review the classroom rules and procedures and stress about being respectful to the teacher ( not the sub) that is taking your place for the day. Let the students know that the new teacher for the day will follow the same classroom rules and procedures and will hand out consequences. You could also suggest that you will pop in at anytime to see how they are doing. If they do not follow the rules and are disrespectful to the teacher, give them a consequence upfront that they are made aware of. Let the teacher know the consequence so he or she can remind them as well.
Solution #7
As the teacher, I would express that other people coming in and out of the classroom should be shared with the same respect they give the teacher. On top of that, the teacher could explain that their misbehavior makes the teacher look bad. If the class has that level of admiration for their teacher, they will want to behave for the teacher's sake.
Solution #8
If the students seem to respect the teacher, the teacher can emphasize how important it is to him/her that they mirror that same respect to other adults. The classroom rules are the rules of the class whether or not the teacher is present in the room.
Solution #9
Students should be held accountable for their behavior, even when you are not in the classroom. I would create an incentive for students to behave when they have a substitute, such as a desired activity. Students will have to earn the desired activity by behaving collectively for the substitute. If they fail to do so, they will not be rewarded. I would also suggest having the substitute write down names of students who are misbehaving so they can be addressed individually when you return. You could also have students write an apology to the substitute as a consequence.
Solution #10
Take a firm stand and begin to use the techniques your teacher uses to grasp the attention of the children. Once they see you as the teacher, life will be easier for all.
Solution #11
The student might really like the teacher, but not anyone else. As a teacher, I would ask the student to behave for the sake of making me happy as well. Students respond well if they feel someone has confidence in them.