Stop SCCM import and creation of Virtual Desktops
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-12-2017 11:06 AM
Hi All,
We are attempting to leverage the SCCM integration with ServiceNow. One of the issues we are running into is the way SCCM handles Virtual Desktops. We install SCCM on the Primary device in the pool for patching purpose and then the client get's pushed down to all non-perpetual VD instances which creates new resource IDs and many records.
We have decided to not track VDI instances as computers CIs in ServiceNow and I would like to ignore the insert of only VDI related records during the SCCM integration. I would still like records to be created if there are non-VDI devices found such as servers or other computers.
I have tried adding the below query to the onBefore script.
if(source.u_model == "VMware Virtual Platform" && source.u_systemrole == "Workstation")
{
ignore = true;
}
This does appear to stop the bulk of transform data from being imported to the records, however the records themselves are still being created with Resource ID, Hostname, Serial Number, and Class. It looks like something in the transform is still running before the onBefore script begins and creating placeholder records. the onBefore then prevents the rest of the data from being transformed to those newly created records.
Is this something that could be stopped on the import before it even gets to the import table or could a delete query be added somewhere to remove the records before the transform script runs?
Nate
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-12-2017 11:11 AM
Here are a couple of options:
1. Create / modify the SQL statement in the Data Source to only retrieve the records you want (exclude VMs)
2. We do not connect directly to SCCM. Instead we have the needed SCCM data synced daily to a SQL DB. With this setup you could control what records are synced with the external DB.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2017 09:41 AM
Thanks Robert,
Do you happen to know why the if Insert ignore = true onBefore script does not work in this situation?
I have even tried the standard script and the SCCM integration is still creating new records on the computers class. This script just prevents the transforming of any additional information after they are already created.
It must be one of the other scripts running within the SCCM computer identity transform that is still creating this initial placeholder records before the transform takes place.
if (action == "insert") {
ignore = true;
}
Nate
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2017 10:07 AM
First, I've never tried to ignore an imported record using a onBefore script. I've always placed that code in the transform map script. Not sure if that's a factor.
Second, are you certain your condition is being exactly met? Take a look at the data. Perhaps a startsWith or indexOf with a shorter string will help.