Jump to content


  • 0
anes

WMI general failure (while creating subcollection)

Question

Hi All,

 

im have been doing some vb-scripting of sccm for a while and came across an interesting issue.

According to MS http://msdn.microsof...y/cc143262.aspx one must create both the collection as well as the corresponding SMS_CollectToSubcollect object:

 

	' Create the collection.
Set newCollection = connection.Get("SMS_Collection").SpawnInstance_
newCollection.Comment = newCollectionComment
newCollection.Name = newCollectionName
newCollection.OwnedByThisSite = ownedByThisSite

' Save the new collection and the collection path for later.
Set collectionPath = newCollection.Put_  

  ' Define to what collection the new collection is subordinate.
  ' IMPORTANT: If you do not specify the relationship, the new collection will not be visible in the console.
Set newSubCollectToSubCollect = connection.Get("SMS_CollectToSubCollect").SpawnInstance_
newSubCollectToSubCollect.parentCollectionID = existingParentCollectionID
newSubCollectToSubCollect.subCollectionID = CStr(collectionPath.Keys("CollectionID"))

' Save the subcollection information.
newSubCollectToSubCollect.Put_

 

Accidentally it comes to an error (general failure) in the line "newSubCollectToSubCollect.Put_"

 

Because of that collection is not shown in the console and I had to adjust the DB directly in order to get it shown.

 

I have a feeling, that it happens because the creation process has not been completed yet when the second Put_ call comes.

 

 

 

And the questions :)

1. Have your ever seen such a behaviour?

2. Would the change to AsyncPut_ resolve the problem?

 

Thanks in advance.

Share this post


Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.