Announcement

Collapse
No announcement yet.
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • benlrivera
    replied
    I am having issues with the command: Send-ShoreTelDirectorLogin

    I have been using it for months and now we are getting the following issue that it is not authenticating.

    Name Value
    ---- -----
    Authenticated False
    SessionType Director
    Server x.x.x.x
    SequenceId 1
    webClient CookieAwareWebClient

    What would cause this???

    Leave a comment:


  • eaccioly
    replied
    I am using the Get-ShoreTel_VMList and for any reason it works for some users and for others doesn't.

    I could see that when it works the function Send-Web_Post (code line below) returns a response 0. When it doesn't work returns a response -1055914153.
    $res = $webClient.UploadString($URL, $postData)

    This is what returns is $res when it works:
    {"topic":"vm","message":"get-msgs","timestamp":1562870976322,"sequence-id":8493947,"response":0,"vm-messages":[["msg-id","dur-msec","vm-folder","subject","recipients-list","senders-list","call-id","send-props","msg-flags","rcvd-timestamp","rcvd-localtime","sender-name","sender-number","sender-canonical"..]]}

    This is what returns is $res when it doens't work:
    {"topic":"vm","message":"get-msgs","timestamp":1562870976322,"sequence-id":8493947,"response":-1055914153}

    Do you have any idea why I am getting the response=-1055914153? Did you get this error before?

    Leave a comment:


  • lobo519
    replied
    Originally posted by crimson.falconer View Post

    Oh, that parameter shouldn't have been marked as mandatory.

    Agent Id is only needed if you want to set a different users workgroup login status (requires operator/workgroup supervisor license to do this), you can call the Get-ShoreTel_WorkgroupAgents function to get a list of agents with ext, id and status.

    I've committed a fix to the source control and released a new version with this parameter not mandatory and I also fixed a couple of other bugs related to workgroups as well.


    Planning on reworking the example flow to make them easier to follow.

    Thanks!! working great now!

    Leave a comment:


  • crimson.falconer
    replied
    Originally posted by lobo519 View Post
    I am trying to use the set-shoretel_workgroup but its asking for an agentid: only when logging in. Logout works fine..

    What is this looking for exactly?
    Oh, that parameter shouldn't have been marked as mandatory.

    Agent Id is only needed if you want to set a different users workgroup login status (requires operator/workgroup supervisor license to do this), you can call the Get-ShoreTel_WorkgroupAgents function to get a list of agents with ext, id and status.

    I've committed a fix to the source control and released a new version with this parameter not mandatory and I also fixed a couple of other bugs related to workgroups as well.


    Planning on reworking the example flow to make them easier to follow.
    Last edited by crimson.falconer; 08-12-2015, 05:21 PM.

    Leave a comment:


  • lobo519
    replied
    I am trying to use the set-shoretel_workgroup but its asking for an agentid: only when logging in. Logout works fine..

    What is this looking for exactly?
    Last edited by lobo519; 08-12-2015, 12:55 PM.

    Leave a comment:


  • crimson.falconer
    replied
    Originally posted by btgrant View Post
    We are using SA-100, so I think I am out of luck on this one. (packet capturing/XMPP... way beyond my capabilities)

    One followup question:
    I am playing with your 'Set Other Users CHM.ps1" to deploy to supervisors, but it uses the parameter -ext to address the phone. The "Set My CHM.ps1" doesn't use -ext, so it must look up the phone based on the session/user name. Some of our extensions seem to get reassigned fairly often because of department movements, but our UserIds are permanent. Would it be possible for you to create a parameter for Set Other Users to use "client username" as the target instead of -ext?

    Thanks again for all your help!
    I've added some modules regarding the SA-100 that should allow you to set the presence info on the SA-100, it doesn't support windows pass-through auth so it does require a username and password for it to function.

    ShoreTelXMPP\ShoreTelXMPP.psm1 These modules interact with a ShoreTel SA-100 so you can set the XMPP based presence and status notes.
    You must download the agsXMPP.dll from AG Software Solutions links below and copy the dll file into ShoreTelXMPP for these modules to work.
    http://www.ag-software.net/agsxmpp-sdk/
    http://www.ag-software.net/agsxmpp-sdk/download/

    New Modules
    New-XMPP_Session - Authenticate and create XMPP session object, agsXMPP doesn't support kerberos so no windows authentication pass-through
    Set-XMPP_Presence - Set your presence status and status note


    SA-100 Set Status.ps1 is an example of how you could use these modules.
    Last edited by crimson.falconer; 07-13-2015, 05:30 PM.

    Leave a comment:


  • crimson.falconer
    replied
    I've had a look at the ShoreTel Director modules file and the code doesn't supply a value to $headers so I'm not sure how that line was reached. Have you modified ShoreTelDirector.psm1?

    Try removing the four lines below starting at line 75 in the ShoreTelDirector\ShoreTelDirector.psm1 file that caused the exception

    Code:
            foreach($header in $headers)
            {
              $webClient.Headers.add($header.Name, $header.Value)
            }

    Also the username needs to be the client username on a shoretel extension that has been granted administrative permissions to shoretel director, the password must match their client password not their windows password and the user must not have been linked with an active directory user.

    Leave a comment:


  • hilcoen122
    replied
    My apologies for such a simple mistake.

    However, I made the suggested changes, but am still getting two errors.

    The code I ran is posted below:

    # Get the current script path
    function Get-ScriptPath
    {
    if ($PSScriptRoot) { return $PSScriptRoot }
    elseif ($psISE) { return split-path -parent $psISE.CurrentFile.Fullpath }
    else { return Split-Path ((Get-Variable MyInvocation -Scope 1).Value).MyCommand.Path }
    }
    $path = Get-ScriptPath

    # if required add it to the module load path to environment variable
    if (!($env:PSModulePath -Split ";" -like $path)) { $env:PSModulePath += ";$path" }

    # Import the shoretel module
    Import-Module ShoreTelDirector -Force -Verbose

    #$session = Send-ShoreTelDirectorLogin -shoretelServer "172.22.6.10" -windowsAuth $true
    $session = Send-ShoreTelDirectorLogin -shoretelServer "<ip address>" -windowsAuth $false -user "u/n" -pass "p/w"
    $session.Authenticated

    $extension = Read-Host "Extension to get"

    if($extension -ne '')
    {
    $result = Get-ShoreTelDirectorUser -extension $extension -session $session
    if($result)
    {
    $result | fl
    }
    }

    When I click run, gives me the first error below, prompts me for the extension to get, and then gives me the second error.

    Exception calling "Add" with "2" argument(s): "The parameter 'name' cannot be an empty string.
    Parameter name: name"
    At <path to modules>\ShoreTelDirector\ShoreTelDirector.psm1:77 char:33
    + $webClient.Headers.add <<<< ($header.Name, $header.Value)
    + CategoryInfo : NotSpecified: ( [], MethodInvocationException
    + FullyQualifiedErrorId : DotNetMethodException

    False
    Session not authenticated
    At <path to modules>\ShoreTelDirector\ShoreTelDirector.psm1:21 2 char:41
    + if(!($session.Authenticated)){ Throw <<<< "Session not authenticated" }
    + CategoryInfo : OperationStopped: (Session not authenticated:String) [], RuntimeException
    + FullyQualifiedErrorId : Session not authenticated

    Any suggestions?

    Leave a comment:


  • crimson.falconer
    replied
    A # at the start of a line in powershell comments out that line. So make sure you comment out the line above and uncomment out the line using basic auth.

    Change from this
    Code:
     $session = Send-ShoreTelDirectorLogin -shoretelServer "x.x.x.x" -windowsAuth $true
     #$session = Send-ShoreTelDirectorLogin -shoretelServer "x.x.x.x" -windowsAuth $false -user "myuser" -pass "password"
     $session.Authenticated
    to
    Code:
     #$session = Send-ShoreTelDirectorLogin -shoretelServer "x.x.x.x" -windowsAuth $true
     $session = Send-ShoreTelDirectorLogin -shoretelServer "x.x.x.x" -windowsAuth $false -user "myuser" -pass "password"
     $session.Authenticated

    Leave a comment:


  • hilcoen122
    replied
    Forgive me. I am new to powershell.

    I downloaded your latest modules from download repository. I have been able to successfully modify the powershell scipts that use the Shoretel module. However, I have not had any success with the scripts that use the Shoretel Director module.

    We use ShoreTel 14.2 (Build 19.44.4300.0). I am able to log into the Shoretel Director web interface by browsing to "http://<our ip>/shorewaredirector/login.asp" and entering my System Admin username and password (not using AD account, simply an System Admin account created in Shoretel Director). However, when I attempt to modify "Get User ShoreTel Director.psm1" by inputting my u/n and p/w into the below line, it throws a not authenticated error.

    #$session = Send-ShoreTelDirectorLogin -shoretelServer "<ip address>" -windowsAuth $false -user "myuser" -pass "password"
    $session.Authenticated

    Any suggestions?

    Leave a comment:


  • crimson.falconer
    replied
    Originally posted by btgrant View Post
    We are using SA-100, so I think I am out of luck on this one. (packet capturing/XMPP... way beyond my capabilities)

    One followup question:
    I am playing with your 'Set Other Users CHM.ps1" to deploy to supervisors, but it uses the parameter -ext to address the phone. The "Set My CHM.ps1" doesn't use -ext, so it must look up the phone based on the session/user name. Some of our extensions seem to get reassigned fairly often because of department movements, but our UserIds are permanent. Would it be possible for you to create a parameter for Set Other Users to use "client username" as the target instead of -ext?

    Thanks again for all your help!
    I'll put it in my notes to look at the SA-100 again at later date.


    Actually ShoreTel sets your CHM by default if an extension number is not supplied. Extension because that is what's required by the json api.

    I've created another example that works kind of like you requested. Users can't actually query another person's Client username but you can search for contacts and that is one of the fields used to filter results.

    The example below searches for the contact and if it finds only one result sets the CHM, there is a flag (allowMultiple) you can set to true if you want to allow multiple results but be careful as it will set the CHM for each contact it finds

    I think contact point type 16 is a shoretel extension hopefully it's used consistently.

    Source

    Leave a comment:


  • btgrant
    replied
    We are using SA-100, so I think I am out of luck on this one. (packet capturing/XMPP... way beyond my capabilities)

    One followup question:
    I am playing with your 'Set Other Users CHM.ps1" to deploy to supervisors, but it uses the parameter -ext to address the phone. The "Set My CHM.ps1" doesn't use -ext, so it must look up the phone based on the session/user name. Some of our extensions seem to get reassigned fairly often because of department movements, but our UserIds are permanent. Would it be possible for you to create a parameter for Set Other Users to use "client username" as the target instead of -ext?

    Thanks again for all your help!

    Leave a comment:


  • crimson.falconer
    replied
    Originally posted by btgrant View Post
    Thank you again for making these PowerShell modules available, they have been a great help! We use the Get-ShoreTel_CallHandlingMode from a program on each user's desk and it works great.

    The users have requested the ability to also update their Instant Messenger Status note field. Is this a possibility via PowerShell?

    Thanks
    Glad to hear they're getting used.

    I can add pretty much anything the web client can do but the web client doesn't support any of the IM connectivity so I could write the modules but it would essentially be writing them for OCS/Lync or an SA-100.

    How hard it is to setup depends on what IM server type you're using SA-100 or OCS/Lync

    - If you're using a OCS/Lync server you can use Microsoft developed modules to set IM status https://msdn.microsoft.com/en-us/lib...ice.14%29.aspx

    - If you're using the SA-100 conferencing system it uses some form of XMPP. I played around with for a while but never finished code is included in the repo but you'll need to download agsXMPP.dll and point it to the correct place and probably setup some packet capturing to see what ShoreTel Communicator is using to set IM status

    - Client automation using AutoIT, windows APIs

    Leave a comment:


  • btgrant
    replied
    Thank you again for making these PowerShell modules available, they have been a great help! We use the Get-ShoreTel_CallHandlingMode from a program on each user's desk and it works great.

    The users have requested the ability to also update their Instant Messenger Status note field. Is this a possibility via PowerShell?

    Thanks

    Leave a comment:


  • willthetech
    replied
    Thanks for your help...I'll give it a try

    Leave a comment:

Working...
X