• I use PowerShell in a manner similar to what Shawn posted and probably don't even need it for that but it was convenient because someone posed a loop example that seemed a bit easier than using a DOS FOR command. What I actually use if for tis to get a disk status from all of my servers. I have an xp_CmdShell call that calls PowerShell that loops through the servers I have in a table that issues a WMI command for each server that returns the data to xp_CmdShell output that gets loaded into a table that has computed columns to parse the information and then an INSERT statement to save it all.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)