Runtime Exception When Using Set-OrganizationConfig

Rhys Pickett 40 Reputation points
2024-07-17T11:36:20.5+00:00

Trying to run Set-OrganizationConfig cmdlet in powershell EXO V3 module returns runtime exception: "unable to find type [uint]". Has anyone had this error before and know of a potential solution? I cannot find anything online to reference this.

I can run Get-OrganizationConfig absolutely fine. I can see other topics with people being able to run the get cmdlet and not the set cmdlet - their solution was permissions based. I have checked my permissions and I am part of the Compliance Administrators group and also I am a part of the tenant admin group, so I think permissions should suffice for what I'm trying to achieve here.

Many thanks for reading - any help greatly appreciated

Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,386 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,328 questions
{count} vote

Accepted answer
  1. Karelpelck 635 Reputation points
    2024-07-17T11:53:47.03+00:00

    Hey Rhys,

    There are few things you can try.

    1. Check if you have the same issue with a confirmed Global Admin.
    2. Check your execution policy. You can use "Set-ExecutionPolicy Bypass -Scope Process" to temporarily bypass the policy within the scope of your current PowerShell session.
    3. Make sure you have all dependancy modules installed and imported.
    4. I'm not sure what parameter you are trying to set. But it could be a type mismatch in your command when setting the value for one of the attributes in the command.

    If you can give us more insight in the attributes/parameters you try to run the command with, we could identify the issue more clearly.

    Hope this helps you to resolve your issue.

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Rich Matheisen 45,906 Reputation points
    2024-07-17T15:35:03.1433333+00:00

    PowerShell 5.1 doesn't understand the abbreviated "uint" type. It never has. You can use "uint64", "uint32", or "uint16".

    "int", for example, is a type "accelerator". It isn't a "real" type. "Int32" is a real type. But there's no "uint" type accelerator.

    @Andy David if that worked before it was probably a change in the cmdlet, not PowerShell, that caused the problem.

    Looking at the Set-OrganizationConfig help, I only see "Int32" types. Knowing what values were fed to the cmdlet might help (maybe),