Forums on Intune, SCCM, and Windows 11

Welcome to the forums. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your topics and posts, as well as connect with other members through your own private inbox!

SOLVED Remove Computers from SCCM that have been deleted from AD

  • Thread starter Thread starter harveybham
  • Start date Start date
  • Replies Replies 4
  • Views Views 27K
Status
Not open for further replies.

harveybham

Well-Known Member
Messages
86
Solutions
1
Reaction score
5
Points
8
Hi all

Simple request - What is the best way to remove computers that are no longer in AD . (in AD groups part of the discovery group in SCCM)

I know in SCCM you can use the clean up tools but i am looking for a working script which i can run weekly that will email me with a update. Reason for this is because my SCCM is giving me lots of old data and i want it to be accurate as possible

Thanks
 
To remove already discovered data:
Administration>Site Configuration>Sites>Your_Site, Click Site Maintenance:
Delete Aged Discovery Data
Use this task to delete aged discovery data from the database. This data can include records from:

  • Heartbeat discovery
  • Network discovery
  • Active Directory discovery methods: System, User, and Group
This task also removes aged devices marked as decommissioned. When this task runs at a site, data associated with that site is deleted, and those changes replicate to other sites.

Delete Obsolete Client Discovery Data
Use this task to delete obsolete client records from the database. A record that's marked as obsolete has usually been replaced by a newer record for the same client. The newer record becomes the client's current record.

Important
When it's enabled, configure this task to run at an interval greater than the Heartbeat Discovery schedule. This configuration enables the client to send a Heartbeat Discovery record that correctly sets the obsolete status.


To prevent discovering already orphaned systems in AD:
Administration>Hierarchy Configuration>Discovery Methods
Active Directory Group Discovery
Active Directory System Discovery
On both, Options tab, enable and configure both "Only discover computers" items.
 
Hi all

Simple request - What is the best way to remove computers that are no longer in AD . (in AD groups part of the discovery group in SCCM)

I know in SCCM you can use the clean up tools but i am looking for a working script which i can run weekly that will email me with a update. Reason for this is because my SCCM is giving me lots of old data and i want it to be accurate as possible

Thanks
SCCM gets the data from AD and displays it you. If you want to delete the inactive computers objects the cleanup has to be done in AD. There are some third-party tools to perform AD cleanup. You can also use PowerShell scripts to do that.
 
Since I am leveraging a Powershell script to disable computers, I would like to amend the script to also remove the asset from SCCM. When I use Get-CMDevice on items that don't exist, no error is given. $null doesn't work to skip these items. Any powershell reference that you have would be appreciated.
 
Status
Not open for further replies.

Forum statistics

Threads
7,160
Messages
27,950
Members
18,244
Latest member
francopico

Latest posts

Trending content

Back
Top