Asset skipped devices and other issues.
For asset tracking, we want to track all of our user workstations as well as all of our servers (mostly VMs.) For workstations, we import all of our inventory into Asset Management when we receive the hardware. We set the Asset Name, Serial Number and HW Asset ID to the serial number of the system. Now when we deploy a workstation, the hardware asset already exists when SCCM scans it for the first time. The Asset workflows go and rename the the asset to match to computer name, this has been working perfectly fine for us so far.
However, when we deploy a server the serial number is not known ahead of time. In that instance, we want Asset Management to create the hardware asset for us after the SCCM connector runs overnight. This is not happening right now. The Hardware sync log indicates that it is not the most recent computer with that SID (it is just a blank SID,) so it never makes the asset.
If I go into the HW Sync workflow settings and uncheck the box next to "Before creating, check for existing windows computer..." then it will create the HW assets for the items I am missing. However, we rename computers frequently so I think that turning that off would just introduce a new set of problems.
We are only importing computers from our SCCM connector. Our AD connectors do users only. I forget why we had done it that way, but I think it was recommended to not import computers from both locations.
Is it possible to have the Assets created automatically for our servers in this scenario?
Should we be using an AD connector for computer objects? What happens if we are also running the SCCM connector?
Best Answer
-
Brett_Moffett Cireson PACE Super IT Monkey ✭✭✭✭✭Hi Tim,
Usually not running both connectors is a good idea.
However, when using Asset Management to auto create Hardware Assets like you are talking about then it is a good idea to do so.
In our Asset Management installation guidance we have the following note:NOTE:So go ahead and turn on the connector for both AD and ConfigMgr and away you go.
It is important to include computer objects in an AD Connector as the Asset Management workflow verifies that computers exist within AD to prevent stale data being included in installation counts for software assets.
EDIT: - 1 January 2019
After many issues with this solution, Cireson has changed it's advice on this solution.
Having an AD connector bringing in Computer CI's can be an issue as many AD's are not as clean as they should be and this can cause all sorts of issues.
Therefore our new advice is to create an Asset Import Connector and pull the AD SID from SCCM rather than from AD itself. This way only clients that are in SCCM will get the data required.
Create an Asset Import Connector and point it at the SCCM database with the following SQL query:SELECT CONCAT( Netbios_Name0, '.contoso.com.au') AS DisplayName, SID0 FROM dbo.v_R_System
Then set the target class to Windows Computer and set the Asset Import Connector to NOT create new items but to only UPDATE existing items.
Map the returned values to the Display Name and AD SID for the Windows Computers.
Hope this answers your question.5
Answers
Usually not running both connectors is a good idea.
However, when using Asset Management to auto create Hardware Assets like you are talking about then it is a good idea to do so.
In our Asset Management installation guidance we have the following note:
It is important to include computer objects in an AD Connector as the Asset Management workflow verifies that computers exist within AD to prevent stale data being included in installation counts for software assets.
EDIT: - 1 January 2019
After many issues with this solution, Cireson has changed it's advice on this solution.
Having an AD connector bringing in Computer CI's can be an issue as many AD's are not as clean as they should be and this can cause all sorts of issues.
Therefore our new advice is to create an Asset Import Connector and pull the AD SID from SCCM rather than from AD itself. This way only clients that are in SCCM will get the data required.
Create an Asset Import Connector and point it at the SCCM database with the following SQL query:
SELECT CONCAT( Netbios_Name0, '.contoso.com.au') AS DisplayName, SID0 FROM dbo.v_R_System
Then set the target class to Windows Computer and set the Asset Import Connector to NOT create new items but to only UPDATE existing items.
Map the returned values to the Display Name and AD SID for the Windows Computers.
Hope this answers your question.I think we are probably going to go the route of manually creating an asset with the serial number of the VM just to keep less noise from being generated and needing to get cleaned up.
This way you get to target the collections or OU's that you wish to target and even filter AD Objects with LDAP queries so you are only pulling in the CI's that you want to. This also effects the licensing count that Microsoft (and Cireson) uses to calculate your license costs.
In an average environment I might usually set up 5 or 6 AD connectors targeting different OU's or queries depending on the customers OU layout.
Hope this helps
Is is possible to do a full resync of alla HWA like a reinstall of ITAM or if you could delete all objects and let the sync create the again? I also had som stuff n my DB that i didn`t want so. Or can you simply go into the DB and delete all objects from the HardwareAsset Table and let them resync?
Your best bet is usually PowerShell as it will remove relationships as well so there are no dead links in other tables of the DB.
Then it is just a case of waiting for the CAM Workflow to run again and it should re-create the assets based ont he settings you have made in the CAM settings.
Good luck
Thx for your reply. So I did go ahead and deleted all items but i think there is still stuff left in the DB because when the WF runs i get some NULL refrence exceptions. Maybe it is becasue i deleted it all from within the DB. Do you have any good PS code that can get it done? also i wan`t to know if removing all MPs that are installed can do the same thing because if i did this the wrong way i want to start over.
Thx again
Removing the MP's would remove the tables from the DB and therefore wipe out the relationships etc. However, I'm not sure about the relationships to existing CI's such as Computers, Users, Work Items etc.
If this is a production system then I'd suggest getting one of our Cireson Consulting Services engineers to setup a call with you to work through the steps needed, or if this is a SCSM 2012 environment and you are planning to upgrade to 2016, I'd suggest a migration using the Life-cycle Management App that should leave all the old noise behind.
Hope that helps.
I did this in my test env so it is no big deal. But to get fresh new data into our PROD env when we migrate everything we done in our ITAM HW project it would be of great value if you could share your PS code so if i did this again i do it right this time
Thx for your quick answers
First we need to select the Asset configuration item we want to remove. This code will return a single asset with the filter property set to the name of the Asset.
If you want to return ALL your Assets, then simply drop the filter.
The next thing we need to do is remove the Configuration Item. To remove Configuration Items, or Work Items for that matter, we use the Remove-SCSMObject command. The only input we need is the actual object itself with the -smobject property. This is given to us from the previous Get-SMObject command.
If it was just the one asset we wanted to remove, we might save the value to a variable for ease of reading and it would end up like this:
Or we could put it all on one like this:
Now, one more thing we need to know about SCSM is that when you delete an item, it doesn't actually get deleted. It just gets a value changed on the Database table that hides the item. It sets the ToBeDeleted value to True. This no longer shows in the console in any of the regular views, however, it does show up in the Deleted Items node under the Administration workspace.
So to remove it from the DB all together, we need to add the -force property to the Remove Object command.
OK, so that removes the one instance of a CAM Hardware Asset CI.
But what if we want to remove ALL the CAM Hardware Assets?
Then you can swap the two commands so PowerShell runs the Remove-SCSMObject comand for each of the CI's that are returned from the search.
The command then looks like this:
You now have the power...... but with great power.... comes great responsibility!
Be careful, this code WILL DELETE DATA!!
Make sure it's the data you want to delete before you pull the trigger.
THX alot this will help a great deal.
So just to clarify this method of deleting HWA will also delete any relationships that the HWA has in a correct way so the HardwareAssetSync can recreate the HWA in CAM?
As the PowerShell command uses the SDK to to the work, all the relationships are removed also.