Remote Installation Program

Discussion in 'ASP .Net' started by Peter Avalos, Oct 20, 2005.

  1. Peter Avalos

    Peter Avalos Guest

    My goal is to create a remote installation program to rollout program
    installs and updates. We're a small company with about 60 workstations, so
    it's not worth the investment in SMS. I have the first part working which
    used the directory services namespace to enumerate the workstations in a
    specific OU. I then populate a listbox with those values. The system admin
    (SA) then selects the workstation(s) to install the software package or
    select all. The SA then selects the software package through an open
    dialog box. After this the SA would just click an "install software" button
    and then a loop would run passing in selected workstations from the listbox
    to the following sub:

    '--------------------------------------------------------------------------------
    Private Sub InstallSoftware(ByVal strComputer As String)
    Try
    Dim options As New ConnectionOptions
    Dim objMgtBase As ManagementBaseObject
    'Admin user credentials
    options.Username = "username"
    options.Password = "password"
    Dim scope As New ManagementScope("\\" & strComputer & "\root\cimv2",
    options)
    scope.Connect()
    Dim objSoftware As New ManagementObject(scope, New
    ManagementPath("Win32_Product"), Nothing)
    objMgtBase = objSoftware.GetMethodParameters("Install")
    Me.lstProperties.Items.Add("Installed on " & strComputer & " successfully")
    Catch Ex As Exception
    Me.lstProperties.Items.Add(Ex.Message)
    End Try
    End Sub
    '--------------------------------------------------------------------------------

    And exception comes up with regard to the parameter list ("Specified
    argument was out of the range of valid values. Parameter name: path") in the
    Dim objSoftware As New ManagementObject(scope, New
    ManagementPath("Win32_Product"), Nothing) declaration.
    In other words how do I "translate" the following VB Script code that works
    into VB.NET code that works?
    '--------------------------------------------------------------------------------
    Const wbemImpersonationLevelDelegate = 4

    Set objWbemLocator = CreateObject("WbemScripting.SWbemLocator")
    Set objConnection = objwbemLocator.ConnectServer _
    ("WebServer", "root\cimv2", "domain\administrator", _
    "password", , "kerberos:WebServer")
    objConnection.Security_.ImpersonationLevel = wbemImpersonationLevelDelegate

    Set objSoftware = objConnection.Get("Win32_Product")
    errReturn = objSoftware.Install("\\fileserver01\scripts\1561_lab.msi",,True)
    '--------------------------------------------------------------------------------

    Secondly, what's the most efficient way to check if a workstation has the
    WMI service running? I have an Exception block that will handle the "RPC
    Server is unavailable" exception, but it drastically slows down the
    application.

    Lastly, is there another way to rollout software using the .NET framework
    that doesn't use the WMI API? Is there an "easier" way?

    Thanks in advance,
    ~Peter
    Peter Avalos, Oct 20, 2005
    #1
    1. Advertising

  2. Peter,

    >We're a small company with about 60 workstations, so
    >it's not worth the investment in SMS.


    Well there are other deployment products available, for example
    Specops Deploy from http://www.specopssoft.com. (Full disclosure: yes
    I'm affiliated with them).


    >And exception comes up with regard to the parameter list ("Specified
    >argument was out of the range of valid values. Parameter name: path") in the
    >Dim objSoftware As New ManagementObject(scope, New
    >ManagementPath("Win32_Product"), Nothing) declaration.
    >In other words how do I "translate" the following VB Script code that works
    >into VB.NET code that works?


    Try creating a ManagementClass instead of a ManagementObject. Then use
    the ManagementClass to iterate through the existing instances or
    create a new one.


    >Secondly, what's the most efficient way to check if a workstation has the
    >WMI service running?


    Not sure, but have you tried using the
    System.ServiceProcess.ServiceController class?


    Mattias

    --
    Mattias Sjögren [MVP] mattias @ mvps.org
    http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
    Please reply only to the newsgroup.
    Mattias Sjögren, Oct 20, 2005
    #2
    1. Advertising

  3. Peter Avalos

    Silhouette

    Joined:
    Jul 16, 2007
    Messages:
    1
    Hi Peter,

    I was wondering, have you managed to complete your application? If so, I would be interested to see how you have done it, would it be possible for you to post your app as a zip file? It would be greatly appreciated.

    Kind regards,

    Dirk
    Silhouette, Jul 16, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Japan
    Replies:
    1
    Views:
    517
    andrewmcdonagh
    Oct 31, 2006
  2. davidj411
    Replies:
    7
    Views:
    3,252
    Tim Golden
    Oct 8, 2009
  3. Thomas Uehlinger

    gem remote installation does not work

    Thomas Uehlinger, Aug 12, 2004, in forum: Ruby
    Replies:
    13
    Views:
    161
    Mauricio Fernández
    Aug 18, 2004
  4. Steven Hansen
    Replies:
    7
    Views:
    176
    Ezra Zygmuntowicz
    Nov 29, 2006
  5. chinzi

    remote installation of packages

    chinzi, Apr 11, 2006, in forum: Perl Misc
    Replies:
    3
    Views:
    117
    Anno Siegel
    Apr 11, 2006
Loading...

Share This Page