Skip to content

Limit to Collection PowerShell Script Help

Featured Replies

Hi everyone,

 

We migrated 310 Collections under a Folder. I want to be able to update the collections from the default limited to "all system" to a desktop collection only so that my helpdesk team can manage those collections due to having access to that new limited collection but not all system.

 

So here is the deal. I know I can use the wmi query or powershell. I would prefer to use powershell but in the end of the day it doesnt matter. I spend hours on this and I can figure out how to tell the system to only update all the collections in that folder only not the rest of collections.

 

I have the commands for powershell. This will do it but I can't seem to point to a folder anywhere.

Set-CMDeviceCollection –CollectionId "P010000D" -LimitToCollectionID "SMSDM003"

 

 

PS P01:\> Get-CMDeviceCollection -name "YYZ Desktops"
CollectionID : P010000D
CollectionRules : {YYZ Desktop}
CollectionType : 2
CollectionVariablesCount : 0
Comment : All Toronto Desktops in YYZ Desktops OU
CurrentStatus : 1
HasProvisionedMember : True
IncludeExcludeCollectionsCount : 0
IsBuiltIn : False
IsReferenceCollection : False
ISVData :
ISVDataSize : 0
LastChangeTime : 11/8/2013 2:21:28 AM
LastMemberChangeTime : 11/8/2013 2:21:40 AM
LastRefreshTime : 11/8/2013 2:21:40 AM
LimitToCollectionID : SMS00001
LimitToCollectionName : All Systems
LocalMemberCount : 5
MemberClassName : SMS_CM_RES_COLL_P010000D
MemberCount : 5
MonitoringFlags : 0
Name : YYZ Desktops
OwnedByThisSite : True
PowerConfigsCount : 0
RefreshSchedule : {
instance of SMS_ST_RecurInterval
{
DayDuration = 0;
DaySpan = 7;
HourDuration = 0;
HourSpan = 0;
IsGMT = FALSE;
MinuteDuration = 0;
MinuteSpan = 0;
StartTime = "20130313113800.000000+***";
};
}
RefreshType : 6
ReplicateToSubSites : True
ServiceWindowsCount : 0
Those are all powershell . Anyone has any idea how to do it as I dont see any reference in the collection properties to be under a folder.. and the wmi query I couldnt find it either...
Is this even possible..
Thanks a lot

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.