SSIS & WMI Data Reader Task Query

  • Hi Dave,

    I know this is a very old post but this is exactly what I want and I have also created my package almost similar to the one you have explained in your posts and your SSIS & WMI Data Reader

    Task Query article. The difference is that I am assigning the Connection String dynamically with the credentials.

    My connection string looks exactly like you have explained

    ServerName=\\123.12.123.12;Namespace=\root\cimv2;UseNtAuth=False;UserName=user_name;PassWord=pwd;. And I pass the @User::StringConnString variable to the ConnectionString property of the WMI connection.

    I get an "Access Denied" message for every server except my local machine when I try to use the WMI Data Reader Task in an FELC.

    I tested out the package without the FELC trying each server at a time to make sure my connection string is of the correct format. I get the statistics for 2 of the servers and my local machine, but an "Access Denied" message for all other servers and a machine in the same network as mine where I was given administrative access.

    I really do not understand where the error really is and what settings I need to check for on all the other servers where I get the error. I see in your package that you mention of a bug in SSIS and a solution if we try to use a dynamic connection string. I do not know if I understand it correctly. If my Server Computer Name is "SQLDBSERVER" and the network is domain.network.org, should my ConnectionString property now look like this "\\\\SQLDBSERVER.domain.network.org" + @[User::ServerConnString]?

    Your article was of great help to solve many issues I had with the FELC. Hope to hear from you soon. Thanks in advance.

    Vinesh

  • Hi Vinesh,

    I have test the connection for connections that do not use Windows Authentication and found 2 things:

    1. Despite that fact that you are specifying the servername in the connection string, when you define the user name, you need to put in the machine name prior to the user name.

    2. If fail to add in ";" after the password - then BIDS will fail to evalute the expression.

    so as an example you connection string expression should look something like this if your server was called SQLDBSERVER.domain.network.org:

    "ServerName=\\\\" + @[User::ServerConnString] + ";Namespace=\\root\\cimv2;UseNtAuth=False;UserName=SQLDBSERVER\\MyUserName;Password=MyPassword;"

    so the connection string used would be

    ServerName=\\SQLDBSERVER.domain.network.org;Namespace=\root\cimv2;UseNtAuth=False;UserName=SQLDBSERVER\MyUserName;PassWord=MyPassword;

    If you are using local accounts for each machine, then perhaps you may want to think about storing the user name and passwords in SQL server (in the server list table), and pulling those in as extra variables..........

    Personally, I would recommend going down the Windows Authentication route, and using a domain priviledged credential to run the job in sql server, rather than storing username & passwords with admin rights in sql server tables.

    Let me know how you get on

    _____________________________________________________________________________MCITP: Business Intelligence Developer (2005)

  • Hi all,

    I have just created this package, and all works well when doing it locally; however as soon as I try and use the IP/name of one of our servers it fails with:

    Error: 0xC002F304 at WMI_DRT Server Disk Usage, WMI Data Reader Task: An error occurred with the following error message: "Value does not fall within the expected range.".

    My table on my local instance has both localhost and a servers ip address; the whole thing loops through fine recording the details of the localhost, but then it fails with the server.

    What sort of things would raise this type of message? I have done a google, but am now swimming around in excess information and need to get some clarity - hopefully the wise people here can assist :w00t:

    The server that I am connecting to is on a different subnet. Firewall is not enabled on the OS, but there is a physical firewall that could be blocking ports if there are specific ports required for this.

    For testing purposes I am using the username/password of the local machine, as these servers do not talk to our AD environment.

    Any ideas? Thanks in advance

    Cheers

    Troy

  • dave-dj (8/31/2009)


    Comments posted to this topic are about the item <A HREF="/articles/Integration+Services+(SSIS)/67428/">SSIS & WMI Data Reader Task Query</A>

    This article is really helpful. I need to retrieve Hardware and software information form my domain pcs and store it into sql server I have initially try your functionality but the package is throwing error of Bulk copy insert error. Kindly please suggest what should i do to overcome these error. and how can i get all my details of Hardware and Software information.

  • Does it tell you what conponent is failing?

    You need to create a select query for what ever hardware / software values you want. like

    SELECT FreeSpace, DeviceId, Size, SystemName, Description FROM in32_LogicalDiskwhere DriveType= 3

    (DriveType = 3 filters the query to only the machines physical drives and excludes mapped network drives)

    It means that you may need to use more than one query, which of course will complicate your package, but the general process should be the same, create your variables and assign your values to the variables in the parameter mappings

    _____________________________________________________________________________MCITP: Business Intelligence Developer (2005)

  • try downloading the WMI code creator:

    It will help you write the queries you need to retrieve the data your after.

    http://www.microsoft.com/downloads/en/details.aspx?FamilyID=2CC30A64-EA15-4661-8DA4-55BBC145C30E

    _____________________________________________________________________________MCITP: Business Intelligence Developer (2005)

  • Hi great article Just modified it a bit to get a inventory via WMI of all the Physical Processors instead of cores, works great and added it into the DBA_MORNING_CHECKS ssis package

  • 😀

    Cool. Nice to see it's been useful and aided your daily routines.

    What details are you recording on the physical processors?

    _____________________________________________________________________________MCITP: Business Intelligence Developer (2005)

  • This was amazingly helpful - 5 starts!

  • Hi

    I have followed this article step by step and get the following error.

    Error at DiskUsage: The connection "ServerName=\\;Namespace=\root\cimv2;UseNtAuth=True;UserName=;" is not found. This error is thrown by Connections collection when the specific connection element is not found.

    Any ideas?

    thanks

  • Hi,

    looking at the error, it's not picking up the servername correctly, so check the source table column names and inparticular look at step 6 again..

    Step 6 - Building The Server Query Loop

    Now we have server to query, we can build the loop to iterate through the server list.

    Add a For each Loop Container to the data flow work area and name it FELC Server Query. Double-Click the For Each Loop Container and select Collection. On the Collection form,

    •set the ADO Object Source Variable to User::ServerList.

    •Select the Enumeration mode to Rows in the first table

    •Under Variable mappings, map the Variable User::ServerConnString to index 0.

    make sure you are mapping the variable User::ServerConnString to an index value of 0

    _____________________________________________________________________________MCITP: Business Intelligence Developer (2005)

  • Hi

    Thanks for the quick response.

    The source table [server_query_list] has the server name without a forward slash e.g. [Servertest]. The ServerConnString is set to 0.

    thanks

  • stick a breakpoint on the WMI task and check the variable value pre wmi query execution and check the value is ok

    Also on the wmi_conn connection manage review the connection string expression.

    let me know what you have in there

    is short the problem is the value isn't being set in the connection string so it's pin pointing where the server name is getting lost

    _____________________________________________________________________________MCITP: Business Intelligence Developer (2005)

  • Hi

    I finally got there at the end, it was something in the WMI connection manager

    thanks again 🙂

  • No probs - glad you got it working

    _____________________________________________________________________________MCITP: Business Intelligence Developer (2005)

Viewing 15 posts - 16 through 29 (of 29 total)

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