Setting author when creating a new node via Cron
You have two options.

Either set the uid after the node_object_prepare call and before node_save, or you can set $node-&gt;name to the username of the user that should be the author.

The reason is that node_submit will set the uid of the node based on the value of $node-&gt;name if set and node_object_prepare will always set author to the current user.