0 votes

Hello smart people!

I've been tasked with removing the ability in Office365 for users to record their Skype meetings. I have the PowerShell to make that happen via the ISE console, but when I try to make it into a custom command in Adaxes, it fails.

My team had previously been tasked with inactivating Yammer in Office365, which worked for quite a while until (I think) updating to the latest version of Adaxes. I tried using the "kill yammer" script as a template for my "kill skype recording" script, but I think in both cases, the issue is that something has changed in the way that Adaxes opens sessions to connect to the needed consoles.

Here's my working PowerShell to set the Skype policy to "no recording" via the ISE:

 #  KILL SKYPE RECORDING - ISE

 #  Get Credential

    $Cred = Get-Credential

    try
    {  

 #  Connect to LyncOnlineConnector Service

    Import-Module LyncOnlineConnector
   $lyncSession = New-CsOnlineSession -Credential $Cred
   Import-PSSession $lyncSession -AllowClobber

 #  Set the Conferencing Policy to “No Record”

    Grant-CsConferencingPolicy -identity TESTUSERGOESHERE -PolicyName BposSAllModalityNoRec

    }

    finally   
    {
        # Close the remote session and free up resources
        Remove-PSSession $lyncsession
    } 

Here's the script that USED to work for "kill yammer":

 #  KILL YAMMER - ADAXES

    # Get credentials of the Office 365 tenant associated with the user
    $adminName = $Context.RunAs.UserName
    $adminPassword = ConvertTo-SecureString -AsPlainText -String $Context.RunAs.Password -Force

    $o365Credential = New-Object System.Management.Automation.PsCredential($adminName, $adminPassword)
    try
    {    

    # Create a remote PowerShell session to Exchange Online
    $session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri "https://ps.outlook.com/powershell-liveid" -Credential $o365Credential -Authentication Basic -AllowRedirection
    Import-PSSession $session -AllowClobber -DisableNameChecking

    # Connect to MSOL Service
    Import-Module MsOnline
    Connect-MsolService -Credential $o365Credential

    # Remove Yammer License
    Set-MsolUserLicense -UserPrincipalName "%userPrincipalName%" -LicenseOptions (New-MsolLicenseOptions -AccountSkuId "actinc:EnterprisePACK" -disabledplans YAMMER_ENTERPRISE)
    Set-MsolUserLicense -UserPrincipalName "%userPrincipalName%" -LicenseOptions (New-MsolLicenseOptions -AccountSkuId "actinc:StandardPACK" -disabledplans YAMMER_ENTERPRISE)
    }
    finally   
    {
        # Close the remote session and free up resources
        Remove-PSSession $session
    }

Here's my combination of the two:

 #  KILL SKYPE RECORDING - ADAXES

    # Get credentials of the Office 365 tenant associated with the user
    $adminName = $Context.RunAs.UserName
    $adminPassword = ConvertTo-SecureString -AsPlainText -String $Context.RunAs.Password -Force

    $o365Credential = New-Object System.Management.Automation.PsCredential($adminName, $adminPassword)

    try
    {  

    #  Connect to LyncOnlineConnector Service

   Import-Module LyncOnlineConnector
   $lyncSession = New-CsOnlineSession -Credential $o365Credential
   Import-PSSession $lyncSession -AllowClobber

    #  Set the Conferencing Policy to “No Record”

    Grant-CsConferencingPolicy -identity "%userPrincipalName%" -PolicyName BposSAllModalityNoRec

    }
    finally   
    {
        # Close the remote session and free up resources
        Remove-PSSession $lyncSession
    } 

And here's the error it returns, when I run this as a custom command:

  • Skype Conferencing - Disable: 1 operation executed
    -- Run PowerShell script '-PolicyName BposSAllModalityNoRec' for the user
    --- Cannot bind argument to parameter 'String' because it is null.
    --- Exception calling ".ctor" with "2" argument(s): "Cannot process argument because the value of argument "userName" is invalid. Change the value of the "userName" argument and run the operation again."
    --- The specified module 'LyncOnlineConnector' was not loaded because no valid module file was found in any module directory.
    --- Cannot validate argument on parameter 'Id'. The argument is null. Supply a non-null argument and try the command again.
    --- The term 'New-CsOnlineSession' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

At the end of the day, I just need to have the two scripts, "kill yammer" and "kill skype recording", working. Any assistance in replacing or re-writing would be greatly appreciated!!

by (150 points)
0

UPDATE: Another solution has been found for Yammer, so I DON'T need a solution for that; I will leave the script up for that, just for context.

I am still struggling with the "kill Skype recording" script though - please share your thoughts or suggestions :mrgreen:

1 Answer

0 votes
by (270k points)
selected by
Best answer

Hello Jake,

Have a look at the following script in our repository: http://www.adaxes.com/script-repository ... e-s288.htm.
You will need to uncomment the following line:

$policyName = "Tag:BposSAllModalityNoRec".

0

Thanks Support2.

Some after-hours reconnaissance of our Adaxes server makes me thing that we don't the PowerShell module needed for the LyncOnlineConnector installed - any FAQ or guides you could point me to for installing new PowerShell modules and making them available to Adaxes?

I did take a browse through the FAQ and Help in the console itself, but didn't come up with anything.

0

Hello Jake,

To run the script you need to download and install Skype for Business Online Connector Module on the computer where your Adaxes service runs. The Module requires PowerShell 3.0 or higher. You can download the Module here: https://technet.microsoft.com/en-us/lib ... 15%29.aspx.

0

Makes perfect sense to me! :mrgreen:

One question - when I install this module on my PC, it does not require a reboot, but DID require me to close and re-open the PowerShell ISE in order for the cmdlets to become available. Will there be any special steps needed after installing the module, in order to make the cmdlets visible/usable for Adaxes? Any services to stop & start, etc?

Thanks!

0

Hello Jake,

We expect that everything should work without restarting. If you still receive the error that the module is not installed, try restarting Softerra Adaxes Service.

0

If you still receive the error that the module is not installed, try restarting Softerra Adaxes Service.

I DID have to restart the service, but after that, Custom Commands could use "Import-Module LyncOnlineConnector".

Now, the script that Support2 had recommended before, DOES WORK:

http://www.adaxes.com/script-repository ... e-s288.htm

Thanks Support2! :mrgreen:

Related questions

0 votes
0 answers

Upgraded to the latest adaxes release yesterday and now this morning we are not able to access our self-service portal. We have rebooted our server and verified our adaxes service is successfully connected our domains. Any help would be appreciated, thank you!

asked Mar 14 by dhodgin (40 points)
0 votes
2 answers

Dear Support, can you advise if it's possible to connect to Adaxes from PowerBI? To have access (read) for the Adaxes custom attributes? Thank you!

asked May 13, 2020 by Dmytro.Rudyi (920 points)
0 votes
1 answer

Dear Support, can you please clarify - to call adaxes custom commands from "other" machines via following code - Adaxes PS module needs to be installed or ... -Object "Softerra.Adaxes.Adsi.AdmNamespace" $admService = $admNS.GetServiceDirectly("xxx") Thanks!

asked Oct 9, 2019 by Dmytro.Rudyi (920 points)
0 votes
1 answer

I am trying to configure Adaxes to talk to my O365 Tenant. Following the guide here - https://www.adaxes.com/tutorials_Active ... ice365.htm - I am getting stuck on the ... the same rights that I have set on the service account) Is anybody able to help?

asked Jun 13, 2019 by lucaswhizz (50 points)
0 votes
1 answer

Hi I'm trying to connect to remote Adaxes service from C# program. Using sample code from "Writing ADSI scripts" page in the docs. Added DLLs, here is my code: static void Main( ... adsNS = new AdmNamespace(); I'm not sure which config file it's asking for. V.

asked Feb 5, 2018 by xirurg (100 points)
3,326 questions
3,025 answers
7,724 comments
544,676 users