Re: SMS Script Delete single member from collection

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I'm not sure on what you really try to do here, seems to me like you are
trying to delete resources out of the database?

Member of collections are defined by rules, which is either direct or
dynamic (query based). If you used direct membership rules to add members to
your collections the vbscript I provided would have helped you.

For me it seems like you are trying to delete resources and I'm not sure
that you are aware of that will completely delete them out of the SMS
database (ie. it will get removed from every collection)? If that's what you
want you may use something like:

Set loc = CreateObject( "WbemScripting.SWbemLocator" )
Set WbemServices = loc.ConnectServer( strServer,"root\SMS\site_" &
strSiteCode)

Set objResource = WbemServices.Get("SMS_R_System='" & intResID & "'")
objResource.Delete_

/Rune



"Bobby Boucher" <BobbyBoucher@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:935EA576-E83C-4A95-85CF-94BE05F5CAF6@xxxxxxxxxxxxxxxx
> Thank you for your Answer Rune...
>
> But I'm still not getting it...
>
> I've seen this example and tried it ...
> But when I run it ... there were just one rule ... which was showing the
> query for filling the collection...
> If I removed it... will it not remove all the members from the collection
> ?
> Or am I understanding it wrong ?
>
> Could you show a real example of how to remove one member from a
> collection
> having just the Collection Id and the Ressource Id...
>
> Thanks a lot


.



Relevant Pages

  • DBI handling of attribute hash in DBI->connect
    ... I am encountering this warning message when working with the sample database ... the database create & table create sql strings and table ... there is no query result. ... CREATE TABLE member ...
    (perl.dbi.users)
  • Re: Handling addresses
    ... am seeking guidance regarding handling member addresses. ... asked to learn how to make the database relational and make it more usable. ... I have junction tables to match the customer names with the addresses, ... CustomerNames with a Subform based on tblJunctionAddress - or a query joining ...
    (microsoft.public.access.tablesdbdesign)