0 votes

I am trying to automate some of my o365 scripts so that the helpdesk can run them with elevated permissions and not have that access directly in o365. How do I create a powershell session, automatically passing the 'Run As' Adaxes service account that the custom command is using?

This is what I have so far, but it errors out.

In the powershell script editor it gives me an error 'Cannot process argument transformation on parameter 'Credential'. A command that prompts the user failed because the host program or the command type does not support user interaction.

If I add this custom powershell command to my admin web portal, it errors with:
[ClientAccessServer=MWHPR03CA0014,BackEndServer=,RequestId=9f048b98-c830-4bef-832f-b24b0bf672f5,TimeStamp=11/23/2018 5:20:55 PM] [FailureCategory=LiveID-InvalidCreds]

#Connect to Office 365/MSOL
$o365Credentials = $Context.GetOffice365Credential()
$session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $o365Credentials -Authentication Basic -AllowRedirection
Import-PSSession $session -AllowClobber -DisableNameChecking

by (410 points)

1 Answer

0 votes
by (410 points)
selected by
Best answer

This can be disregarded. I believe my issue was with the 'Cloud Services / Office 365' settings. I adjusted my associated active directory scope and I am able to connect to o365 and MSOL now.

Related questions

0 votes
1 answer

Is it possible to connect to the Microsoft 365 Security & Compliance center through a PowerShell script? We are trying to configure users that belong to a ... department for a retention policy through the use of the Set-RetentionCompliancePolicy command.

asked Jan 3 by scoutcor (100 points)
0 votes
1 answer

Hi, We encounter an error on one of our Adaxes service (Adaxes 2016 3.7.13430) when activating Licence for new user : Softerra.Adaxes.CommandPipeline.CommandProcessingException: The ... stack trace --- Any idea ? Thank you in advance for your help regards

asked Sep 20, 2017 by smasset (730 points)
0 votes
1 answer

I am getting the following error within Adaxes when I try to connect to my Office 365 tenant or run any powershell scripts against it. Failed to create an Office ... .Runspaces.InitialSessionState' threw an exception. Does anybody have a solution for this :?:

asked Jun 17, 2015 by rmedeiros (360 points)
0 votes
1 answer

In our environment, we have dirsync setup to assign the Office365 username based on the email property of the on-prem user. In Adaxes, if a newly created user doesn' ... instead utilize a property of our choosing? Currently using product version: 3.10.15918.0

asked Nov 8, 2018 by blaiseb (120 points)
0 votes
1 answer

Hello, I'd like setup a new custom command on the Administrator dashboard that would run the following tasks against a disabled user account simultaneously. Enable their account ... the email when using the %unicodePwd% value. Is there a workaround for this?

asked Apr 23, 2020 by sirslimjim (400 points)
2,779 questions
2,512 answers
6,574 comments
26,511 users