[MECM/SCCM][PowerShell] 全ての操作の基本グループであるコレクションを操作する

MECM/SCCM に登録されているユーザーや PC をグループ化することができます。

MECM/SCCM ではグループのことをコレクションと呼びます。

アプリ配布する際にコレクションを指定して配布したり、対象のコレクション内の PC の OS のバージョンを抽出したりなど、MECM/SCCM で各種操作の基本となる機能になります。

目次

コレクションを参照する

Get-CMCollection


#サンプル

[testUser]という名前のコレクションを表示させる

Get-CMCollection -Name "testUser"

https://docs.microsoft.com/ja-jp/powershell/module/configurationmanager/get-cmcollection?view=sccm-ps



コレクションを追加する

New-CMCollection


#サンプル

コレクションの名前を [All Users] とし、メンバーとして [testUser] を指定してコレクションを作成する

New-CMCollection -CollectionType User -LimitingCollectionName "All Users" -Name "testUser"

https://docs.microsoft.com/ja-jp/powershell/module/configurationmanager/new-cmcollection?view=sccm-ps



コレクションを編集する

Set-CMCollection


#サンプル

コレクションの名前を [testUser] から [newTestUser] に変更する

Get-CMCollection -Name "testUser" | Set-CMCollection -NewName "newTestUser"

https://docs.microsoft.com/ja-jp/powershell/module/configurationmanager/set-cmcollection?view=sccm-ps



コレクションを削除する

Remove-CMCollection


#サンプル

[testUser] という名前のコレクションを削除する

Remove-CMCollection -Name "testUser" -Force

https://docs.microsoft.com/ja-jp/powershell/module/configurationmanager/remove-cmcollection?view=sccm-ps



コレクションの一覧をエクスポートする

Export-CMCollection


#サンプル

[testUser] という名前のコレクションを [collection.mof] ファイルにエクスポートする

Export-CMCollection -Name "testUser" -ExportFilePath "C:\collection.mof"

https://docs.microsoft.com/ja-jp/powershell/module/configurationmanager/export-cmcollection?view=sccm-ps



コレクションの一覧をインポートする

Import-CMCollection


#サンプル

エクスポートされた [collection.mof] ファイルをインポートする

Import-CMCollection -ImportFilePath "c:\path\collection.mof"

https://docs.microsoft.com/ja-jp/powershell/module/configurationmanager/import-cmcollection?view=sccm-ps



まとめ

  • 参照:Get-CMCollection
  • 追加:New-CMCollection
  • 編集:Set-CMCollection
  • 削除:Remove-CMCollection
  • エクスポート:Export-CMCollection
  • Import-CMCollection
よかったらシェアしてね!
  • URLをコピーしました!
  • URLをコピーしました!

コメント

コメントする

目次