applescript “Lock Screen” from another mac on LAN

How can you lock your screen from another Macintosh?

The following applescript will allow you to lock the screen, over the network, from any other macintosh. Just keep in mind, “Remote Apple Events” will probably have to be turned on (System Preferences -> Sharing).

property ipNumber : 'Real IP address here' 
property userName : 'real username here' 
property pasword : 'real password entered here' 
set remMachine to 'eppc://' & userName & ':' & pasword & '@' & ipNumber 
tell application 'Finder' of machine remMachine to do shell script '/System/Library/CoreServices/Menu Extras/User.menu/Contents/Resources/CGSession -suspend'"