Jose Mourinho has told Schweinsteiger, 32, he is not part of his plans at Old Trafford.
Khedira, who won the World Cup with Germany alongside Schweinsteiger in 2010, has leapt to the defence of his former skipper.
The Juventus midfielder, 29, said: “It's a warning shot, definitely. I would never be in a situation where a club asks me to go.
“A player with a great career does not deserve that one eventually tells him: 'Hey, get out!'
“I think the situation in Manchester is a shame because Bastian is a player who I have looked up to.
“World Cup 2010 was very important for me. He was the boss. I was young and could play next to him. Later, he was a great captain.
“On the other hand one must also understand the clubs. Football is business. I am not a daydreamer. If Jose Mourinho has other plans, you have to accept that.
“I know from Bastian that both had a good exchange."