App - Powershell

Trying to create a powershell command for enforcing MFA. We are a hybrid environment with on-prem syncing up to Office365. We have the automation working to create users and assign licensed but one thing we have to do is use Powershell to enforce MFA via the automaton.

We are able to tell the payload to use a username or password (or use an xml from a file to obfuscate the credentials) but within the command we are also pulling username.

We are getting an error (screenshot below) saying “You must provide all required fields (endpoint , shell)”

Any idea what that means?

Command (minus our creds)

Import-Module MSOnline
Connect-MSolService -Credential $psCred
$sa = New-Object -TypeName Microsoft.Online.Administration.StrongAuthenticationRequirement
$sa.RelyingParty = “*”
$sa.State = “Enforced”
$sar = @($sa)
Set-MsolUser -UserPrincipalName {{ticket.user_to_resetenforce_automation}} -StrongAuthenticationRequirements $sar

Above where it is shows {{Ticket.user_to…) is a custom field to allow the agent to clearly specify the users email address to associate the request.

It looks like the screenshot is missing.

@Jasonbesner, I am not well-versed with Powershell. Can you let me know which endpoint are you calling for this request? The REST API docs mention the required fields for each endpoint. Likely, the request does not include some of them.

Hey there,

Thanks for the response. I looked through the code for the App integration and it seems to not have authentication methods. Since it is a published app in the marketplace, i dont think I can manipulate the requests it can handle.

@Jasonbesner, I might not have understood the use case here. I assumed you were trying to send an HTTP request to a Freshworks REST API using Powershell. Looking at your response, I am not sure where the published app comes in. :frowning_face:

Can you please explain the relationship between the API calls, Powershell, and the app you mentioned?

I wonder if this is related to Create ticket via powershell fails due to invalid responder_id.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.