Get SCCM Collection Information from ID

I have been working with PowerShell and SCCM for the last 4-5 years and I have built some nice to have Functions that I often use. If you ask me 🙂

Now 50% of all readers will say “You don’t need to use WMI” or “You should connect in another way to WMI”.
In a new environment with SCCM 2012 and with PowerShell 3.0 or 4.0 you are probably right 🙂

I have been making tools and administered SCCM 2007 environments most of the time and with client computers with PowerShell 2.0. So my code will work on SCCM 2007 and SCCM 2012 environments and remote from Windows 7/8x.

This is the first one that I will publish here.

The function will show all the information from SCCM about a collection based on the Collection ID.

I wrote this one because that I some times had the Collection ID but not the name.

(Get-SCCMCollectionInfoFromID -SiteServer LabSCCMSrv01 -SiteCode MYS -CollectionID MYS00125).Name

Fredrik W Test Collection

Or if you write

Get-SCCMCollectionInfoFromID -SiteServer LabSCCMSrv01 -SiteCode MYS -CollectionID MYS00125

You will get all of the information from this collection.

I only use this one when I know that I have the right ID so I don’t have error handling in it for that reason.

You may also like...

1 Response

  1. Hanson says:

    Thank you. It’s exactly what I am looking for.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.