All the matter in the prescribed format to the OS (Server 2008 R2) was a Russian, I set the format English (U.S.) and everything is OK
All the matter in the prescribed format to the OS (Server 2008 R2) was a Russian, I set the format English (U.S.) and everything is OK
Hi Jim,
I'm having issues while trying to add a new System.ReviewActivityHasReviewer relationship, even with a brand new RA:
PS C:\> New-SCSMRelationshipObject -Relationship $ActivityHasReviewer-Source $RA-Target $ Reviewer -Bulk New-SCSMRelationshipObject : A discovery data item was rejected because the item is already bound to another Membership relationship. At line:1 char:27 + New-SCSMRelationshipObject <<<< -Relationship $ActivityHasReviewer-Source $RA-Target $Reviewer-Bulk + CategoryInfo : NotSpecified: (:) [New-SCSMRelationshipObject], DiscoveryDataLifetimeDependencyException + FullyQualifiedErrorId : Microsoft.EnterpriseManagement.Common.DiscoveryDataLifetimeDependencyException,SMLets.NewSCSMRelationshipObject
I've been using this a lot on my previous job with SCSM 2010... now I'm using 2012 with the latest version of SMLets and it's not working... are you having the same issue?
It's weird that I have no issues while trying to do with the SCSM IP in Orchestrator... but I can't with PowerShell.
Thanks!
Dear discussion participants,
i got an issue updating decimal values with smlets beta 4 - Set-scsmobject
following error is raised:
VERBOSE: Want to set Cost(decimal) to 56454.58
VERBOSE: Could not find type setter for decimal
Set-SCSMObject : PropertySetterNotFound
At line:1 char:15
+ Set-SCSMObject <<<< $hwobj -Property cost -Value "56454.58" -WhatIf -Verbose
+ CategoryInfo : ObjectNotFound: (decimal:String) [Set-SCSMObject], ItemNotFoundException
+ FullyQualifiedErrorId : No such property setter,SMLets.SetSMObjectCommand
VERBOSE: Adding 130bffaf-4f0b-c821-6eaf-b87c2eda5f5b to change list
Any solution possible?
Regards Chris
Found that is not supported in public void AssignNewValue(ManagementPackProperty p, EnterpriseManagementSimpleObject so,object newValue)
default:
WriteVerbose("Could not find type setter for " + PropertyType);
WriteError(new ErrorRecord(new ItemNotFoundException("PropertySetterNotFound"),"No such property setter", ErrorCategory.ObjectNotFound, PropertyType));
break;
Is it possible to add support for decimal in it?
Solution: You have to use -NoCommit flag when creating the activity (just put it right at the end of the creation string). It will be commited on relationship object creation time and the script will work just fine.
This is due to fact that activities use Membership relationship type and have to be commited together with relationship object. Otherwise they get "related" to themselves and refuse to relate to other objects.
If you need more details: http://blogs.msdn.com/b/scplat/archive/2010/04/02/overview-of-relationship-types-in-the-system-center-platform.aspx
Not having much luck with this one, any help much appreciated!
$RA_ID = "RA612"
$RAClass = get-SCSMClass -name System.WorkItem.Activity.ReviewActivity$
$ParentCR = Get-SCSMRelationshipObject -Target $RAClass | ?{$_.TargetObject -match $RA_ID}
returns this error,
Get-SCSMRelationshipObject : Object reference not set to an instance of an object.
At line:12 char:39
+ $ParentCR = Get-SCSMRelationshipObject <<<< -Target $RAClass | ?{$_.TargetObject -match $RA_ID}
+ CategoryInfo : InvalidOperation: (SMLets.GetSCSMRelationshipObjectCommand:GetSCSMRelationshipObjectCommand) [Get-SCSMRelationshipObject], NullReferenceEx
ception
+ FullyQualifiedErrorId : RelationshipQuery,SMLets.GetSCSMRelationshipObjectCommand
This is where is it seems to go wrong,
Get-SCSMRelationshipObject -Target $RAClass
PS H:\> Get-SCSMRelationshipObject -Target $RAClass
Get-SCSMRelationshipObject : Object reference not set to an instance of an object.
At line:1 char:27
+ Get-SCSMRelationshipObject <<<< -Target $RAClass
+ CategoryInfo : InvalidOperation: (SMLets.GetSCSMRelationshipObjectCommand:GetSCSMRelationshipObjectCommand) [Get-SCSMRelationshipObject], NullReferenceEx
ception
+ FullyQualifiedErrorId : RelationshipQuery,SMLets.GetSCSMRelationshipObjectCommand
I found that I was attempting to use this cmdlet incorrectly. I was trying to apply an email notification template.
I was able to fix this by calling the SMlets module with the literal Path.
$a = (get-module|%{$_.name}) -join " "
if(!$a.Contains("SMLets")){Import-Module 'C:\Program Files\Common Files\SMLets\SMLets.psd1' -ErrorVariable err -Force}
With very little powershell knowledge I managed to bodge a little app together that created, resolved and closed incidents for my service desk staff.
They basically put an end user name in and click on a button that refers to the problem for stuff service desk people do on the fly, e.g. username click changed password.
Anyway....
Its been quite popular and a few other teams where I work want to use it too, I have an issue though that their support groups are nested
e.g.
dept1\
dept1\1LS
dept1\2LS
I had a unique name for my dept so this wasn't an issue, New-SCSMIncident .......
with
–SupportGroup "ICT"
was fine, but it won't accept
–SupportGroup "dept1\2LS"
it would accept "2LS" but this could be any 1 of 4 departments.
Any ideas? could I somehow use the full enumeration string?
thanks
Paul Wilson
Have you tried getting the child support group first? It would look something like this (note that example is for incidents):
$supportgroup = get-scsmchildenumeration -enumeration (get-scsmenumeration -name tierqueue | where {$_.name -eq 'dept1'}) | where {$_.displayname -eq '2LS'}
Then insert $supportgroup in place of "depts1\2LS" in your above example.
Or you should just be able to set the -supportgroup switch to "(get-scsmchildenumeration -enumeration (get-scsmenumeration -name tierqueue | where {$_.name -eq 'dept1'}) | where {$_.displayname -eq '2LS'})" (without quotes).
I haven't tried this, but hopefully that would work.
Are you looking for information on how to update an incident using get-scsmobject, or what is the goal for using the get-scsmobject cmdlet?
To get the class, you'll want to run the following:
get-scsmclass -name system.workitem.incident | where {$_.displayname -eq "incident"}
Using this in the get-scsmobjet cmdlet:
get-scsmobject -class (get-scsmclass -name system.workitem.incident | where {$_.displayname -eq "incident"})
This will retrieve all incidents in the system. If you want to filter on a specific IR, you'll want to add the filter switch:
get-scsmobject -class (get-scsmclass -name system.workitem.incident | where {$_.displayname -eq "incident"}) -filter "Id -eq IR9999"
Hope this helps!
The first option worked a treat, thanks very much
Greetings,
I currently have around 347 items stored in the "deleted items" view, in the administration pane. When using the below PowerShell script, which in turn uses SMLets commands, nothing happens:
import-module smlets $class = Get-SCSMClass | where{$_.name -match “system.configitem”} $deletedobjects = Get-SCSMObject -class $class | where{$_.objectstatus -match “Pending”} $deletedobjects | set-scsmobject -property objectstatus -value deleted
$DeletedObjects however never gets filled. There are a lot of yellow warnings on the screen about a "DisplayName" already being present. After that, nothing.
I'm also unsure if the command triggers the grooming part of SCSM, which is also explained on:
Anyone got any idea?
I'm not sure about the set-scsmobject cmdlet you are using, however when we want to remove an object for immediate purging, we use remove-scsmobject.
As far as being able to populate your $deletedobjects variable, I looked at the object status of one of our objects in the deleted items folder, and it has an objectstatus of "Pending Delete", so your script looks correct.
Also, you are pulling every config item in the system.configitem class before filtering. It would be better (and faster) if you add a filter before passing the result to the where-object cmdlet. This would look like this:
Get-SCSMObject -class $class -filter "objectstatus -match Pending"
Can you try to select just one of your pending delete objects and see if you still see those warnings? You might try something like " $deletedobject = get-scsmobject -class $class -filter "displayname -eq enterobjectdisplayname" "