Quantcast
Channel: SCSM PowerShell Cmdlets
Viewing all 306 articles
Browse latest View live

New Post: Does Get-SCSMIncident accept arrays for filtering?

$
0
0

Hi All,

I am trying to extract a set of data using get-scsmincident, and at the moment I am running the query below

 

ForEach ($call in $calls){ 
                          $inc2 = Get-SCSMIncident -ID $id -ComputerName d-sm01                   
                            
                           $call | add-member -type NoteProperty -name Inc -value $inc2.DisplayName
                           $call | add-member -type NoteProperty -name affected -value $inc2.affecteduser
                           $call | add-member -type NoteProperty -name Assigned -value $inc2.Assignedto
                           $call | add-member -type NoteProperty -name Scheduled -value $call.SourceObject.values.Item(11).value
                        }             

 

This all works well and good, but when this is run on larger sites where there could be 150+ calls it is not very efficiant as it has to run 150 seperate Get... queries.  Is there a way of searching for a group of ID's? - the group of ID's will come from another query earlier in the script.

Thanks in advancem,

Ed



Created Issue: Cannot create Service Request using Request Offering that doesn't have questsions. [10317]

$
0
0
I have a generic Service Request Offering with no questions that is used for one-off requests. When I try to script the creation of the Service Request, I get an error "Object reference not set to the instance of an object". If I use an Offering with Questions, it works fine.

New Post: Problem creating Request offering

$
0
0

Hello,

I'm trying to create a Request Offering by running a powershell script. Below my code:

 

Import-Module SMLets
$tmp = Get-SCSMRequestOffering -DisplayName "Cannot access to my voicemail"

$template = Get-SCSMObjectTemplate -Name "Template.e5d01c440b0c461d978cd3b8c606ced1"

$managementPack = Get-SCSMManagementPack -Name "ManagementPack.469eecac8c4a480087ee61fbc1b0b4c6"
New-SCSMRequestOffering -Status "Draft" -TargetTemplate $template -Title "test" -ManagementPack $managementPack

 

 

When I execute it I get the following error:

New-SCSMRequestOffering : Object reference not set to an instance of an object.At line:2 char:24
+ New-SCSMRequestOffering <<<< -Notes "NGIT" -Status "Draft" -TargetTemplate $template -Title "Cannot access to my voicemail" -ManagementPack $managementPack
    + CategoryInfo
         : NotSpecified: (:) [New-SCSMRequestOffering], NullReferenceException
    + FullyQualifiedErrorId : System.NullReferenceException,SMLets.NewSCSMRequestOfferingCommand

 

Could you give me an hint about how to troubleshoot it or show me the correct way of using New-SCSMRequestOffering SMlets?

Thank you for your help.

Marco 

New Post: Set "Assigned To User" to Match "Resolved by User"?

$
0
0

Is there a way (PowerShell or otherwise) to have the "Assigned to User" field set to match the "Resolved by User" when an incident is resolved?

We're using SCSM 2012 and a couple of people are resolving incidents almost exclusively through e-mail and I'd like to have these automatically assigned to whoever closes them.

I really appreciate any help, thanks!

New Post: How to change the responsibility(Assigned to) for the incident, with the commands smlets?

$
0
0

I believe it's something like:

Get-SCSMIncident -ID "IRXXX" | Set-IncidentUser -AssignedTo "domain\username"

You may have to specify the user by Display Name (Last, First)

New Post: How to export data from Customization Managepack (scsm 2012) to xml, using PowershellCmdlets

$
0
0

How to export data from Customization Managepack (scsm 2012) to xml, using PowershellCmdlets

New Post: New-SCSMView

$
0
0

m trying to add a view with the SMLETS New-SCSMView but i cannot fine any documentation or any tip on how to do this

How is this bedst done ?

New Post: New-SCSMView

$
0
0

I played with the code and now im stuck at this error

 

PS C:\Users\ksadmin> New-SCSMView -Folder $folder -criteria $criteria -managementpack $mp -displayname "test"
New-SCSMView : Object reference not set to an instance of an object.
At line:1 char:13
+ New-SCSMView <<<<  -Folder $folder -criteria $criteria -managementpack $mp -displayname "test"
    + CategoryInfo          : InvalidOperation: (test:String) [New-SCSMView], NullReferenceException
    + FullyQualifiedErrorId : NewView,SMLets.NewSMViewCommand

 

 

 


New Post: get-SCSMServiceRequest ?

$
0
0

How come there is no Get-SCSMServiceRequest?  

I'd like to make a subscription based on the Service Request action log but im not sure how to go about it?

New Post: Is there a way to mark a service request analyst comment as private with Smlets?

$
0
0

Is there a way to mark a service request analyst comment as private with Smlets?

New Post: How to list all properties of the class?

$
0
0

Hello

If I know class name, how to list of all properties?

Thank you

New Post: How to Create a Queue using a Projection Criteria for Filter

$
0
0

Hi Everyone.

I'm trying to create a queue (new-scsmQueue) but for filter I need to use the Company property from CreatedBy projection of Service Request.

Can anyone help me with this task?

 

Thanks in advance.

 

New Post: How to list all properties of the class?

$
0
0

Hi.

You can do this:

$class = Get-SCSMClass System.User
$class.PropertyCollection

 

 

Commented Issue: Incident Priority is not being set in New-SCSMIncident [8943]

$
0
0
The .Priority field is not being set dependent on the urgency and impact.
Comments: ** Comment from web user: radtravis **

A workflow should pick up the incident after it is created and set the priority correctly.

I agree though that ideally New-SCSMIncident should calculate and set the priority correctly on insert. Will consider for a future release.

New Post: smlets adds processor, network adapters, and physical and logical drives to computer

$
0
0

Allows smlets adds to the  class  "computer" , processor, network adapters, and physical and logical drives?


New Post: Using SMlets for classes other than the standard commands

$
0
0

I am a complete newbie at Powershell, so please accept my apologies for this basic (I'm sure) question.

I need to be able to open closed tickets to make changes for reporting purposes. I am currently able to do this for Incidents with:

GET-SCSMIncident -ID IR9999 | SET-SCSMIncident -Status Active

However, I can't get my head around the documentation for the GET-SCSMObject cmdlet. What should the command be for this, and how do I determine the GUID for the class I'm attempting to update?

Thanks.

Source code checked in, #80131

Source code checked in, #80132

$
0
0
Upgrade: New Version of LabDefaultTemplate.xaml. To upgrade your build definitions, please visit the following link: http://go.microsoft.com/fwlink/?LinkId=254563

New Post: change createdate of incident

$
0
0

To change the date I type:

1.Import-Module SMLets

2.get-scsmobject -class (get-scsmclass system.workitem.incident$) -filter ‘Id = IR158′| Set-SCSMObject -Property CreatedDate

3.Value: 03.01.2012 11:00:00 

It's ok 

but when Value 03.13.2012 11:00:00

it do not work 

why?


New Post: change createdate of incident

$
0
0

I suspect it's probably because of US date format mm/dd/yyy?

Viewing all 306 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>