Forum / Remote Desktop Manager - PowerShell Repository

How to use PowerShell with Office 365 through RDM

  • Create an Issue
  • Cancel

We are having an issue turning on logging. We access 365, on the cloud, through Remote Desktop Manager. When I click on "Turn on Auditing" I get an error message the below error message. Can you please direct me on how to resolve this issue? We found some PowerShell codes to use, but are not sure how to use them through RDM?

Request: /api/adminauditlogconfig/EnableUnifiedAuditLogIngestion Status code: 500 Exception message: {"Message":"The command you tried to run isn\u0027t currently allowed in your organization. To run this command, you first need to run the command: Enable-OrganizationCustomization.","DiagnosticContext":"{Version:16.00.2887.002,Environment:EUSPROD,DeploymentId:834424bdb07d426a86cb82fbec40dad0,InstanceId:WebRole_IN_0,SID:bb91a381-6633-40d7-b2b4-2a9dc905aae0,CID:7aacd4a4-5076-449b-a986-6275757d0d52}","Time":"2019-02-25T19:04:23.894413Z","ExceptionType":"Microsoft.Exchange.Configuration.Tasks.InvalidOperationInDehydratedContextException","ExceptionData":{"Source":"AdminAuditLogConfig"}} Diagnostic information: **{Version:16.00.2887.002,Environment:EUSPROD,DeploymentId:834424bdb07d426a86cb82fbec40dad0,InstanceId:WebRole_IN_0,SID:bb91a381-6633-40d7-b2b4-2a9dc905aae0,CID:dbc9bbe0-075e-4d93-a473-38b7dc1d940d} Time: 2019-02-25T19:04:52.603Z

Clock9 mths

Hello,

What RDM version are you using?

Is the "Turn on Auditing" an option on the Office365 portal?

Could you please tell me what kind of PowerShell script you need to run? Maybe it's a script to enable a specific parameter of your Office365 configuration.

Best regards,



Érica Poirier

signaturesignature

Clock9 mths

RDM is version 14.1.3.0 64-bit

I can see a button that says "Turn on Auditing" at the top of the page. When I click on it I get the error I mentioned before. What I really need to know is how to turn on auditing?

I found some websites like this one https://cloudsupport.exclaimer.com/hc/en-us/articles/115002834769-Enable-OrganizationCustomization-is-prompted-during-the-Office-365-connector-setup-wizard , that state that there are powershell commands to correct this issue, but I don't know how to use powershell for office 365 cloud through RDM.

Of course, if there's another way, I would be up for that too.

Lin

Clock9 mths

Hello,

It seems to be an easy straight forward procedure. There is no need to use RDM to run that script. You can just open PowerShell on your computer and follow the instructions. But if you want to do it in RDM, please go in Tools - PowerShell (RDM CmdLet) to open the embedded PowerShell command prompt in RDM.

image

Then just enter the commands as stated in the article and this should enable the required option. As stated in the articvle, you just need to run this once.


Best regards,



Érica Poirier

signaturesignature

Clock9 mths

I have the rest of the puzzle, for anyone else having this issue. After conversing with Office 365 support and looking at the website referenced above, along with the assistance received here, this is the solution.

  • Write down the username and password for the company you're working with


  • In RDM, click on Tools/PowerShell


  • Run this command : $UserCredential = Get-Credential
  • Enter the username and password


  • Run this command : $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection


  • Run this command : Import-PSSession $Session -DisableNameChecking


  • Run this command : Set-ExecutionPolicy RemoteSigned -scope CurrentUser


  • Run this command : Enable-OrganizationCustomization


  • Wait 4 hours


  • Run this command : Set-AdminAuditLogConfig -UnifiedAuditLogIngestionEnabled $true


  • Wait another hour


  • Logging should now be working


  • When finished, log out by running this command : Remove-PSSession $Session
  • Clock9 mths

    Hello,

    Thank you for the information and glad that it's working as you expected now.

    Best regards,



    Érica Poirier

    signaturesignature

    Clock9 mths