09-26-2023 08:39 AM
I am looking to pull information for all of my servers in Intersight. I can pull the normal info with the "export" option at the top but I am wanting to know if we can pull the specific contract name, start date, end date, renewal date automatically and maybe put that into a .csv file. I am not sure if this would be an API call or not.
Solved! Go to Solution.
09-26-2023 09:57 AM
I haven't seen contract name or renewal dates but you can definitely get start and end dates with the Intersight Powershell SDK (https://community.cisco.com/t5/data-center-and-cloud-blogs/getting-started-with-the-intersight-powershell-sdk/ba-p/4823398)
You could try something like this to start with and add/remove fields as you see fit:
$devices = Get-IntersightAssetDeviceContractInformation -Top 1000
foreach($device in $devices.Results)
{
Write-Host $device.DeviceId $device.Product.Number $device.ContractStatus
Write-Host $device.Contract.ContractNumber $device.ServiceLevel $device.ServiceStartDate $device.ServiceEndDate
Write-Host $device.WarrantyType $device.WarrantyEndDate
Write-Host $device.LastDateOfSupport $device.LastDateOfSupport
Write-Host `n`n`n
}
This would return output like the following for each device:
FDOXYZXYZ HX-FI-6332-16UP Active
12345678 SNT 11/9/2022 12:00:00 AM 11/9/2025 12:00:00 AM
WARR-3YR-HW-90D-SW 11/05/2022 00:00:00
12/31/2028 12:00:00 AM 12/31/2028 12:00:00 AM
The mobrowser is also useful for browsing what data is available from the API:
https://intersight.com/mobrowser/list/asset/DeviceContractInformation/
09-26-2023 09:57 AM
I haven't seen contract name or renewal dates but you can definitely get start and end dates with the Intersight Powershell SDK (https://community.cisco.com/t5/data-center-and-cloud-blogs/getting-started-with-the-intersight-powershell-sdk/ba-p/4823398)
You could try something like this to start with and add/remove fields as you see fit:
$devices = Get-IntersightAssetDeviceContractInformation -Top 1000
foreach($device in $devices.Results)
{
Write-Host $device.DeviceId $device.Product.Number $device.ContractStatus
Write-Host $device.Contract.ContractNumber $device.ServiceLevel $device.ServiceStartDate $device.ServiceEndDate
Write-Host $device.WarrantyType $device.WarrantyEndDate
Write-Host $device.LastDateOfSupport $device.LastDateOfSupport
Write-Host `n`n`n
}
This would return output like the following for each device:
FDOXYZXYZ HX-FI-6332-16UP Active
12345678 SNT 11/9/2022 12:00:00 AM 11/9/2025 12:00:00 AM
WARR-3YR-HW-90D-SW 11/05/2022 00:00:00
12/31/2028 12:00:00 AM 12/31/2028 12:00:00 AM
The mobrowser is also useful for browsing what data is available from the API:
https://intersight.com/mobrowser/list/asset/DeviceContractInformation/
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide