PowerShell & BlackBerry 10 Web Services (Part 2 – Coding)

In my first post, I explained how to get started with the BlackBerry 10 Web Services. Mostly it revolves around downloading and compiling a DLL that contains all the BlackBerry Web Service objects.

In this post, I’ll be going over the PowerShell code that I wrote to leverage this DLL.

We’re going to start with the most basic setup where I clear out all of the previous run information, and declare the variables that are needed for the sample.

Next, I’ll try and build the authenticator for use with BWS

Part of what we’ll need going forward is the Encoded Username – don’t ask my why this is done this way, it just is.

Next we’ll assembly the credentials for the BlackBerry Web Service in a super simple function

Next is sending the authentication to the BlackBerry Web Service

Next, I really did follow the example almost to the letter and created the “echo” function

Last Function: Build the Get-BesUser function

And finally, the main “program” that calls all of these functions using both BlackBerry Administration and Active Directory Authentication…

The last thing that I really need to do is adapt the Get-BesUser function so that I can request a search based on other criteria.  This is just the first rough draft of this, so keep the postings flagged so that I can provide more scripts as I develop them.

Trust Web Certificate Script

 

3 thoughts on “PowerShell & BlackBerry 10 Web Services (Part 2 – Coding)

  1. Thanks for sharing, very useful blog post !
    I’ve a question about the authentication : all BWS documentations and blog posts use plain text login and password.
    In a Active Directory context, is there any way to use currently logged user’s credentials ?

  2. Hello Kevin
    Thanks for great write up!
    you are referncing 2 powershell scrips in the doc(specifically referencing . “D:ScriptsWebServicesNew-TrustAllWebClient.ps1” in the copde); “New-TrustAllWebClient.ps1” and “Bes10WebServices.ps1” can you advise if those files are downloadable?(url does not have any results). Or if the code you explained is to be broken up into two scrips can you advise how to break it up?

    thanks in advance.

    M

    • Sorry – I just realized that my attached scripts didn’t upload when I moved my website. I’ve added the New-TrustAllWebClient.ps1 script to the body. The other script is just the embedded parts stitched together. Let me know if you need any additional help.

Leave a Comment