Jump to content


Search the Community

Showing results for tags 'membershiprule'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Cloud
    • Azure
    • Microsoft Intune
    • Office 365
  • General Stuff
    • General Chat
    • Events
    • Site News
    • Windows News
    • Suggestion box
    • Jobs
  • MDT, SMS, SCCM, Current Branch &Technical Preview
    • How do I ?
    • Microsoft Deployment Toolkit (MDT)
    • Official Forum Supporters
    • SMS 2003
    • Configuration Manager 2007
    • Configuration Manager 2012
    • System Center Configuration Manager (Current Branch)
    • Packaging
    • scripting
    • Endpoint Protection
  • Windows Client
    • how do I ?
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows Vista
    • Windows XP
    • windows screenshots
  • Windows Server
    • Active Directory
    • Microsoft SQL Server
    • System Center Operations Manager
    • KMS
    • Windows Deployment Services
    • NAP
    • Failover Clustering
    • PKI
    • Windows Server 2008
    • Windows Server 2012
    • Windows Server 2016
    • Windows Server 2019
    • Hyper V
    • Exchange
    • IIS/apache/web server
    • System Center Data Protection Manager
    • System Center Service Manager
    • System Center App Controller
    • System Center Virtual Machine Manager
    • System Center Orchestrator
    • Lync
    • Application Virtualization
    • Sharepoint
    • WSUS

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

Found 1 result

  1. Hello at all, I’m working on a script which creates a SCCM collection and appends a collection rule. The function createCollection creates and moves the collection without any problems. The collection rule object is also created without any error codes, but at adding the collection rule (newCollection.AddMembershipRule newCollectionRule) I get a “general error”. Has anybody an idea how to fix this problem? Function createCollection(collectionName)     Dim validQuery, queryExpr ' creates the collection.     Set newCollection = objSccm.Get("SMS_Collection").SpawnInstance_()     newCollection.Name = collectionName     newCollection.OwnedByThisSite = True     newCollection.Comment = "Comment"               Set collectionPath = newCollection.Put_ ' Attempts to obtain the collection ID of the newly created collection. Set Collection = objSccm.ExecQuery ("select * from SMS_Collection where Name='" & collectionName & "'") For each objCollection in Collection     strCollectionID=objCollection.CollectionID Next If strCollectionID = "" Then     Wscript.Echo "Unable to obtian a collection ID for the newly created collection."     WScript.Quit Else     ' Attempts to move the newly created collection into the desired parent collection.     Set newCollectionRelation = objSccm.Get("SMS_CollectToSubCollect").SpawnInstance_()     newCollectionRelation.parentCollectionID = strParentCollectionID     newCollectionRelation.subCollectionID = strCollectionID     newCollectionRelation.Put_ End If      'Attempts to create and add the query rule group to the collection!     Set stdQuery = objSccm.Get("SMS_CollectionRuleQuery")     validQuery = stdQuery.ValidateQuery(queryExpr)          If validQuery Then          Set newCollectionRule = stdQuery.SpawnInstance_     newCollectionRule.QueryExpression = queryExpr     newCollectionRule.RuleName = "Rulename"          Set newCollection = objSccm.Get(collectionPath.RelPath)     newCollection.AddMembershipRule newCollectionRule     newCollection.RequestRefresh False       End If End Function
×
×
  • Create New...