-
Notifications
You must be signed in to change notification settings - Fork 12
Updating Asset custom fields #35
Comments
can you post the exact code you're using to update the asset? (Set-SmaAsset) |
Here it is. The update to field_10281 works fine.
|
I don't actually have a Kace appliance anymore due to a job change, so I can really only be of limited help unfortunately. Looking at your hashtable, you don't seem to have a top level node with the ID of the asset you want to update. It's been a few years since i've been able to do this, but i think that bit is necessary. $SetAssetBody = @{
'Assets' = @(
@{
'id' = 1234 # ID of asset you want to update
'field_10281' = 'New Department'
'field_10283' = @{
'id' = 678
'user_name' = 'new_user'
'email' = '[email protected]'
'full_name' = 'User, New D.'
}
}
)
} |
I updated the code to this but it still gives the same error.
As a side question, how do you get your code to show up clean in the comments? |
Github flavored markdown supports code formatting, so just use 3 back ticks followed by a language, and it formats it for you. Note the closing 3 back ticks too at the bottom: Kace's API is woefully poorly documented. I looked through the last version of the PDF if have access to (SMA v10) and there are no indicators of what format it wants for any field other than a simple string. Wish i could be of more help. |
I want to update the owner field on an asset.
When I run Get-SMAAsset I get this:
The field I need to update is field_10283.
I've tried creating a hash table with the info to be updated but I still get errors.
Powershell shows:
KACE Server logs show:
Any help on how to format the code to update this field is appreciated.
The text was updated successfully, but these errors were encountered: