Suggestions for Scheduled Tasks to call OSQL without hard-coding cleartext password

Posted by Ian Boyd on Server Fault See other posts from Server Fault or by Ian Boyd
Published on 2012-09-13T21:31:43Z Indexed on 2012/09/13 21:39 UTC
Read the original article Hit count: 551

Can anyone think of any techniques where i can have a Windows scheduled task run OSQL, but not have to pass the clear-text password with cleartext password being in the clear? E.g.:

>osql -U iboyd -P BabyBatterStapleCorrect

Assumption: No Windows Authentication (since it's not an option)

i was hoping there was a

>OSQL -encryptPassword "BabyBatterStapleCorrect"
>
> OSQL
> Encrypted password: WWVzIGkgd2FudCB0byByYXBlIGJhYmllcy4gQmlnIHdob29wLiBXYW5uYSBmaWdodCBhYm91dCBpdD8=

And then i could call OSQL with:

>osql -U ian -P WWVzIGkgd2FudCB0byByYXBlIGJhYmllcy4gQmlnIHdob29wLiBXYW5uYSBmaWdodCBhYm91dCBpdD8=

But that's not something Microsoft implemented.

© Server Fault or respective owner

Related posts about sql-server

Related posts about scheduled-task