Jump to content

Search the Community

Showing results for tags 'powershell'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Hornbill Platform and Applications
    • OpenForWork
    • Announcements
    • Blog Article Discussions
    • General Non-Product Discussions
    • Application Beta Program
    • Collaboration
    • Employee Portal
    • Service Manager
    • IT Operations Management
    • Project Manager
    • Supplier Manager
    • Customer Manager
    • Document Manager
    • Timesheet Manager
    • Live Chat
    • Board Manager
    • Mobile Apps
    • System Administration
    • Integration Connectors, API & Webhooks
    • Performance Analytics
    • Hornbill Switch On & Implementation Questions
  • About the Forum
    • Announcements
    • Suggestions and Feedback
    • Problems and Questions
  • Gamers Club's Games
  • Gamers Club's LFT

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Organisation


Location


Interests


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype

Found 6 results

  1. Recently a content pack update was released that added a “Microsoft Teams” key type to the keysafe. This key type allows us to use the PostToChannel method to as a non-AAD admin user. How I can modify this, so that the key type Microsoft Teams can be used, rather than the key type Microsoft: $UserDetails = Get-AzureUser $InstanceName $InstanceKey $InstanceMicrosoftKey $Request.Body.from.aadObjectId. $InstanceMicrosoftKey = 5 – Microsoft Key Type. $InstanceMicrosoftKey = 6 – Microsoft Teams Key Type. If I just change $InstanceMicrosoftKey from 5 to 6, I get a message in Teams saying that an error has occurred, so it’s obviously not as simple as just calling the other key type.
  2. Recently a content pack update was released that added a “Microsoft Teams” key type to the keysafe. This key type allows us to use the PostToChannel method to as a non-AAD admin user. How I can modify this, so that the key type Microsoft Teams can be used, rather than the key type Microsoft: $UserDetails = Get-AzureUser $InstanceName $InstanceKey $InstanceMicrosoftKey $Request.Body.from.aadObjectId. $InstanceMicrosoftKey = 5 – Microsoft Key Type. $InstanceMicrosoftKey = 6 – Microsoft Teams Key Type. If I just change $InstanceMicrosoftKey from 5 to 6, I get a message in Teams saying that an error has occurred, so it’s obviously not as simple as just calling the other key type.
  3. I have a teams bot that is an Azure function written in PowerShell. I have the following function: function Update-TakeRequest { [CmdletBinding()] param( [string]$ID, [string]$Key, [string]$OwnerID, [string]$OwnerName, [string]$TeamID, [string]$TeamName, [string]$RequestRef ) $Request = Get-RequestDetails $ID $Key $RequestRef $MessageBody = "" if($null -eq $Request.Params.primaryEntityData) { $MessageBody += "Request $($RequestRef) not found." } else { $RD = $Request.Params.primaryEntityData.record if ($RD.h_fk_team_id -ne $TeamID) { $MessageBody += "Request $($RequestRef) isn't owned by $($TeamName), so can't be taken by a user in this Team." } else { Set-HB-Instance -Instance $ID -Key $Key Add-HB-Param "inReference" $RequestRef Add-HB-Param "inAssignToId" $OwnerID Add-HB-Param "inAssignToGroupId" $TeamID $Timeline = @{ "updateText" = "''Assigned by $($OwnerName) via Microsoft Teams''" "source" = "teams" "extra" = @{ "h_ownername" = $OwnerName "h_fk_team_id" = $TeamID "h_group_name" = $TeamName } "visibility" = "trustedGuest" } $TimelineJSON = $Timeline | ConvertTo-JSON Add-HB-Param "updateTimelineInputs" $TimelineJSON $APICall = Invoke-HB-XMLMC "apps/com.hornbill.servicemanager/Requests" "assign" if ($APICall.Status -eq "ok") { if ($null -ne $APICall.Params.assignError -and $APICall.Params.assignError -ne "") { $MessageBody = "An error occurred when attempting to assign the request." } else { $MessageBody = "$($RequestRef) has been assigned to you in $($TeamName)" } } else{ $MessageBody = "An error occurred when attempting to assign the request." } } } $bodyObj = @{ "type" = "message" "text" = $MessageBody } return $bodyObj } run.ps1: if ($Request.Body.text -like '*update request*') { $StringArray = $Request.Body.text -split "update request",2 $ContentString = $StringArray[$StringArray.Count - 1].TrimStart() $ContentArray = $ContentString -split " ",2 $bodyObj = Update-Request $InstanceName $InstanceKey $User.displayName $ContentArray[0] $ContentArray[1] $TeamDetails.Params.id $TeamDetails.Params.name $body = $bodyObj | ConvertTo-Json -Depth 4 } If a call is assigned to a colleague in my team and I invoke @Hornbill take request IN0012345 for example, I expect that call to be taken from them and assigned to me. What happens instead is the the call gets taken from the owner and assigned back into the main queue for my team, rather than being directly assigned to me. How do I take from one owner and assign to another?
  4. Evening all, almost Friday! New Hornbill Service Manager customer here. I'm currently trying to get my BPM workflow to move past a "Wait on Request Update" suspend node by updating it using PowerShell and the API but I'm hitting an issue and was hoping someone could steer me in the right direction. Up to now I've been able to update the requests using Requests::update to make a number of changes but this doesn't appear to progress the flow past the suspend node. I've also attempted updating the description field via the API while using the "Wait for Request Description" task in the flow but this too didn't go anywhere. This is the code I'm using to do the update to the description field in this case. # Build XMLMC API call Add-Param "requestId" "SR00000646" Add-Param "h_description" "Updated AGAIN!" $xmlmcOutput = Invoke-XMLMC "apps/com.hornbill.servicemanager/Requests" "update" -Verbose Is there a different method I should be using to fulfil the update action that the suspend node is waiting on? Many thanks Brendan
  5. I have been writing code to run, check and retrieve reports using the Hornbill API (via a PowerShell script), and this all works fine. However a couple reports have filters like "Requests -> Date Logged value is less than <User prompted input>". Is It possible to pass the "<User prompted input>" values when using the API, e.g. using something like the 'runtimeParameter' input parameter? If so how would I go about doing this? I've had a look at the source code for the 'goHornbillReportRunner-master' but the report runner doesn't include an option for this. Any advice would be useful, even confirming if this isn't possible would help as it would stop me barking up a none existent tree. Cheers Tom
  6. Hello, I was wondering if someone can have a look at the following script and let me know if I am overcomplicating things? I understand that using SQL is frowned upon in most cases... but since I dont have a full understanding of Integrations, and our Integrations Officer has left we are unable to proceed with using any proper methods... and I know Powershell to an extent which leads me to writing this. I am trying to create a powershell script that runs during logon (it works!) but i am updating the Computer Assets table using SQL. Can you advise me on what I should have done instead? Or is this actually ok? clear-host Import-Module "C:\users\samwoo\Documents\WindowsPowerShell\Modules\xmlmcmodule\xmlmcModule.psm1" Import-Module ActiveDirectory # Retrieve the Laptop ID $laptopID = $env:computername # Retrieve the current logged on user $currentUsername = $env:USERNAME # Get the current date and time in the right format $dateTimeNow = Get-Date -Format "yyyy-MM-dd hh:mm:ss" # UNUSED - Retrieve the model number ofthe laptop $laptopModel = ($model = Get-WmiObject -Class Win32_ComputerSystem -Property Manufacturer, Model).model # Define instance connection details & API key for session authentication $hbInstance = "(INSTANCE)" $hbZone = "eur" $hbAPIKey = "(API KEY)" Set-Instance -Instance $hbInstance -Key $hbAPIKey -Zone $hbZone # Get the list of users in Hornbill $xmlmcOutput_userList = Invoke-XMLMC "data" "getUserList" # Narrow the list of users to those with the same username as the current logged in user # and retrieve the name of the user set in Hornbill $userDisplayName = ($xmlmcOutput_userList.Params.userInfo | Where-Object {$_.userid -eq $currentUsername}).name # Checks to see whether the user exists in Hornbill if ($userDisplayName -eq $null) { Write-Verbose "User does not exist in Hornbill!" exit } elseif (($userDisplayName | Measure-Object).Count -gt 1) { Write-Verbose "For some bizarre reason this user $currentUsername exists more than once in Hornbill!!" exit } else { $username = $userDisplayName + ":" + $currentUsername } # Update the laptop asset in Hornbill to input the name of the current user and they date / time they last logged in to it Add-Param "query" "UPDATE h_cmdb_assets_computer SET h_last_logged_on = '$dateTimeNow', h_last_logged_on_user = 'urn:sys:0:$username' where h_name like '%$laptopID' LIMIT 1" $xmlmcOutput_updateAsset = Invoke-XMLMC "data" "sqlQuery" -ErrorAction SilentlyContinue if($xmlmcOutput_updateAsset.status -ne "ok") { # API call status not OK - return status and error to console "API Call Status : " + $xmlmcOutput_updateAsset.status "Error Returned : " + $xmlmcOutput_updateAsset.error } Remove-Module xmlmcModule Many thanks, Samuel
×
×
  • Create New...