• Hey SQLHammer,

    Thank you for the feedback.

    1. Are you making use of CMS in SQL Server? or merely querying for registered servers?

    I am using a Central Management Server for my environment, that has all my production servers registered in it. I have the CMS registered as a master servers and then all my SQL Servers in the environment registered as target servers, where i push maintenance jobs out to.

    These SQL Servers are all SQL 2008R2 and am using Windows PowerShell ISE, I think its version 1.

    2. I am not sure if the -Append parameter is only specific to a particular version of Powershell? but if i run this script in my working directory, folders are created with csv files for each dump of information I am requesting.

    3. Invoke-Sqlcmd - I think this step is failing because the script has failed at an earlier point of execution and the state in which script was running has become unstable. You may also need to install additional Powershell components in order to interface with SQL Server.

    I am currently working on an update to this script whereby the record set of servers is actually pulled from active directory based on naming standards you use in your environment.

    Thanks again for the feedback 🙂