HELP! WMI WEBEM kein Rückgabewert nach .Put_

  • Argere mich nun schon einige Zeit mit dem Versuch herum analog dem VBscript das Ganze in Autoit umzusetzen...

    '// vbscript Create collection.
    Set newCollection = swbemconnection.Get("SMS_Collection").SpawnInstance_
    newCollection.Name = newCollectionName
    newCollection.Comment = newCollectionComment
    newCollection.OwnedByThisSite = ownedByThisSite
    newCollection.CollectionType = CollectionType
    newCollection.LimitToCollectionID = ExistingLimitToCollectionID
    '// Save collection and collection path for later use
    Set collectionPath = newCollection.Put_


    der Wert der dadurch in der Variable collectionPath landet ist dann in etwa
    \\SCCM2012.mydomain.net\root\sms\site_S01:SMS_Collection.CollectionID="NOX00019"

    ; // AutoIT Create the collection.

    Local $newCollection = $sconnection.Get("SMS_Collection").SpawnInstance_
    With $newCollection
    .Name = $newCollectionName
    .Comment = $newCollectionComment
    .OwnedByThisSite = $ownedByThisSite
    .CollectionType = $CollectionType
    .LimitToCollectionID = $ExistingLimitToCollectionID
    EndWith
    ;// Save collection and collection path for later use
    Local $collectionPath = $newCollection.Put_

    Leider bleibt die Variable hierbei einfach Leer ?( grümel... :cursing:

    Müsste wohl anderen auch schon so ergangen sein Ideen? kreative Lösungen?

    Einmal editiert, zuletzt von calldor (28. März 2012 um 01:11) aus folgendem Grund: Wenn man vor lauter Bäumen den Wald nicht mehr sieht.... Direktes Setzen der Pfades mit Autoit offensichtlich nicht möglich aber mit Umweg.. Local $obj_collectionPath = $newCollection.Put_ Local $collectionPath = $obj_collectionPath.Path