locked
User role creation via powershell RRS feed

  • Question

  • Hi

    We are experiencing the situation that name and the description of a user role which is created via powershell does not show up in the console. If i do a get-scsmuserrole, everything looks fine but it will not be shown in the console. Any idea?

    Script used to get all required arguments:

    $RoleArguments = @{
    UserRole = "IncidentResolver"
    DisplayName = "restricted role"
    Description = "this is a test user role via powershell"
    #Queue = @()
    #Group = @()
    #All required tasks need to be listed below
    Task = @((get-scsmtask -name System.WorkItem.Incident.GeneralSettings.Task))
    #All required views should be listed below
    View = @((get-scsmview -name ActivityManagement.Views.ParallelActivitiesUnassigned))
    #All required templates should be listed below
    FormTemplate = @((get-scsmobjecttemplate -name Template.34e86cbc5ca54f38a220562b6b57bcbd))
    }

    Script used for role creation itself:

    new-scsmuserrole @RoleArguments

    Regards

    Eric

    Wednesday, October 10, 2012 12:07 PM

All replies

  • This could be a language issue. Is the computer you are running this script from in a different locale than en-US?
    Wednesday, October 10, 2012 12:53 PM
  • Yes, the server has 'Switzerland' as its location setting. Language is set to German(Switzerland), for non-unicode programs it is set to English(US).
    Wednesday, October 10, 2012 1:50 PM
  • Try running the script under the en-US locale.

    Function Using-Culture (
    [System.Globalization.CultureInfo]$culture = (throw "USAGE: Using-Culture -Culture culture -Script {scriptblock}"),
    [ScriptBlock]$script= (throw "USAGE: Using-Culture -Culture culture -Script {scriptblock}"))
    {
        $OldCulture = [System.Threading.Thread]::CurrentThread.CurrentCulture
        trap 
        {
            [System.Threading.Thread]::CurrentThread.CurrentCulture = $OldCulture
        }
        [System.Threading.Thread]::CurrentThread.CurrentCulture = $culture
        Invoke-Command $script
        [System.Threading.Thread]::CurrentThread.CurrentCulture = $OldCulture
    }
    
    Using-Culture en-US {new-scsmuserrole @RoleArguments}
    

    Wednesday, October 10, 2012 2:52 PM
  • Hi Dieter

    Sorry for my delayed response. Unfortunately your solution does not help. DisplayName and Description are still empty. Any other suggestions?

    Tuesday, October 23, 2012 11:32 AM