need some OS information via t-sql

  • Hi all,

    I'm trying to get some OS information that the SQL server is running from, and ideally, I'd like to be able to do it via t-sql

    The information I really need is OS version, registered user that kind of thing..

    I know I can use WMI to get to this, but for some reason I can't connect to any remote machines with WMI (damn infrastructure guys screwing with me again i guess 😉 - if I run the wmi query locally it works just fine.

    So I was hoping theres some kind of script I can run to pull this information, the sql server could be 2000, 2005 or 2008 and needs to work on all 3.

    Another option would be, can I run a WMI query from a t-sql statement on the remote machine?

    My only other option that I can see is to put my monitor program on each server I want to monitor and have it report back to me, that way the WMI runs locally, but that solution is awful and I'm doing my best to avoid it.

    Any help here would be appreciated.

    Thanks

    --------------------------

    I long for a job where my databases dont have any pesky users accessing them 🙂

  • xp_regread?

    Query the registry.

  • hmm.. i didn't know that existed.. let me google it and see what I can find..

    thanks

    --------------------------

    I long for a job where my databases dont have any pesky users accessing them 🙂

  • It only queries locally, so it works for the local host, not remotes.

    However, it will get you lots of stuff if you want it.

  • If i were to connect to my remote machine then issue the command, would it pull back the machine im working from, or the machine im querying?

    --------------------------

    I long for a job where my databases dont have any pesky users accessing them 🙂

  • seems like it reads from the remote machine just nicely.. im running it from an xp machine and im getting windows server 2003 SP2 as the result.. so yeh.. thats exactly what I needed

    Thanks a lot man, really appreciate your help.. and now I know that little bit more 🙂

    --------------------------

    I long for a job where my databases dont have any pesky users accessing them 🙂

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply