Loading

End

Skip Feed
  1. Multi-language email notifications
    Hi all, I don't have a question but thought I could share some ideas here. It looks like most members of the community are happy with email notifications in english only. Unfortunately, one of our customers has a legal requirement to offer as well the user interface as the communication in English and French. My approach is to add a parameter to the workflow that represents the selected UI language in AP. In addition, I will duplicate the "email notification" activity to define a MailBody in English and a second one in French. Using a run condition for these activites checking the newly created parameter should solve the requirement. Just as a point to start from I added this powershell webservice to my environment and it seems to work well.   Of course, there will be more efficient ways to solve this :-) Hope this helps :-) Axel --- AP powershell webservice --- function AP_language { param( $Username ) #Open Database connection to AP database $connection = New-Object System.Data.SqlClient.SqlConnection   $connection.ConnectionString = "Server=SnowAutomationPlatformSQLServer;        Database=SnowAutomationPlatformDomain;Trusted_Connection=True;"   $connection.Open()       # Build Command string to read UserID from database   $command = New-Object System.Data.SQLClient.SQLCommand   $command.Connection = $connection   $command.CommandText = "SELECT Id FROM dbo.Users where UserId = '$Username';" # read UserID from database   $UserID = $command.ExecuteScalar() # Build next command string to read CurrentCulture for selected User   $command = New-Object System.Data.SQLClient.SQLCommand   $command.Connection = $connection   $command.CommandText = "SELECT [value] FROM dbo.UserSettings where UserId = '$UserID' AND [Key] = 'CurrentCulture';" # Read CurrentCulture from database   $UserLang = $command.ExecuteScalar() # value from db looks like {"value":"de"} - get language code   if ($Userlang.contains("de")) { # German language selected       $result = "de"   }   Elseif ($Userlang.contains("fr")) { # French language selected       $result = "fr"   }   Else { # all other language selections       $result = "en"   } $Connection.Close() # close database connection $result } #End function
    Expand Post
    Question with a best answer.

    Best Answer

    Hi Axel,

     

    I believe this is a post from the previous system and is more of a "post" than a "question" in this version of Snow Globe, and therefor i'm adding an answer here to mark it as completed just to get it filtered out as completed :)

     

    Perhaps you have a updated solution for this to share?

     

    Also, I believe there are no real tools within AP for this. If you have a suggestion of something that would work well for this, please add it to the ideas board! :)

     

    Thank you!

     

    //Oskar

     

     

    Expand Post
    Oskar Frolin by Oskar Frolin (Flexera Software)

    • Oskar Frolin (Flexera Software)

      Hi Axel,

       

      I believe this is a post from the previous system and is more of a "post" than a "question" in this version of Snow Globe, and therefor i'm adding an answer here to mark it as completed just to get it filtered out as completed :)

       

      Perhaps you have a updated solution for this to share?

       

      Also, I believe there are no real tools within AP for this. If you have a suggestion of something that would work well for this, please add it to the ideas board! :)

       

      Thank you!

       

      //Oskar

       

       

      Expand Post
      Selected as Best

  2. Another Powershell Question

    The Powershell below works great when I run it straight from Powershell and prompt for the inputs. However when I run inside of the App Store I get the following error. 

    Failed to run expression: . 'C:\Program Files\Snow Software\Snow Automation Platform\Activities\migrategroupmembership\2\migrategroupmembership.ps1' -identity 'CNCLCFZLHC2' -target 'STLVDBUS029'. Row number: 110. Error: Cannot validate argument on parameter 'MemberOf'. The argument is or empty. Provide an argument that is not or empty, and then try the command again.

    It appears to be passing the parameter but from some reason the MemborOf is but I don't get that error when I run manually.

    Thanks for you help!

    Jerry

    Param(

     

    $identity,

     

    $target

     

    )

     

    Function Get-MyModule

     

    {

     

    Param([string]$name)

     

    if(-not(Get-Module -name $name))

     

    {

     

    if(Get-Module -ListAvailable |

     

    Where-Object { $_.name -eq $name })

     

    {

     

    Import-Module -Name $name

     

    $true

     

    } #end if module available then import

     

    else { $false } #module not available

     

    } # end if not module

     

    else { $true } #module already loaded

     

    } #end function get-MyModule

     

    Function Get-GroupsToMigrate

     

    {

     

    Param($identity)

     

    $array = @()

     

    $groups = Get-AdComputer -Identity $identity -property “MemberOf”

     

    Foreach($group in $groups.memberOf)

     

    {

     

    #$reply = Read-Host -Prompt “add group $($group) `r`ny / n”

     

    #if($reply -match “y”) {$array +=$group}

     

    } #end foreach

     

    Return $array

     

    } #end Get-GroupsToMigrate

     

    # *** ENTRY POINT TO SCRIPT ***

     

    If(-not (Get-MyModule -name “ActiveDirectory”)) { exit }

     

    $array = Get-GroupsToMigrate -identity $identity

     

    Get-ADComputer -Identity $target | Add-ADPrincipalGroupMembership -MemberOf $array

    #testing making a change

    Expand Post

    • Community Manager (Flexera Software)

      Hi! I would try running the script logged in as the workflowengine account (or runas). It could be that your own account has permissions to read the memberOf property but the service account does not. //Joakim

End of Feed
2 Chatter Feed Items
ALL CONVERSATIONS
UNSOLVED
ARTICLES
2 Posts

Related Topics

    Loading
    End | Flexera