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

Updated Wiki: Documentation

$
0
0

Getting started!

  1. Download the .msi and run it
  2. If you had PS running when you installed the .msi, restart PS
  3. Then run "PS> Import-Module SMLets"

Your now ready to use the module.

To learn what's in the module, run the following command:
PS>Get-SCSMCommand

To learn which parameters a cmdlets makes use of, run the following command:
PS>Get-Help Get-SCSMClass
Note: Replace Get-SCSMClass with the cmdlet you want to get parameters for.

To run commands remotely, make use of the -ComputerName parameter.

New Post: Is there any way for the cmdlets to connect to remote hostname:port (same as Service Manager Client)?

$
0
0
It is possible for the cmdlets to use the remote server hostname (and respective port) that's used to connect Service Manager Clients?

I know the below command-line wont work; but that's more or less what I'd like to do:

Get-SCSMIncident -ComputerName server:port -ID IR103

New Post: Is there any way for the cmdlets to connect to remote hostname:port (same as Service Manager Client)?

$
0
0
AFAIK you can't change the port that SCSM is listening. So what is the point of specify the port in the connection??

New Post: Is there any way for the cmdlets to connect to remote hostname:port (same as Service Manager Client)?

$
0
0
I think there may be a miscommunication. Im not asking how to change the port. I'm just asking how the cmdlets can connect to the same host and port that's also used in the Service Manager Client apps.

Not sent from an iPhone.
Powered by Android + Microsoft Exchange

New Post: Is there any way for the cmdlets to connect to remote hostname:port (same as Service Manager Client)?

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

$
0
0
loelobo wrote:
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.  
Hi, i searching answer on thiq question too. If you find some answer plz tell me

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

$
0
0
HiBarma,I still have notfigured out aresponse to this problem.If youfind a solutionlet me know.Thank you.


De: Barma <[email removed]>
Enviado: quarta-feira, 13 de novembro de 2013 06:07
Para: Loé Antonio de Souza Lobo
Assunto: Re: How to Create a Queue using a Projection Criteria for Filter [smlets:392403]

From: Barma

loelobo wrote:
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.
Hi, i searching answer on thiq question too. If you find some answer plz tell me

New Post: Add property to objecttemplate using Add()

$
0
0
Hi,

I'm trying to update an objecttemplate via powershell smlets, but can't figure out the correct input values for the add method.

Here is the script:
Import-Module smlets

$template = Get-SCSMObjectTemplate -DisplayName "Company - Service - New Hardware with approval"

$template.PropertyCollection.Add("what is the correct parameter value here?") 
The overloaddefinition says:
void Add(Microsoft.EnterpriseManagement.Configuration.ManagementPackObjectTemplateProperty item)
void ICollection[ManagementPackObjectTemplateProperty].Add(Microsoft.EnterpriseManagement.Configuration.ManagementPackObjectTemplateProperty item)
int IList.Add(System.Object value)

How do I create a objecttemplateproperty item ?

The propertycollection on the template contains the following:
Path                                                                                            MixedValue                                                                                    
----                                                                                            ----------                                                                                    
$Context/Property[Type='CustomSystem_WorkItem_ServiceRequest_Library!System.WorkItem.Service... $MPElement[Name='CustomServiceManager_ServiceRequest_Library!ServiceRequestPriorityEnum.Low']$
$Context/Property[Type='CustomSystem_WorkItem_ServiceRequest_Library!System.WorkItem.Service... $MPElement[Name='CustomServiceManager_ServiceRequest_Library!ServiceRequestUrgencyEnum.Low']$ 
$Context/Property[Type='CustomSystem_WorkItem_ServiceRequest_Library!System.WorkItem.Service... $MPElement[Name='CustomServiceManager_ServiceRequest_Library!ServiceRequestSourceEnum.Porta...
$Context/Property[Type='CustomSystem_WorkItem_ServiceRequest_Library!System.WorkItem.Service... $MPElement[Name='CustomServiceManager_ServiceRequest_Library!ServiceRequestAreaEnum.Hardwar...
$Context/Property[Type='CustomSystem_WorkItem_Library!System.WorkItem']/Title$                  New Hardware Request with Approval                                            
An example of this would be nice, thanks :)

New Post: Add property to objecttemplate using Add()

$
0
0
Ok I found out how, but now the next step is to update the template within the management pack ??

#Create template property object
    $propClass = [Microsoft.EnterpriseManagement.Configuration.ManagementPackObjectTemplateProperty]
    $propObject = New-Object $propClass

    #Add new item to property object
    $propObject.Path = "`$Context/Property[Type='CustomSystem_WorkItem_Library!System.WorkItem']/Id$"
    $propObject.MixedValue = "SR{0}"
    
    #Add property to template
    $template.PropertyCollection.Add($propObject)

New Post: Change notes field of existing Request Offering

$
0
0
Hi all,

When we try to change the "notes" field of a request offering we get the following error:
Set-SCSMObject : Cannot process extension elements as EnterpriseManagementObject. User EnterpriseManagementObjectProjection for all extension element CRUD operations.
At ...\Untitled1.ps1:5 char:7
+ $RO | Set-SCSMObject -Property Notes -Value "Test"
+       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Set-SCSMObject], InvalidOperationException
    + FullyQualifiedErrorId : System.InvalidOperationException,SMLets.SetSMObjectCommand
Our code looks like this:
Import-Module smlets
$ROName = "RequestOffering"
$compName = "Note"
$RO = Get-SCSMClass -Name System.RequestOffering | Get-SCSMObject | Where-Object {($_.Title -like "*$ROName*") -and ($_.notes -eq "$compName")}
$RO | Set-SCSMObject -Property Notes -Value "Test"
Any help will be appreciated.

New Post: Change notes field of existing Request Offering

$
0
0
may be this is because you get more then one object back in $Ro

try this
$ro | % {Set-SCSMObject -Property Notes -Value "Test" }

New Post: Change notes field of existing Request Offering

$
0
0
Hi crochlitz,

Thanks for the quick reply.

I tried the solution you suggested, but we still got the same error.
I also checked the number of objects in $RO, which was 1.

Commented Issue: Unable to import module after upgrading to SCSM 2012 SP1 [10764]

$
0
0
After upgrading to SCSM 2012 SP1, the following exception is thrown when attempting to import the SMlets module. I suspect they will need a recompile against the the SP1 bits.

Command execution stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Cannot load Windows PowerShell snap-in C:\Program Files\Common Files\SMLets\SMLets.Module.dll because of the following error: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
Loader Exceptions:

Could not load file or assembly 'Microsoft.EnterpriseManagement.Core, Version=7.0.5000.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
Could not load file or assembly 'Microsoft.EnterpriseManagement.Core, Version=7.0.5000.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
Could not load file or assembly 'Microsoft.EnterpriseManagement.Core, Version=7.0.5000.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
Comments: ** Comment from web user: Tero_Ilenius **

Seems that the specified error comes up if you don't have service manager shell installed on the box. Tried to install on orchestrator server without the service manager shell and got the same. Resolved with the installation of the service manager shell.

New Post: Change notes field of existing Request Offering

$
0
0
Mick_VR, because its an TypeProjection - do this

$prop = @{"Notes" = "Test"}
$rm |Set-SCSMObjectProjection -PropertyValues $prop -Verbose

this should work

Btw:
?? Why you dont use cmdlet - Get-SCSMRequestOffering ??

New Post: Change notes field of existing Request Offering

$
0
0
Thanks crochlitz, it is working now!

I didn't use the Get-SCSMRequestOffering cmdlet because i also want to add the request offering to a service offering.
When i use the Get-SCSMRequestOffering cmdlet the Add-SCSMRequestOffering does not accept it, so i have to use Get-SCSMObject.

Created Unassigned: Calling SMLets within Orchestrator [11505]

$
0
0
I am hoping you can help me as I am pulling out the remaining hair I have trying to figure this out. I am using Orchestrator for escalation on Incidents but I am having an issue running SMLets via Orchestrator.

I am attempting to pull all incidents that do not have a user in the AssignedTo field using SMLets (Beta 4) Get-SCSMIncident. This works correctly when using Powershell directly and Import-Module SMLets from my workstation, runbook server and SCSM server, so I know SMLets is installed correctly. However, when I use it via Orchestrator (runbook tester) it comes up with no data. SMLets module correctly loads and does not give me an error and the other functions of the script work fine but the SMLets cmdlets give me no data. I tried using both .Net Script and the Powershell IP. Here is a copy of the code - $Incident is not getting any data.


Import-Module "C:\Program Files\Common Files\SMLets\SMLets.psd1" # --- I used “Import-Module SMLets” as well. ----
$smdefaultcomputer = 'scsmxxxx101'

$Incident = get-scsmincident
foreach($IR in $Incident){
if($IR.AssignedTo -eq $null){
$ID = $IR.ID
$AssignedTo = "FALSE"
}
else{
$AssignedTo = $IR.AssignedTo
$ID = $IR.ID
}

Write-Host "$AssignedTo,$ID"
}

Any help would be appreciated

Created Unassigned: get-scsmobjecttemplate: value cannot be null [11507]

$
0
0
i use the smlets to automate tasks in orchestrator.
I have the smlets installed and succesfully working for a few weeks.

no suddenly when i do the following:
get-scsmobjecttemplate -displayname "templatename"

i receive the error:
Get-SCSMObjectTemplate : Value cannot be null.
Parameter name: input
At line:7 char:18
+ $FoundTemplate = Get-SCSMObjectTemplate -DisplayName “templatename“
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-SCSMObjectTemplate], ArgumentNullException
+ FullyQualifiedErrorId : System.ArgumentNullException,SMLets.GetSCSMObjectTemplateCommand

the Get-SCSMObjectTemplate command without parameters returns the complete template list correctly without errors.

any ideas?

Commented Unassigned: get-scsmobjecttemplate: value cannot be null [11507]

$
0
0
i use the smlets to automate tasks in orchestrator.
I have the smlets installed and succesfully working for a few weeks.

no suddenly when i do the following:
get-scsmobjecttemplate -displayname "templatename"

i receive the error:
Get-SCSMObjectTemplate : Value cannot be null.
Parameter name: input
At line:7 char:18
+ $FoundTemplate = Get-SCSMObjectTemplate -DisplayName “templatename“
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-SCSMObjectTemplate], ArgumentNullException
+ FullyQualifiedErrorId : System.ArgumentNullException,SMLets.GetSCSMObjectTemplateCommand

the Get-SCSMObjectTemplate command without parameters returns the complete template list correctly without errors.

any ideas?
Comments: ** Comment from web user: bobske **

I have experienced the same, it's a little random. I think it's a bug in the cmdlet. Try using -Name or -Id instead, this also finds it faster. If it's just for looking up something you could of course pipe it to a ?{$_.Displayname -like "*templatename*"}

Commented Unassigned: get-scsmobjecttemplate: value cannot be null [11507]

$
0
0
i use the smlets to automate tasks in orchestrator.
I have the smlets installed and succesfully working for a few weeks.

no suddenly when i do the following:
get-scsmobjecttemplate -displayname "templatename"

i receive the error:
Get-SCSMObjectTemplate : Value cannot be null.
Parameter name: input
At line:7 char:18
+ $FoundTemplate = Get-SCSMObjectTemplate -DisplayName “templatename“
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-SCSMObjectTemplate], ArgumentNullException
+ FullyQualifiedErrorId : System.ArgumentNullException,SMLets.GetSCSMObjectTemplateCommand

the Get-SCSMObjectTemplate command without parameters returns the complete template list correctly without errors.

any ideas?
Comments: ** Comment from web user: LouisJenema **

thanks for the reply,

correct, with the -Id its works fine. (and faster).

weird thing is that on another environment it still works with the first opion. (same version of OS, SCSM and SMlets).

New Comment on "Documentation"

$
0
0
The -ComputerName parameter isn't present in the Add-SCSMRequestOffering CmdLet.
Viewing all 306 articles
Browse latest View live


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