Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Remote Installation Program

Reply
Thread Tools

Remote Installation Program

 
 
Peter Avalos
Guest
Posts: n/a
 
      10-20-2005
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_l ab.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


 
Reply With Quote
 
 
 
 
Mattias Sjögren
Guest
Posts: n/a
 
      10-20-2005
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.
 
Reply With Quote
 
 
 
 
Silhouette Silhouette is offline
Junior Member
Join Date: Jul 2007
Posts: 1
 
      07-16-2007
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to do remote installation using java ? Japan Java 1 10-31-2006 10:12 PM
how to configure remote installation Nijesh MCSE 2 08-11-2005 06:16 AM
Remote Assistance fails to connect, remote remote host name could not be resolved Peter Sale Wireless Networking 1 12-11-2004 09:09 PM
Problem mit Remote Installation Ralf Abele Computer Support 1 01-29-2004 10:08 PM



Advertisments