Jump to content


Search the Community

Showing results for tags 'Wmi-Object'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Cloud
    • Azure
    • Microsoft Intune
    • Office 365
    • Windows 365
  • General Stuff
    • General Chat
    • Events
    • Site News
    • Official Forum Supporters
    • Windows News
    • Suggestion box
    • Jobs
  • MDT, SMS, SCCM, Current Branch &Technical Preview
    • How do I ?
    • Microsoft Deployment Toolkit (MDT)
    • 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
    • Windows Server General
    • Active Directory
    • Microsoft SQL Server
    • System Center Operations Manager
    • KMS
    • Windows Deployment Services
    • NAP
    • Failover Clustering
    • PKI
    • 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


Website URL


Location


Interests

Found 1 result

  1. Hey all, I'm looking to use Powershell to list all collections a particular Computer is a member of. I have a way of listing all the members of a particular collection, but I don't have the reverse, which would be listing all the collections a member is in. I'll post what I've got. PS C:\> (get-command Get-CollectionMember).ScriptBlock Param($CollName) $SiteCode="ATL" $SCCMServer="SCCM" # Get a list of collections and find the object to build the collection list. $Collection = Get-WmiObject -ComputerName $SCCMServer -Namespace ` "root\sms\site_$SiteCode" -Class 'SMS_Collection' $MyCollection = $Collection | Where-Object { $_.Name -eq $CollName } # Grab the Resource ID of the collection $MyCollectionMembers = Get-WmiObject -ComputerName $SCCMServer -Namespace ` "root\sms\site_$SiteCode" -Query "select * from SMS_CM_RES_COLL_$($MyCollection.CollectionID)" #Echo member of the collections to screen Foreach ($member in $MyCollectionMembers) { $oldErrCount = $error.Count $Name = $member.Name.ToString() $Name } I found this code somewhere online and modified it to fit. Now, this will list all of the members of a specified collection, but can't be used to find all the collections a member is in. Anyone have any ideas?
×
×
  • 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.