PowerShell app deployment toolkit – Check if Skype/Lync is in Presentation mode

Lately, Ive been working on a solution how to block installations when users are presenting anything on Skype/Lync. And its all possible with PowerShell isnt it?
So this solution will cancel the installation, with no user interaction.

Let’s start with the requirements.
Knowledge how Powershell app Deployment toolkit works
Skype/Lync 2013, 2016. Could work with older and higher, let me know if it works with other versions.

  1. First Download the App Deployment toolkit on the website here or if you have your App Deployment toolkit already, with some customizations already
    https://github.com/PSAppDeployToolkit/PSAppDeployToolkit/releases

  2. Extract it, and copy it to your working directory. Maybe on a Test client first.


  3. Ok, Now we need some Skype/Lync .DLL files, to see if the user is presenting or not. Download the lyncdll.zip and extract it
    lyncdll.zip

  4. Put these files into the SupportFiles Folder


  5. Now we need a script that checks for the presentation is running. 
    Download the Test-lyncpresentation and extract it.
    Test-Lyncpresentation.zip

  6. Put this script also in the SupportFiles Folder


  7.  Now we need to add a function to our script. So we gonna replace this file AppDeployToolkit\AppDeployToolkitExtensions.ps1″ with a new one.
    If you have some functions before, be sure to also copy them into the new file. 
    Download the appdeploytoolkitextensions.zip and extract it
    appdeploytoolkitextensions.zip

  8. Put the AppDeployToolkitExtensions.ps1 into the AppdeployToolkit folder and replace the file.


  9. Now we need to edit the Deploy-Application.ps1 file, Go to the steps just after “Pre-Installation” add these rows

    $testlyncpresentation = test-lyncpresentation
    if ($testlyncpresentation -eq “$true”
    {
    [boolean]$configShowBalloonNotification = $false
    Exit-Script -ExitCode “60124”
    }

  10. If you don’t want to do all these steps, I’ve uploaded a working Ap
    Deployment Toolkit for you guys, You can find it here
    toolkit-with-skype-block.zip

  11. DONE!

    When you guys have done all these steps, you can just work as you always do on the app deployment toolkit. Good luck!
    /Pontus

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s