Tuesday, October 28, 2014

How to use Get-CMDevice to get all clients from a collection in CM2012 using PowerShell

This one is easy if you are looking at the right cmdlet ;)


Get-CMDevice -CollectionID
or
Get-CMDevice -CollectionName


don't forget if you are getting too much data back you can always pipe to Select-Object


Get-CMDevice -CollectionName 'My CM2012 Collection' | Select-object  Name,ADSiteName


If you find this article useful please leave me a comment.

Wednesday, October 01, 2014

How to import the ConfigMgr Poweshell Module

Is is very easy to do if you have the configmgr consoled installed.

#Import SCCM Module
Import-Module "C:\Program Files (x86)\Microsoft Configuration Manager\AdminConsole\bin\configurationmanager.psd1"
get-psdrive