What shoud be value for -Parent parameter for Add-SCSMEnumeration command
-
Sonntag, 29. April 2012 14:03
I am using SCSM cmLets from following codeplex link.http://smlets.codeplex.com/releases/view/84853
I am adding a new value to an existing dropdown list using a cmlets in powershell , what value should be provided to the -Parent parameter for Add-SCSMEnumeration command.How to retrieve the value which should be provided for -Parent parameter.
I tried providing it EnumTypeName , EnumTypeId, ManagementPackId from EnumType Table , but still it is giving error.
Add-SCSMEnumeration : Cannot bind parameter 'Parent'. Cannot convert the "2374E644-12CF-5AFB-0BD0-C924BFB0E17A" value of
type "System.String" to type "Microsoft.EnterpriseManagement.Configuration.ManagementPackEnumeration".
Alle Antworten
-
Sonntag, 29. April 2012 17:22Moderator
You must get parent enum with Get-SCSMEnumeration and set as -Paretn value.
http://www.scsmsolutions.com/ freemanru (at) gmail (dot) com
-
Montag, 30. April 2012 10:59
Thanks Anton !
Yes I tried using Get-SCSMEnumeration and it does provide the value for Parent parameter.
But even though providing the value retrieved , it does not accept it and again gives the error.
Parent : ManagementPackElementUniqueIdentifier=b127339a-b95d-8a43-68fa-1081704a9ea1
Ordinal :
XmlTag : EnumerationValue
Accessibility : Public
ManagementGroup : gdnits
ManagementGroupId : 87481312-4285-1f09-d8e5-21f332305eab
Identifier : 1|AssetManagementLists/0a39b272096917b0|1.0.0.0|AssetManagementManufacturerAndModel.Vodafone.v1615Sm
artPhone.Enum||
Name : AssetManagementManufacturerAndModel.Vodafone.v1615SmartPhone.Enum
Id : 737d677f-42ea-8dbd-c884-fd5797a3728e
DisplayName : v1615 Smart Phone
Description :
LanguageCode : ENU
Comment :
Status : Unchanged
LastModified : 4/10/2012 4:18:23 AM
TimeAdded : 4/10/2012 4:18:23 AM
InstanceName :
-
Montag, 30. April 2012 11:23ModeratorPlease past your code
http://www.scsmsolutions.com/ freemanru (at) gmail (dot) com
-
Montag, 30. April 2012 11:28
The command is something like this:
Add-SCSMEnumeration -Parent 2374E644-12CF-5AFB-0BD0-C924BFB0E17A -ManagementPackName AssetManagementLifecycleStatusList -DisplayName System.ConfigItem.AssetStatusEnum.NewStock -Name NewStock -Ordinal 15
And the error given is :
Add-SCSMEnumeration : Cannot bind parameter 'Parent'. Cannot convert the "2374E644-12CF-5AFB-0BD0-C924BFB0E17A" value of
type "System.String" to type "Microsoft.EnterpriseManagement.Configuration.ManagementPackEnumeration".
At C:\Users\Administrator.GDNITSPAZDEV04\AppData\Local\Temp\1\7eb264a6-6309-4f30-b043-4a73ced5fe7a.ps1:11 char:28
+ Add-SCSMEnumeration -Parent <<<< 2374E644-12CF-5AFB-0BD0-C924BFB0E17A -ManagementPack AssetManagementLists -Ordinal 1
2 -DisplayName AssetManagementSuppliers.NewValue.Enum -Name NewValue
+ CategoryInfo : InvalidArgument: (:) [Add-SCSMEnumeration], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgumentNoMessage,SMLets.AddSCSMEnumerationCommand -
Montag, 30. April 2012 11:42Moderator
Add-SCSMEnumeration -Parent (Get-SCSMEnumeration -Id "2374E644-12CF-5AFB-0BD0-C924BFB0E17A") -ManagementPackName AssetManagementLifecycleStatusList -DisplayName System.ConfigItem.AssetStatusEnum.NewStock -Name NewStock -Ordinal 15
http://www.scsmsolutions.com/ freemanru (at) gmail (dot) com
-
Donnerstag, 14. Juni 2012 03:47
Anton,
segwaying off of your answer here i've tried to construct my own powershell command using the SMLets to add an item to a list... I am having having problems getting it to work... Would you please assist me in getting this to work so that I might be able to use this in combination with orchestrator to dynamically manage a list of locations? Here is my command/error below:
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
PS C:\Users\admin_ryan> Add-SCSMEnumeration -Parent (Get-SCSMEnumeration -Id "66b02881-ba7a-00ee-8859-b3a6fc8d4a24") -Ma
nagementPackName WNB_CustomMP_IncidentExtensionLists -DisplayName "TestRegion1Add" -Name TestRegion1Add.Enum -Ordinal 80
0
Add-SCSMEnumeration : Value cannot be null.
Parameter name: input
At line:1 char:20
+ Add-SCSMEnumeration <<<< -Parent (Get-SCSMEnumeration -Id "66b02881-ba7a-00ee-8859-b3a6fc8d4a24") -ManagementPackNam
e WNB_CustomMP_IncidentExtensionLists -DisplayName "TestRegion1Add" -Name TestRegion1Add.Enum -Ordinal 800
+ CategoryInfo : NotSpecified: (:) [Add-SCSMEnumeration], ArgumentNullException
+ FullyQualifiedErrorId : System.ArgumentNullException,SMLets.AddSCSMEnumerationCommand----------------------------------------------------------------------------------------------------------------------------------------------------------------------
any help regarding the resolution to my issue would be GREATLY appreciated.
Thanks,
Ryan
-
Samstag, 16. Juni 2012 20:46Moderator
Try to run Get-SCSMEnumeration -Id "66b02881-ba7a-00ee-8859-b3a6fc8d4a24" part and check is it return any data.
http://www.scsmsolutions.com/ freemanru (at) gmail (dot) com
-
Sonntag, 8. Juli 2012 12:00
Try using the -ManagementPack parameter instead of the -ManagementPackName like on the codeplex discussions described:
http://smlets.codeplex.com/discussions/359538/

