Werbung: SecurityConsole.de verwaltet Ihre Computer mit Security Essentails aus der Cloud!
30 Tage kostenfrei testen und 20% Rabatt für Ihre Bestellung mit Promocode: WBF2685582
(Promocode gültig bis 31.12.2011)

Group:  English: Windows Server » microsoft.public.windows.server.update_services
Thread: WSUS 3.0 API question

HTVi
TV Discussion Newsgroups

WSUS 3.0 API question
ClaudioG64 <ClaudioG64[ at ]gmail.com> 5/16/2007 4:42:56 PM
Hello All,
I'm trying to write some Powershell scripts to manage WSUS 3.0.

I've noticed two new methods of the
Microsoft.UpdateServices.Internal.BaseApi.UpdateServer class:
ExportUpdates and ImportUpdates. They are not documented on the MSDN
(or am I drunk ?).

While I was able to write a script that Exports to a .cab and a log
(xml) file successfully, I cannot understand how to use the
ImportUpdates. If I try something like on the Import server:

Write-Host 'Importing WSus Updates ...' -fore Green
$wsusrv.ImportUpdates('D:\Backup\Export\Export.cab','D:\Backup\Export
\Import.xml')

It starts but it exits with an error stating (in the Import.xml file)
"Object reference not set to an instance of an object."

Anyone has a clue ?

Thanks

Ciao, Claudio
http://www.pulsarit.net/cs/blogs/claudiog/

Re: WSUS 3.0 API question
"Winfried Sonntag [MVP]" <Winfried.Sonntag[ at ]gmx.de> 5/17/2007 10:47:37 AM
ClaudioG64 schrieb:

[Quoted Text]
> I'm trying to write some Powershell scripts to manage WSUS 3.0.
>
> I've noticed two new methods of the
> Microsoft.UpdateServices.Internal.BaseApi.UpdateServer class:
> ExportUpdates and ImportUpdates. They are not documented on the MSDN
> (or am I drunk ?).

What's New in Windows Server Update Services 3.0 API:
http://msdn2.microsoft.com/en-us/library/aa348173.aspx

Winfried
--
http://www.microsoft.com/germany/windowsserver2003/technologien/updateservices/default.mspx
http://www.wsuswiki.com/Home
Re: WSUS 3.0 API question
"Matthew Wetmore \(MSFT\)" <mattwe[ at ]online.microsoft.com> 5/17/2007 5:33:08 PM
The .Internal.BaseApi. namespace is internal implementation, and not meant
to be called outside of the product.

Stick to Microsoft.UpdateServices.Administration, and you'll get everything
there is.

Calling the internal methods is not supported, and you can very easily foul
up your server - plus there's absolutely no guarantee that the methods will
be supported/work the same after even a patch.

Check out the Windows Update script repository for some server PowerShell
API sample scripts:
http://www.microsoft.com/technet/scriptcenter/scripts/default.mspx?mfr=true


--
Matthew Wetmore
Developer, WSUS (Windows Server Update Services)

This posting is provided "As Is" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

"Winfried Sonntag [MVP]" <Winfried.Sonntag[ at ]gmx.de> wrote in message
news:1r86qaiju52e1$.dlg[ at ]ID-163725.user.individual.de...
[Quoted Text]
> ClaudioG64 schrieb:
>
>> I'm trying to write some Powershell scripts to manage WSUS 3.0.
>>
>> I've noticed two new methods of the
>> Microsoft.UpdateServices.Internal.BaseApi.UpdateServer class:
>> ExportUpdates and ImportUpdates. They are not documented on the MSDN
>> (or am I drunk ?).
>
> What's New in Windows Server Update Services 3.0 API:
> http://msdn2.microsoft.com/en-us/library/aa348173.aspx
>
> Winfried
> --
> http://www.microsoft.com/germany/windowsserver2003/technologien/updateservices/default.mspx
> http://www.wsuswiki.com/Home


Re: WSUS 3.0 API question
ClaudioG64 <ClaudioG64[ at ]gmail.com> 5/18/2007 9:23:53 PM
On May 17, 12:47 pm, "Winfried Sonntag [MVP]"
<Winfried.Sonn...[ at ]gmx.de> wrote:
[Quoted Text]
> ClaudioG64 schrieb:
>
> > I'm trying to write some Powershell scripts to manage WSUS 3.0.
>
> > I've noticed two new methods of the
> > Microsoft.UpdateServices.Internal.BaseApi.UpdateServer class:
> > ExportUpdates and ImportUpdates. They are not documented on the MSDN
> > (or am I drunk ?).
>
> What's New in Windows Server Update Services 3.0 API:http://msdn2.microsoft.com/en-us/library/aa348173.aspx
>
> Winfried
> --http://www.microsoft.com/germany/windowsserver2003/technologien/updat...http://www.wsuswiki.com/Home

Winfried,
there is no mention about those 2 methods there and neither here
http://msdn2.microsoft.com/en-us/library/microsoft.updateservices.administration.iupdateserver_methods.aspx.
If you ask to Powershell to execute 'get-member' on a iupdateserver
objects it shows that those exists, but they're not documented on
MSDN, as of today.

$wsusrv =
[Microsoft.UpdateServices.Administration.AdminProxy]::GetUpdateServer()
$wsussrv | get-member

It reveals among the many methods and properties:

ImportUpdates Method System.Void
ImportUpdates(String packagePath, String logPath)
ExportUpdates Method System.Void
ExportUpdates(String packagePath, String logPath)

The ExportUpdates does generates a CAB with the metadata and a log
(XML file), but the ImportUpdates it's a mistery ...

Thanks
Claudio

Re: WSUS 3.0 API question
ClaudioG64 <ClaudioG64[ at ]gmail.com> 5/18/2007 9:30:18 PM
On May 17, 7:33 pm, "Matthew Wetmore \(MSFT\)"
<mat...[ at ]online.microsoft.com> wrote:
[Quoted Text]
> The .Internal.BaseApi. namespace is internal implementation, and not meant
> to be called outside of the product.
>
> Stick to Microsoft.UpdateServices.Administration, and you'll get everything
> there is.
>
> Calling the internal methods is not supported, and you can very easily foul
> up your server - plus there's absolutely no guarantee that the methods will
> be supported/work the same after even a patch.
>
> Check out the Windows Update script repository for some server PowerShell
> API sample scripts:http://www.microsoft.com/technet/scriptcenter/scripts/default.mspx?mf...
>
> --
> Matthew Wetmore
> Developer, WSUS (Windows Server Update Services)
>
> This posting is provided "As Is" with no warranties, and confers no rights.
> Use of included script samples are subject to the terms specified athttp://www.microsoft.com/info/cpyright.htm
>
> "Winfried Sonntag [MVP]" <Winfried.Sonn...[ at ]gmx.de> wrote in messagenews:1r86qaiju52e1$.dlg[ at ]ID-163725.user.individual.de...
>
> > ClaudioG64 schrieb:
>
> >> I'm trying to write some Powershell scripts to manage WSUS 3.0.
>
> >> I've noticed two new methods of the
> >> Microsoft.UpdateServices.Internal.BaseApi.UpdateServer class:
> >> ExportUpdates and ImportUpdates. They are not documented on the MSDN
> >> (or am I drunk ?).
>
> > What's New in Windows Server Update Services 3.0 API:
> >http://msdn2.microsoft.com/en-us/library/aa348173.aspx
>
> > Winfried
> > --
> >http://www.microsoft.com/germany/windowsserver2003/technologien/updat...
> >http://www.wsuswiki.com/Home


Matthew,
I didn't call any internal/undocumented method ... it's just how the
object advertise itself when queried with the Powershell Get-member
cmdlet.

$wsusrv =
[Microsoft.UpdateServices.Administration.AdminProxy]::GetUpdateServer()
$wsusrv | get-member

It prints:
TypeName: Microsoft.UpdateServices.Internal.BaseApi.UpdateServer

In the same list you'll find the two methods I'm talking about.

If you then run something like:

$wsusrv.ExportUpdates('C:\WSUS\Export.cab','C:\WSUS\Export.xml')

it runs and generates the metadata cab and log file, but how to use
those with ImportUpdates ?
Anybody from the WSUS team can clarify ?

Thanks,
Claudio

Re: WSUS 3.0 API question
"Matthew Wetmore \(MSFT\)" <mattwe[ at ]online.microsoft.com> 5/22/2007 12:08:18 AM
The get-member cmdlet in PowerShell shows both internal and external methods
from the internal class.
The only supported public properties and methods are documented under
Microsoft.UpdateServices.Administration, and in this case the IUpdateServer
interface.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wsus_mref/html/N_Microsoft_UpdateServices_Administration.asp

So - the methods you're referring to are internal only methods, and should
not be called.

You should look at the documentation for the IPublisher interface instead.
That documentation is currently rather sparse beyond just type of the
arguments - the semantics aren't there yet. Our writer tells me that there's
a set of conceptual documentation underway for how to use publishing. It
will be an extensive set of documentation around the feature.

In the meantime, have a look at this sample for how to publish a .MSP:
http://www.microsoft.com/technet/scriptcenter/scripts/sus/server/susvms05.mspx



Regarding the fact you do get-members and see internal implementation:
greater support for PowerShell cmdlets and administration of the WSUS server
from PowerShell is already under consideration for a future update to WSUS,
but there is no ETA.

--
Matthew Wetmore
Developer, WSUS (Windows Server Update Services)

This posting is provided "As Is" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

"ClaudioG64" <ClaudioG64[ at ]gmail.com> wrote in message
news:1179523818.468657.5400[ at ]h2g2000hsg.googlegroups.com...
[Quoted Text]
> On May 17, 7:33 pm, "Matthew Wetmore \(MSFT\)"
> <mat...[ at ]online.microsoft.com> wrote:
>> The .Internal.BaseApi. namespace is internal implementation, and not
>> meant
>> to be called outside of the product.
>>
>> Stick to Microsoft.UpdateServices.Administration, and you'll get
>> everything
>> there is.
>>
>> Calling the internal methods is not supported, and you can very easily
>> foul
>> up your server - plus there's absolutely no guarantee that the methods
>> will
>> be supported/work the same after even a patch.
>>
>> Check out the Windows Update script repository for some server PowerShell
>> API sample
>> scripts:http://www.microsoft.com/technet/scriptcenter/scripts/default.mspx?mf...
>>
>> --
>> Matthew Wetmore
>> Developer, WSUS (Windows Server Update Services)
>>
>> This posting is provided "As Is" with no warranties, and confers no
>> rights.
>> Use of included script samples are subject to the terms specified
>> athttp://www.microsoft.com/info/cpyright.htm
>>
>> "Winfried Sonntag [MVP]" <Winfried.Sonn...[ at ]gmx.de> wrote in
>> messagenews:1r86qaiju52e1$.dlg[ at ]ID-163725.user.individual.de...
>>
>> > ClaudioG64 schrieb:
>>
>> >> I'm trying to write some Powershell scripts to manage WSUS 3.0.
>>
>> >> I've noticed two new methods of the
>> >> Microsoft.UpdateServices.Internal.BaseApi.UpdateServer class:
>> >> ExportUpdates and ImportUpdates. They are not documented on the MSDN
>> >> (or am I drunk ?).
>>
>> > What's New in Windows Server Update Services 3.0 API:
>> >http://msdn2.microsoft.com/en-us/library/aa348173.aspx
>>
>> > Winfried
>> > --
>> >http://www.microsoft.com/germany/windowsserver2003/technologien/updat...
>> >http://www.wsuswiki.com/Home
>
>
> Matthew,
> I didn't call any internal/undocumented method ... it's just how the
> object advertise itself when queried with the Powershell Get-member
> cmdlet.
>
> $wsusrv =
> [Microsoft.UpdateServices.Administration.AdminProxy]::GetUpdateServer()
> $wsusrv | get-member
>
> It prints:
> TypeName: Microsoft.UpdateServices.Internal.BaseApi.UpdateServer
>
> In the same list you'll find the two methods I'm talking about.
>
> If you then run something like:
>
> $wsusrv.ExportUpdates('C:\WSUS\Export.cab','C:\WSUS\Export.xml')
>
> it runs and generates the metadata cab and log file, but how to use
> those with ImportUpdates ?
> Anybody from the WSUS team can clarify ?
>
> Thanks,
> Claudio
>


Re: WSUS 3.0 API question
ClaudioG64 <ClaudioG64[ at ]gmail.com> 5/22/2007 5:56:22 AM
On May 22, 2:08 am, "Matthew Wetmore \(MSFT\)"
<mat...[ at ]online.microsoft.com> wrote:
[Quoted Text]
> The get-member cmdlet in PowerShell shows both internal and external methods
> from the internal class.
> The only supported public properties and methods are documented under
> Microsoft.UpdateServices.Administration, and in this case the IUpdateServer
> interface.http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wsus...
>
> So - the methods you're referring to are internal only methods, and should
> not be called.
>
> You should look at the documentation for the IPublisher interface instead.
> That documentation is currently rather sparse beyond just type of the
> arguments - the semantics aren't there yet. Our writer tells me that there's
> a set of conceptual documentation underway for how to use publishing. It
> will be an extensive set of documentation around the feature.
>
> In the meantime, have a look at this sample for how to publish a .MSP:http://www.microsoft.com/technet/scriptcenter/scripts/sus/server/susv...
>
> Regarding the fact you do get-members and see internal implementation:
> greater support for PowerShell cmdlets and administration of the WSUS server
> from PowerShell is already under consideration for a future update to WSUS,
> but there is no ETA.
>
> --
> Matthew Wetmore
> Developer, WSUS (Windows Server Update Services)
>
> This posting is provided "As Is" with no warranties, and confers no rights.
> Use of included script samples are subject to the terms specified athttp://www.microsoft.com/info/cpyright.htm
>
> "ClaudioG64" <Claudio...[ at ]gmail.com> wrote in message
>
> news:1179523818.468657.5400[ at ]h2g2000hsg.googlegroups.com...
>
> > On May 17, 7:33 pm, "Matthew Wetmore \(MSFT\)"
> > <mat...[ at ]online.microsoft.com> wrote:
> >> The .Internal.BaseApi. namespace is internal implementation, and not
> >> meant
> >> to be called outside of the product.
>
> >> Stick to Microsoft.UpdateServices.Administration, and you'll get
> >> everything
> >> there is.
>
> >> Calling the internal methods is not supported, and you can very easily
> >> foul
> >> up your server - plus there's absolutely no guarantee that the methods
> >> will
> >> be supported/work the same after even a patch.
>
> >> Check out the Windows Update script repository for some server PowerShell
> >> API sample
> >> scripts:http://www.microsoft.com/technet/scriptcenter/scripts/default.mspx?mf...
>
> >> --
> >> Matthew Wetmore
> >> Developer, WSUS (Windows Server Update Services)
>
> >> This posting is provided "As Is" with no warranties, and confers no
> >> rights.
> >> Use of included script samples are subject to the terms specified
> >> athttp://www.microsoft.com/info/cpyright.htm
>
> >> "Winfried Sonntag [MVP]" <Winfried.Sonn...[ at ]gmx.de> wrote in
> >> messagenews:1r86qaiju52e1$.dlg[ at ]ID-163725.user.individual.de...
>
> >> > ClaudioG64 schrieb:
>
> >> >> I'm trying to write some Powershell scripts to manage WSUS 3.0.
>
> >> >> I've noticed two new methods of the
> >> >> Microsoft.UpdateServices.Internal.BaseApi.UpdateServer class:
> >> >> ExportUpdates and ImportUpdates. They are not documented on the MSDN
> >> >> (or am I drunk ?).
>
> >> > What's New in Windows Server Update Services 3.0 API:
> >> >http://msdn2.microsoft.com/en-us/library/aa348173.aspx
>
> >> > Winfried
> >> > --
> >> >http://www.microsoft.com/germany/windowsserver2003/technologien/updat...
> >> >http://www.wsuswiki.com/Home
>
> > Matthew,
> > I didn't call any internal/undocumented method ... it's just how the
> > object advertise itself when queried with the Powershell Get-member
> > cmdlet.
>
> > $wsusrv =
> > [Microsoft.UpdateServices.Administration.AdminProxy]::GetUpdateServer()
> > $wsusrv | get-member
>
> > It prints:
> > TypeName: Microsoft.UpdateServices.Internal.BaseApi.UpdateServer
>
> > In the same list you'll find the two methods I'm talking about.
>
> > If you then run something like:
>
> > $wsusrv.ExportUpdates('C:\WSUS\Export.cab','C:\WSUS\Export.xml')
>
> > it runs and generates the metadata cab and log file, but how to use
> > those with ImportUpdates ?
> > Anybody from the WSUS team can clarify ?
>
> > Thanks,
> > Claudio

Matthew,
thanks a lot for the clarification.

Claudio

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net
Suche nach Orten, Städten, Postleitzahlen, Vorwahlen, Kfz-Kennzeichen