And in case you absolutely need user and password not hard coded (eg as command line parmeters of script), note that :

code:
Use $DeviceName $ResourceName /User:$OperatorName /Password:$OperatorPwd 

Works great too ...