Check out this similar question (and answer):
Create a dynamic collection of newly joined clients - is it Possible?
I am looking for a way to create a dynamic collection that pulls only freshly joined clients (i.e: when a newly set up computer joins the domain and gets the SCCM client installed). Is this even possible?
I tried the query below but it pulled computers that came back online after being offline for a period. It did not pull new clients. This is not what I am looking for.
select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System WHERE DateDiff(dd,SMS_R_System.CreationDate, GetDate()) <= 1
Why I need this collection? I have a group of standard apps that needs to be installed whenever we set up a brand new computer. These apps have already been installed on existing clients. I do not want to deploy the apps to the "all workstations" collection, to avoid any possible issues or complications, so I just want these standard apps to install on fresh computers only.
Any suggestions are greatly appreciated.
Thank you!
3 additional answers
Sort by: Most helpful
-
M Tran 491 Reputation points
2022-04-19T15:09:35.173+00:00 Thank you @Simon Ren-MSFT and @Sherry Kissinger !
I will try this. I think the post is what I am looking for.
-
Simon Ren-MSFT 36,556 Reputation points Microsoft Vendor
2022-04-14T18:20:31.03+00:00 Hi @M Tran ,
Thanks for posting in Microsoft MECM Q&A forum.
==>Why I need this collection? I have a group of standard apps that needs to be installed whenever we set up a brand new computer. These apps have already been installed on existing clients. I do not want to deploy the apps to the "all workstations" collection, to avoid any possible issues or complications, so I just want these standard apps to install on fresh computers only.
For this purpose, we can add the computer to the specified collection during OSD, so it will get the policies (apps, updates etc.) after OSD completed. Some threads for your reference:
ADD A DEVICE TO A COLLECTION DURING A TASK SEQUENCE
Add device to collection as part of OSD Task Sequence
How to add a Known/Unknown Computer to a specified collection during OS Deployment
Adding a device to an SCCM collection during OSDHope it helps. Have a nice day!
Best regards,
Simon
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread. -
Sherry Kissinger 5,261 Reputation points
2022-04-26T13:34:11.713+00:00 "Will these machine eventually "leave" the collection on their own after some time has elapsed? That is what I would want."
That is what "should happen", yes. But that's why you shouldn't just believe me, lol. "Trust, but Verify". I suggest you literally write down the machines that are in that collection as of "now" on a notepad or an Appointment to yourself in 3 days time... to go check that the ones that are in there now... are no longer there in 3 days (and potentially other ones have dropped in).
Don't just trust me. I could be evil. You don't know.
fyi, I tend to look at sql, not the console. select fcm.Name [ComputerName] from v_fullcollectionmembership fcm where fcm.collectionid = (Select collectionid from v_collection c where c.name = 'WhateverYouCalledThatCollection')
would be one possible way to list boxes in that collection, without looking in the console.