A new Flexera Community experience is coming on November 18th, click here for more information.
We need to run zero-touch inventory on our Citrix VDI parents and unique VDIs to support proper Citrix inventory and license entitlement mappings.
See:How-to-Inventory-Citrix-XenDesktop-and-XenApp-using-FlexNet
The problem is specifying inventory targets is a very manual process. It also expects your machines fit into nice groups like by name or subnet (which isn't realistic) or you need to specify each individual machine by name.
We have hundreds of VDI parents or unique machines which change frequently. Keeping the list of machines up to date in the inventory target list is not sustainable.
Has anyone had success populating inventory target via automation?
I would like to build a database script, batch process, or use the business adapter studio to remove and regenerate the inventory target list.
Looking for pointers on others who may be doing this or have ideas on how to accomplish this.
Thanks
=Damon
Nov 14, 2019 03:16 PM
I have attached an example of a business adapter which populates an inventory target from an excel spreadsheet containing a list of server names.
The business adapter process
1. Clears the existing target list
2. Populates a staging table from the spreadsheet contents
3. Repopulates the target from the spreadsheet list of servers
I am using this automation to support the need to remotely inventory XenDesktop parents which is a pain to keep maintained for an organization our size.
You can reuse this for different purposes just remember I hardcoded the insert to the BeaconTargetDiscoveredDeviceMapping_MT table columns TenantID and Include to value of 1. This may need to be updated for your purposes. Any other changes needed for the business adapter xml are in <> brackets.
Please don't critique my work too much I didn't spend much time on this. It does work nice though.
Jan 12, 2021 02:05 PM
Hi Damon,
Disclaimer here that this is fully untested and is more hypothetical but the table which contains the targets is BeaconTarget_MT and has a primary key of BeaconTargetID.
For devices which have already been discovered there is BeaconTargetDiscoveredDeviceMapping_MT which maps DiscoveredDevice.DeviceID to the BeaconTargetID from the previous table.
So depending on how you plan to populate the targets i.e. if you want to manually assign known devices then you might be able to create the rules, then using a script to populate BeaconTargetDiscoveredDeviceMapping_MT however as I said above this is untested.
Nov 18, 2019 08:23 AM
The method suggested by Matt works, I've used it in a couple of cases.
The best method I found was to combine it with a Business Adapter to be able to pull targets from lists. I used to have an adapter that did this but I can't find it now
-Teemu
Nov 22, 2019 05:04 AM
@mrichardson Thanks Matt for describing where things are in the database. I had looked at these very tables but was confused because it would seem the storage of the entry is in a different table depending on if it was a IP vs. site\subnet vs. hostname. I put on the brakes and came here.
@dsalter , very interesting use case indeed! Have you put a solution together?
@TeemuK , have you by chance found the adapter? Using BAS is what I was thinking.
Here is my situation: We are deploying the FlexNet agent via adaption to all servers. The account empowered to adopt is (say) cnet\FNMAgentInstallerEast. There is an AD group called DataCenterEast.Servers which have (say) 1000 servers in it... updated daily so it is always changing (servers being added and removed).
We use the below PowerShell to get these servers and more important, their assigned IP address
# Get each hostnames from AD group DataCenterEast.Servers
$computerlist = Get-ADGroupMember DataCenterEast.Servers | Select-Object Name
# Get IP for each hostname and output to csv (computersips.csv)
foreach ($computer in $computerlist)
{
[system.net.Dns]::GetHostAddresses("$computer") | Foreach-Object
{
add-content -path C:\temp\computersips.csv -value "$computer,$($_.IPAddressToString)"
}
}
The resulting csv is the source data we'd like to use to populate the target. Hostname would be more human-readable but, because we can't guarantee that the server has been discovered (hence, you're not allowed to add by hostname in the target), we are fine with using IP. Note: I could do a join with discovered devices table and make it Hostname if discovered or IP if not but that can be v2 -- just looking to keep it simple to start!
The cool thing is that, where a customer would do such a thing like populate an AD group with the servers the installing account has purview over, the target that could be created would be "DataCenterEast (FNMAgentInstallerEast)" and it would be understood and expected that each server be properly and swiftly adopted.
The AS-IS method: add each IP manually.
Any thoughts would be appreciated and especially if there's been something done adapter-wise that has produced this automation.
Thanks, Rob A
Apr 30, 2020 10:38 AM
At this point we haven't implemented this automation. We found some trouble with duplicate of IP and Names in Discovered devices that presented a challenge, I assume we could use all matching records. We found no way to accomplish this through the Business Adapter Studio (BAS). My next steps were to look at building a powershell script to pull the data we needed and directly repopulate the inventory target directly into the appropriate database tables. I had some other priorities but will look to due this in the future.
May 08, 2020 05:55 PM
Sounds like your issue is with queuing up the data for import into the target. In my case, there's a AD group populated with computers. The service account doing the adoption has local admin rights on those exact computers. Couldn't have a better basis for the underlying target used for agent adoption!
There is an issue where it is sometimes the case that the device hasn't been discovered but is still able to be adopted. In this situation, one can't add a hostname to a target but one can add the IP. All manageable. I'm working with Teemu on a solution for using BAS with the target. If interested, and if he agrees since he's the one mostly doing this, we can share.
Rob
May 11, 2020 09:01 AM
I have attached an example of a business adapter which populates an inventory target from an excel spreadsheet containing a list of server names.
The business adapter process
1. Clears the existing target list
2. Populates a staging table from the spreadsheet contents
3. Repopulates the target from the spreadsheet list of servers
I am using this automation to support the need to remotely inventory XenDesktop parents which is a pain to keep maintained for an organization our size.
You can reuse this for different purposes just remember I hardcoded the insert to the BeaconTargetDiscoveredDeviceMapping_MT table columns TenantID and Include to value of 1. This may need to be updated for your purposes. Any other changes needed for the business adapter xml are in <> brackets.
Please don't critique my work too much I didn't spend much time on this. It does work nice though.
Jan 12, 2021 02:05 PM
Nice work @dsalter.
One word of caution: the UI in FNMS is designed for and work best as long as you don't have too many individual devices/IP addresses recorded in a target. You shouldn't have too many problems with say some 10s of devices in a target, which is what you can reasonably configure using the UI. If you happened to create a target with say 100s or 1000s of devices in it using some sort of direct manipulation of records in the database like the approach discussed above, then the UI may struggle to cope.
Jan 13, 2021 04:56 PM
User | Count |
---|---|
8 | |
7 | |
3 | |
3 |