Share via

Orchestrator and Azure AD/Graph Powershell SCript

James Quigley 1 Reputation point
2022-10-03T14:53:58.287+00:00

Hi all,

Currently running a PowerShell script that uses MSAL Token and Graph API to update licensing and other information in Azure AD. I was hoping to be able to put it into orchestrator but I receive some errors and I am newer to all this stuff..

"Could not load file or assembly 'file:///C:\Windows\system32\WindowsPowerShell\v1.0\Modules\MSOnline\1.1.183.57\Microsoft.Online.Administration.Automation.PSModule.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format."

Running normally through ISE the script works fine. I can go to that location and verify the DLL is there and exists, but It doesnt seem to work still. Any help would be great!

Community Center | Not monitored

1 answer

Sort by: Most helpful
  1. Andreas Baumgarten 132.1K Reputation points MVP Volunteer Moderator
    2022-10-03T15:07:01.927+00:00

    Hi «JamesQuigley-5324 ,

    Which version of System Center Orchestrator (SCORCH) are you running?

    All SCORCH versions before 2022 are using the 32-bit PowerShell. To start a 64-bit version of a PowerShell in a SCORCH Run .Net Activity you can use this:

    Invoke-Command -ScriptBlock {<Add your code here>} -ComputerName localhost  
    

    You could test this with starting a 32-bit ISE and run you script with the Invoke-Command cmdlet.

    ----------

    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Regards
    Andreas Baumgarten

    Was this answer helpful?

    1 person found this answer helpful.

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.