(Firstly write in the swkotor.ini file EnableCheats=1 under Game options)
Take the assingnmentfile of sw-kotor2,
than rightclick on it -> properties, and write in the destination area:
C:\Programme\LucasArts\SWKotOR2\swkotor2.exe +sv_cheats 1
than start game and press [reverse button ] (or however you say it in english
than type in the cheat and confirm with [Enter]