Re: Create SMS_Package with VB.NET

Tech-Archive recommends: Fix windows errors by optimizing your registry



I see you've already had some help with this, but have you looked at the SMS
Managed Site Server Interfaces in the latest SDK? It should make your life
a little easier...

http://www.microsoft.com/downloads/details.aspx?FamilyID=58833cd1-6dbb-45bb-bb77-163446068ef6&DisplayLang=en

Stuart James
Microsoft Consulting Services
======================
This posting is provided "AS IS" with no warranties, and confers no rights.


"ShrimpBoy" <ShrimpBoy@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:02F31795-DDCB-49FE-AD1C-51554293A6EF@xxxxxxxxxxxxxxxx
Hi!

I'm trying to create a new SMS_Package with VB.NET...

I have a SMS 2003 server 2.50.4160.2000 on a Win2K3

I got an error on the line with Package.Name = Name that is an
"Unspecified
Error"
and if I put this line under the line for the description, I got an error
on
the line Package.Put_ that is "Generic Failure"...

How can I solve this issue?

Thanks!

ShrimpyOne

Here is my code..

Dim Locator As SWbemLocator
Dim Server As SWbemServices
Dim Package As SWbemObject

Try

Locator = New SWbemLocator
Server = Locator.ConnectServer(SMSServer, "root\sms")

Catch ex As Exception

Locator = Nothing
Server = Nothing
Exit Sub

End Try

Try

Package = Server.Get("SMS_Package").SpawnInstance_
Package.Name = Name
Package.Description = Description
Package.PkgSourceFlag = STORAGE_DIRECT
Package.PkgSourcePath = SourcePath
Package.Put_()

Catch ex As Exception

Package = Nothing
Locator = Nothing
Server = Nothing
Exit Sub

End Try





.



Relevant Pages

  • Re: Create SMS_Package with VB.NET
    ... I see you've already had some help with this, but have you looked at the SMS ... Managed Site Server Interfaces in the latest SDK? ... Dim Locator As SWbemLocator ...
    (microsoft.public.sms.swdist)
  • Re: Create SMS_Package with VB.NET
    ... Dim Locator As SWbemLocator ... Dim Server As SWbemServices ... Catch ex As Exception ...
    (microsoft.public.sms.swdist)
  • Re: "Log" to HTML File
    ... f2.Writeline "Server Logical Drive Utilization" ... f2.WriteLine UCASE& " Drive Utilization" ... occurred in creating a locator object." ... If item.DriveType=3 Then 'get local drives only ...
    (microsoft.public.scripting.vbscript)
  • Re: Create SMS_Package with VB.NET
    ... Dim Locator As SWbemLocator ... Dim Server As SWbemServices ... Catch ex As Exception ...
    (microsoft.public.sms.swdist)
  • Re: Getting a 403 Forbidden error on our homepage
    ... Locator. ... Contact the server administrator. ... Make sure your destination sets contain ALL variations of the URL that your web site should respond to. ... Windows 2000 Server running IIS 5 for years. ...
    (microsoft.public.isaserver)