¿How i do for unskip an activity by powershell script?

Hi.
Im looking a way for unskip an activity from a service request using a powershell script.
I've obtained for example the review activities.....
$activities
= Get-SCSMRelatedObject
-SMObject
$srObj
–Relationship
$wiContainsActivity
$reviewAct
= $activities
| Where {$_.ID -match
'RA'}
Now i need to unskip an specific activity filtering by name for example .
Regards.

Thanks Thomas.
I've tested the solutions but none work. 
My problem is that im looking a way for dont create many service request templates (only
one service request template but many activities templates).  I thought about create a classification enum list in a service request template with authoring tool (VALUE EXAMPLES: email, printer, vm creation) and find the way to create a workflow that
add automatically the activities when i change the list value.
A member of the community told me this:
"Hi,
You can create a single SR template and add additional activities and skip them as by default. Then create a workflow (or use SCORCH) to unskip the required activities. It much easier than adding new activities 'on-fly'."
And i've created an authoring tool WF that run when a service request is created and execute
the next pwshell script for unskip the review activities skipped in the service request that by default are skipped in the template but is not running. Can you help me? what's wrong?
set-executionpolicy -executionPolicy ByPass
$a = (get-module|%{$_.name}) -join " "
if(!$a.Contains("SMLets")){Import-Module SMLets -ErrorVariable err -Force}
$srClass = Get-SCSMClass System.WorkItem.ServiceRequest$
$srObj = Get-SCSMObject -Class $srClass | Where {$_.ID -eq $srID}
$wiContainsActivity = Get-SCSMRelationshipClass System.WorkItemContainsActivity
$activities = Get-SCSMRelatedObject -SMObject $srObj –Relationship $wiContainsActivity
$reviewAct = $activities | Where {$_.ID -match 'AR'}
$ACStatusSkipped = Get-SCSMEnumeration ActivityStatusEnum.Skipped
$ACStatusReRun = Get-SCSMEnumeration ActivityStatusEnum.Rerun$
If ($reviewAct.Stauts -eq $ACStatusSkipped) { 
  set-SCSMObject $reviewAct -Property Status -Value $ACStatusRerun
}

Similar Messages

  • How to search for data in active directory

    if i have an administrator priviledge, how can i search for user's data if i know his username from active directory.

    What form do you have the user's name in ?
    ANTIPODES\alberteString searchFilter = "(&(objectClass=user)(samAccountName=alberte))";[email protected] searchFilter = "(&(objectClass=user)(userPrincipalName=[email protected]))";Albert EinsteinString searchFilter = (&(objectClass=user)(givenName=Albert)(sn=Einstein))";or using Ambiguous Name Resolution (anr)String searchFilter = "(&(objectClass=user)(anr=Albert Einstein))";or it's even clever enough to useString searchFilter = "(&(objectClass=user)(anr=Einstein Albert))";

  • How Actual hours for a Particular Activity is getting Calculated in CJ20N?

    Hi Experts,
             i have a small issue in PS module.In Cj20n after creation of project, under the activity the actual hours are differing from those of CATS hours.How or from where the actual hours are getting populated.The value is getting stored in AFVGD-ISMNW.
    Plz help............

    hi
    have you transfering the actual time after entering and approval to the PS. by the t code CAT5 - Transfer

  • How to use a BrowseForFolder box in my powershell script?

    Hello,
    I have the following script where I want to ask the user to select the folder they want the script to process the instructions from.  I've added a function for Select-Folder as follows:
    function Select-Folder($message='Select a folder', $path = 0) {
    $object = New-Object -comObject Shell.Application
    $folder = $object.BrowseForFolder(0, $message, 0, $path)
    if ($folder -ne $null) {
    $folder.self.Path
    Select-Folder 'Select the folder where the move scripts reside'
    $files=Get-ChildItem $folder -Filter "*.txt"
    foreach ($file in $files){
    $outFileName=[IO.Path]::GetFileNameWithoutExtension($file.Name) + "_StartVMs.txt"
    Get-Content $file.FullName | foreach{
    Add-Content $folder\$outFileName "Start-ClusterResource ""$($_.Split('"')[1])"""
    Issue #1:
    The .txt files I am creating live in the same location as where this script lives. What I've found is the path I choose in the browseforfolder box that pops up is ignored and the files are converted in the location where the script lives.
    Issue #2:
    How do I get the Cancel button to work so the script will exit if the user selects Cancel?
    Any help you can provide would be greatly appreciated.
    Thank you.

    Hi,
    You're not setting a variable with the output of your function, so you don't have anything to test on. Give this slight modification a try (you'll need to work this back into your script, this is demo stuff only):
    function Select-Folder($message='Select a folder', $path = 0) {
    $object = New-Object -comObject Shell.Application
    $folder = $object.BrowseForFolder(0, $message, 0, $path)
    if ($folder -ne $null) {
    $folder.self.Path
    $folderPath = Select-Folder 'Select the folder where the move scripts reside'
    Write-host "The selected folder path is $folderPath"
    If ($folderPath) { Write-Host 'I have a folder, so keep processing in here' }
    Else { Write-Host 'I do not have a folder path' }
    Don't retire TechNet! -
    (Don't give up yet - 12,420+ strong and growing)

  • Powershell script to Scan Active Directory Attributes for Country and Department ,Then add to Sales Group then add to Distribution list based on Region

    Hey Scripting Guys,
    I have been in and out of Powershell last few years, not that great at it tbh !!! I'm looking for advice on how I can as in Title, Create a Powershell script to Scan Active Directory Attributes for Country and Department ,Then add to Group then add to Distribution
    list based on Region/Country
    I was thinking along the lines of get-aduser -LDAPFilter "(department=SALES France) and adding a where clause for country.
    Any help would be great.
    Dec

    So I have tried a few variations but get errors on both 
    get-aduser -LDAPFilter "(&(department=SALES)(c=us))" | Add-ADPrincipalGroupMembership -MemberOf "testgroup"
    get-aduser -LDAPFilter "(&(department=SALES)(c=fr))" | Add-ADGroupMember -identity "testgroup"
    Add-ADPrincipalGroupMembership : Object reference not set to an instance of an
    object.
    At line:1 char:86
    + get-aduser -LDAPFilter "(&(department=SALES)(c=fr))" | Add-ADPrincipalGroupMe
    mbership <<<< -MemberOf "testgroup"
    + CategoryInfo : NotSpecified: (:) [Add-ADPrincipalGroupMembershi
    p], NullReferenceException
    + FullyQualifiedErrorId : Object reference not set to an instance of an ob
    ject.,Microsoft.ActiveDirectory.Management.Commands.AddADPrincipalGroupMem
    bership

  • How to check for impacts due to upgrade

    We are plannining to upgrade from 4.7 to ECC6..How to check for impacts on FTP'S,shell scripts and RFC's etc due to the assesment..Please suggest

    Hi,
    FTP's and Shell scripts are OS dependant not SAP or Database dependant so there will be no change at all unless you upgrade OS too. RFC's are not afected as per guides, notes and my experience.
    I´m doing an upgrade from 4.6C to 6.0 with connections with at least 10 systems and none of them had an issue during tests
    Good luck

  • Looking for Help with Active Directory Script to Remove a User from msExchDelegateListLink

    I'm struggling to put together an Active Directory Powershell script that will remove a specific user from the msExchDelegateListLink.
    It looks like Set-AdUser would do the trick. I would want to remove a user in the format of
    {CN=Wood\, Sandy,OU=Networking,OU=IT,DC=my,DC=domain,DC=com}
    Has anyone succeeded in doing this before?
    Orange County District Attorney

    I use this:
    $user = '<user name>'
    $userDN = Get-ADUser $user | select -ExpandProperty DistinguishedName
    $delegates = Get-ADUser $user -Properties msExchDelegateListBL |
    select -ExpandProperty msExchDelegateListBL
    foreach ($delegate in $delegates)
    Set-ADUser $delegate -Remove @{msExchDelegateListLink = "$UserDN"}
    Never quite got around to putting it into a function.
    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "

  • How to run .cmd file from a Powershell script

    Hi,
    I would like to know how I run commands from a powershell script? how to use the invoke-command?
    This powershell script doesnt work for me
    Invoke-Command C:\setup.cmd -ArgumentList install-setupforced

    To run a batch file from powershell, just type its name with arguments. I'd recommend explicitly including the .CMD file type and, if it is located in the current folder, powershell rules require you to explicitly say so, i.e.:
       ./mybatch.cmd inputfile.txt outputfile.txt
    To run a single cmd.exe command, just prefix it with cmd.exe /c as Mike says:
        cmd.exe /c color 48
    to run a series of "&"- separated cmd.exe commands you need to enclose the complete command string in double quotes:
        cmd.exe /c "color 37 & dir"
    Beyond that it can get complicated due to various characters that are special to powershell and those special to cmd.exe. If you need to run a series of cmd.exe commands, your best short term bet is to put them in a batch file. The best long-term bet is
    to move more completely to the powershell way of doing things...
    Al Dunbar -- remember to 'mark or propose as answer' or 'vote as helpful' as appropriate.

  • For some reason, I cannot change my desktop background no matter how many times I delete the "active" folder.  It's as if it's locked.  Any ideas how I can fix it?

    For some reason, I cannot change my desktop background no matter how many times I delete the "active" folder.  It's as if it's locked.  Any ideas how I can fix it?

    Yes it sounds like you have a corrupted preference file.
    The setting you make in individual programs get saved to a Preference file in your Users/Library/Preferences folder.
    All you have to do is drag out the old file to the desktop, reboot and load the program and the preference file gets rebuilt without your preferences which you reset.
    For your case I beleive the preference file is
    com.apple.desktop.plist

  • I had the developer preview for IOS 6 on my phone, and just got a message telling me that my operating system is no longer active. How do I get my phone activated again?

    I had the developer preview for IOS 6 on my phone, and just got a message telling me that my operating system is no longer active. How do I get my phone activated again?
    I had the developer preview installed. Never had to update to the release version of the OS. Now, the preview has expired, and I cannot use my phone because my iTunes reads my OS as being current, but my iPhone cannot active. Any ideas on how to fix this issue?

    If I Google for Michael Superczynski, first match tells "Michael Superczynski's Profile : Apple Support Communities". It in fact does a lot of work there even if not paid.
    And yes we do not have disagreement about "official apple developers". Problem is that Apple screwed our devices because we are "official apple developers" and did effort to stop us getting proper help. I unbricked my ipad and iphone thanks to unofficial help. Thank you who wrote this unofficial help and "no thanks" for apple for ruining my access to my devices. My mistake was assuming that "update" button on my devices works. It did not because it always told "Your device has latest IOS6 installed" until it bricked yesterday.
    If Apple does not want to listen us, continue do delete post, blame us installing your software and yes we stop buying your devices and developing for them.
      Tonu

  • How do i make a tab active and make it stay that way always. If i put a website in my home page in order for the tabs to open automatically in that same homepage , this setting is not working, every time I open a tab , a white window appears .

    How do i make a tab active and make it stay that way always. If i put a website in my home page in order for the tabs to open automatically in that same homepage , this setting is not working, every time I open a tab , the window appears white .

    By default Firefox opens a blank page for a new Tab, there is no setting to change that action without installing an add-on.
    New Tab Homepage extension: <br />
    https://addons.mozilla.org/en-US/firefox/addon/777

  • How to create DB partitioning in active data tables for ods?

    hi all,
    Can anyone let me know how to create DB partitioning in active data tables for ods. if any docs pls share with me at my email id : [email protected]
    regds
    haritha

    Haritha,
    The following steps will briefly explain you to improve the performance in terms of DB partitioning as well as loading. Please find the same,
    transaction RSCUSTA2,
    oss note 120253 565725 670208
    and remove 'bex reporting' setting in ods if that ods not used for reporting.
    hope this helps.
    565725
    Symptom
    This note contains recommendations for improving the load performance of ODS objects in Business Information Warehouse Release 3.0B and 3.1 Content.
    Other terms
    Business Information Warehouse, ODS object, BW, RSCUSTA2, RSADMINA
    Solution
    To obtain a good load performance for ODS objects, we recommend that you note the following:
    1. Activating data in the ODS object
    In the Implementation Guide in the BW Customizing, you can implement different settings under Business Information Warehouse -> General BW settings -> Settings for the ODS object that will improve performance when you activate data in the ODS object.
    1. Creating SIDs
    The creation of SIDs is time-consuming and may be avoided in the following cases:
    a) You should not set the indicator for BEx Reporting if you are only using the ODS object as a data store.Otherwise, SIDs are created for all new characteristic values by setting this indicator.
    b) If you are using line items (for example, document number, time stamp and so on) as characteristics in the ODS object, you should mark these as 'Attribute only' in the characteristics maintenance.
    SIDs are created at the same time if parallel activation is activated (see above).They are then created using the same number of parallel processes as those set for the activation. However:if you specify a server group or a special server in the Customizing, these specifications only apply to activation and not the creation of SIDs.The creation of SIDs runs on the application server on which the batch job is also running.
    1. DB partitioning on the table for active data (technical name:
    The process of deleting data from the ODS object may be accelerated by partitioning on the database level.Select the characteristic after which you want deletion to occur as a partitioning criterion.For more details on partitioning database tables, see the database documentation (DBMS CD).Partitioning is supported with the following databases:Oracle, DB2/390, Informix.
    1. Indexing
    Selection criteria should be used for queries on ODS objects.The existing primary index is used if the key fields are specified.As a result, the characteristic that is accessed more frequently should be left justified.If the key fields are only partially specified in the selection criteria (recognizable in the SQL trace), the query runtime may be optimized by creating additional indexes.You can create these secondary indexes in the ODS object maintenance.
    1. Loading unique data records
    If you only load unique data records (that is, data records with a one-time key combination) into the ODS object, the load performance will improve if you set the 'Unique data record' indicator in the ODS object maintenance.
    Hope this helps..
    ****Assign Points****
    Thanks,
    Gattu

  • How to maintain WORK for General Cost activity

    Hi,
    can anybody show me how to maintain WORK for a General Cost activity. In the detail screen I cannot find field WORK, so I also don't know how to confirm for a General Cost activity
    Thanks
    Long

    Hi,
    It seems you have 2 different requirment:
    1. Maintaining work: Use Internal activity
    2. Confirm cost activity: Refer [Link|Actual cost in Cost Activity;
    Regards

  • How can I print ONLY the active document?

    Whenever I go to File/Print the darn PSE 9 program sends all of the working files in the bin to the printer. I've searched online for 2 hours now looking for an answer.
    I like to work with having several to many files in the 'bin' and prefer to only print the active file I'm currently working on without having to close the 'working files' before I can print. How can I print ONLY the active document or file in the project bin? Please help, I've upgraded from PSE 3 to PSE 9 and really like the updated features, but this one pain in the neck default is getting the best of me.

    Thanks for your help, that works nicely. It is good to have control of the printer again.

  • How to access onActivityResult() in nativeExtension Activity??

    hi.. I want to access method in native extension activity..
    I call startActivityForResult() method for execute other activity..
    but it can't receive return value..
    because startActivityForResult method is called in activity..
    how to get result in native extension??
    is it impossible??

    hi, zjian..
    thank you for answer..
    according to your anwer, extension activity can create child activity..
    is it possible??
    i heard, it is impossible that create child activity in extension..
    if possible, could you provide the sample code??

Maybe you are looking for