Forum Discussion

Jeroen Bestebreurtje's avatar
Jeroen Bestebreurtje
Copper Contributor
Oct 10, 2018

Enable Admin roles in O365 - Enable-PrivilegedRoleAssignment

Hi,

I'm using Powershell to activate Admin roles in O365. Since a week the command below gives an error. Does anyone have an idea why it isn't working anymore?

 

Command:
Connect-PimService –UserName ""
$roleAssignmentsa = Get-PrivilegedRoleAssignment | Where {$_.RoleName -eq "SharePoint Service Administrator"}
Enable-PrivilegedRoleAssignment -TicketNumber "" -TicketSystem "" –Reason “” –Duration 8 –RoleAssignment $roleAssignmentsa

 

Error:

Enable-PrivilegedRoleAssignment : An error occurred while processing this request.
At line:1 char:1
+ Enable-PrivilegedRoleAssignment -TicketNumber "" -TicketSystem "" –Re ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Enable-PrivilegedRoleAssignment], DataServiceQueryException
    + FullyQualifiedErrorId : Microsoft.OData.Client.DataServiceQueryException,Microsoft.Azure.ActiveDirectory.PIM.PSModule.Cmdlets.EnablePrivilegedRoleAssignment

6 Replies

  • aasenomad's avatar
    aasenomad
    Copper Contributor
    Hi Jeroen, I know it's been a few years but just wondering did you able to figure it out because I'm facing the same issue?. I think this might be related to ticket and I heard that Microsoft haven't provide the perameter for it but just wondering if there is still work around to pass the ticket parameter.
  • Matthew Roerig's avatar
    Matthew Roerig
    Copper Contributor

    Hi Jeroen,

     

    Try running Get-PrivilegedRoleAssignment without any parameters to see what it returns. Also run $Error[0] | Select * to see more detail on the exception. It almost looks like the query is returning null.

    • Jeroen Bestebreurtje's avatar
      Jeroen Bestebreurtje
      Copper Contributor

      Hi Matthew,

      Thanks for your response, I've added two screenshots.

       

      The command  "Get-PrivilegedRoleAssignment" is returning the available Roles as expected.

Resources