Home All Groups Group Topic Archive Search About

Install MSI remotely - problem



Author
10 Aug 2005 3:36 PM
MMMMM
I have an MSI install file that I want to install on a remote machine. I have full admin rights on the remote machine. If I place
the MSI in a shared drive (everyone has read access to this shared drive), isn't there a way with VBScript that I can just execute
the installation of this package on the remote machine? I found this script on Technet but it doesn't work. I get an error 80070721
"A security package specific error occured." Source: SWebServicesEx.

http://www.microsoft.com/technet/scriptcenter/scripts/apps/user/usapvb02.mspx



Const wbemImpersonationLevelDelegate = 4

Set objWbemLocator = CreateObject("WbemScripting.SWbemLocator")
Set objConnection = objwbemLocator.ConnectServer("CLIENT006", "root\cimv2", "SoftwareInstallAccount","xyz123abc", ,
"kerberos:CLIENT006")
objConnection.Security_.ImpersonationLevel = wbemImpersonationLevelDelegate

Set objSoftware = objConnection.Get("Win32_Product")
errReturn = objSoftware.Install("\\SEVERDC01\NETLOGON\SOFTWARE.msi",,True)



Any ideas? Thanks. The package works fine when double-clicked, and it is also successfully deployed with a GPO in Active Directory
so it's not the package.

Author
10 Aug 2005 4:09 PM
Torgeir Bakken (MVP)
MMMMM wrote:

Show quote
> I have an MSI install file that I want to install on a remote machine. I have full admin rights on the remote machine. If I place
> the MSI in a shared drive (everyone has read access to this shared drive), isn't there a way with VBScript that I can just execute
> the installation of this package on the remote machine? I found this script on Technet but it doesn't work. I get an error 80070721
> "A security package specific error occured." Source: SWebServicesEx.
>
> http://www.microsoft.com/technet/scriptcenter/scripts/apps/user/usapvb02.mspx
>
>
> Const wbemImpersonationLevelDelegate = 4
>
> Set objWbemLocator = CreateObject("WbemScripting.SWbemLocator")
> Set objConnection = objwbemLocator.ConnectServer("CLIENT006", "root\cimv2", "SoftwareInstallAccount","xyz123abc", ,
> "kerberos:CLIENT006")
> objConnection.Security_.ImpersonationLevel = wbemImpersonationLevelDelegate
>
> Set objSoftware = objConnection.Get("Win32_Product")
> errReturn = objSoftware.Install("\\SEVERDC01\NETLOGON\SOFTWARE.msi",,True)
>
>
> Any ideas? Thanks. The package works fine when double-clicked, and it is also successfully deployed with a GPO in Active Directory
> so it's not the package.
>
>
Hi,

The remote install process does not have access to any network
resources.

You will need to copy the MSI file over to the local disk of the
remote computer, using the admin share.




--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx
Author
10 Aug 2005 4:35 PM
MMMMM
That's very odd, I wonder why MS would include the MSI on a network share in the example script then.


Show quote
"Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> wrote in message news:eO3fuYcnFHA.1996@TK2MSFTNGP10.phx.gbl...
> MMMMM wrote:
>
>> I have an MSI install file that I want to install on a remote machine. I have full admin rights on the remote machine. If I place
>> the MSI in a shared drive (everyone has read access to this shared drive), isn't there a way with VBScript that I can just
>> execute the installation of this package on the remote machine? I found this script on Technet but it doesn't work. I get an
>> error 80070721 "A security package specific error occured." Source: SWebServicesEx.
>>
>> http://www.microsoft.com/technet/scriptcenter/scripts/apps/user/usapvb02.mspx
>>
>>
>> Const wbemImpersonationLevelDelegate = 4
>>
>> Set objWbemLocator = CreateObject("WbemScripting.SWbemLocator")
>> Set objConnection = objwbemLocator.ConnectServer("CLIENT006", "root\cimv2", "SoftwareInstallAccount","xyz123abc", ,
>> "kerberos:CLIENT006")
>> objConnection.Security_.ImpersonationLevel = wbemImpersonationLevelDelegate
>>
>> Set objSoftware = objConnection.Get("Win32_Product")
>> errReturn = objSoftware.Install("\\SEVERDC01\NETLOGON\SOFTWARE.msi",,True)
>>
>>
>> Any ideas? Thanks. The package works fine when double-clicked, and it is also successfully deployed with a GPO in Active
>> Directory so it's not the package.
> Hi,
>
> The remote install process does not have access to any network
> resources.
>
> You will need to copy the MSI file over to the local disk of the
> remote computer, using the admin share.
>
>
>
>
> --
> torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
> Administration scripting examples and an ONLINE version of
> the 1328 page Scripting Guide:
> http://www.microsoft.com/technet/scriptcenter/default.mspx
Author
10 Aug 2005 4:54 PM
Torgeir Bakken (MVP)
MMMMM wrote:

> That's very odd, I wonder why MS would include the MSI on a network
> share in the example script then.
>
Hi,

From the Description part of
http://www.microsoft.com/technet/scriptcenter/scripts/apps/user/usapvb02.mspx

<quote>
Requires delegation for the computer and user accounts involved in the
procedure.
</quote>

I can tell you so much, you don't want to go there, because of it's
security and complexity implications.


--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx
Author
10 Aug 2005 6:48 PM
MMMMM
OK, thanks for the help, but it still doesn't work when I try to install it. I get the same error even after copying the MSI to the
client machine.

I tried:

' ..
errReturn = objSoftware.Install("\\CLIENT006\C$\SOFTWARE.msi",,True)

AND

errReturn = objSoftware.Install("C:\SOFTWARE.msi",,True)

Nothing worked   :-(




Show quote
"Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> wrote in message news:%23bL16xcnFHA.320@TK2MSFTNGP09.phx.gbl...
> MMMMM wrote:
>
>> That's very odd, I wonder why MS would include the MSI on a network
>> share in the example script then.
>>
> Hi,
>
> From the Description part of
> http://www.microsoft.com/technet/scriptcenter/scripts/apps/user/usapvb02.mspx
>
> <quote>
> Requires delegation for the computer and user accounts involved in the
> procedure.
> </quote>
>
> I can tell you so much, you don't want to go there, because of it's
> security and complexity implications.
>
>
> --
> torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
> Administration scripting examples and an ONLINE version of
> the 1328 page Scripting Guide:
> http://www.microsoft.com/technet/scriptcenter/default.mspx
Author
11 Aug 2005 1:26 PM
Torgeir Bakken (MVP)
MMMMM wrote:

Show quote
> OK, thanks for the help, but it still doesn't work when I try to install it. I get the same error even after copying the MSI to the
> client machine.
>
> I tried:
>
> ' ..
> errReturn = objSoftware.Install("\\CLIENT006\C$\SOFTWARE.msi",,True)
>
> AND
>
> errReturn = objSoftware.Install("C:\SOFTWARE.msi",,True)
>
> Nothing worked   :-(
Hi,

Please try the script below.

A prerequisite for this script to work (in it's current version), is
that all computers are domain computers, and that the user account that
runs the script is directly or indirectly (through group membership)
member of the Administrators group on the remote computer.


'--------------------8<----------------------

strComputer = "CLIENT006"   ' " use "." for local computer

Set objWMIService = GetObject("winmgmts:" _
       & "{impersonationLevel=impersonate}!\\" _
       & strComputer & "\root\cimv2")

Set objSoftware = objWMIService.Get("Win32_Product")

errReturn = objSoftware.Install("C:\SOFTWARE.msi",,True)

WScript.Echo errReturn

'--------------------8<----------------------


--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx
Author
16 Aug 2005 1:00 PM
Valentin
Next Example Works in VB.Net but only if <InstallPath> is on remote computer:
-------------------------------------------------------
    Public Function DoInstallSoft(ByVal cmpName As String, ByVal InstallPath
As String) As Integer
        Dim rc As Integer
        Try

            Dim objWMIService As Object = GetObject("winmgmts:\\" + cmpName
+ "\root\cimv2")
            Dim oProducts = objWMIService.Get("Win32_Product")
            Dim oInParams As Object =
oProducts.Methods_("Install").InParameters.SpawnInstance_
            oInParams.PackageLocation = InstallPath
            oInParams.Options = ""
            oInParams.AllUsers = False


            'Call SWbemServices.ExecMethod with the WMI path Win32_Process
            Dim oOutParams As Object =
objWMIService.ExecMethod("Win32_Product", "Install", oInParams)
            If Not oOutParams Is Nothing Then
                rc = oOutParams.ReturnValue
            Else
                rc = -3
            End If
        Catch ex As Exception
            MsgBox(ex.Message)
            rc = -4
        End Try
        Return rc
    End Function
-------------------------------------------------------
But how make it work from network install path?
Any ideas welcome

Show quote
"MMMMM" wrote:

> I have an MSI install file that I want to install on a remote machine. I have full admin rights on the remote machine. If I place
> the MSI in a shared drive (everyone has read access to this shared drive), isn't there a way with VBScript that I can just execute
> the installation of this package on the remote machine? I found this script on Technet but it doesn't work. I get an error 80070721
> "A security package specific error occured." Source: SWebServicesEx.
>
> http://www.microsoft.com/technet/scriptcenter/scripts/apps/user/usapvb02.mspx
>
>
>
> Const wbemImpersonationLevelDelegate = 4
>
> Set objWbemLocator = CreateObject("WbemScripting.SWbemLocator")
> Set objConnection = objwbemLocator.ConnectServer("CLIENT006", "root\cimv2", "SoftwareInstallAccount","xyz123abc", ,
> "kerberos:CLIENT006")
> objConnection.Security_.ImpersonationLevel = wbemImpersonationLevelDelegate
>
> Set objSoftware = objConnection.Get("Win32_Product")
> errReturn = objSoftware.Install("\\SEVERDC01\NETLOGON\SOFTWARE.msi",,True)
>
>
>
> Any ideas? Thanks. The package works fine when double-clicked, and it is also successfully deployed with a GPO in Active Directory
> so it's not the package.
>
>
>

AddThis Social Bookmark Button