Can azure powershell be utilitized to bulk update start/end time of users roles?

Marvin 1 Reputation point

In the middle of finishing an audit. Looking for ways to script the start/end time of assigned roles whether then doing manual. I’m not finding any documentation specifically geared towards.

Microsoft Entra
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Marilee Turscak-MSFT 36,246 Reputation points Microsoft Employee

    Hi @Marvin ,

    Yes, you can use Powershell to set the StartDateTime and EndDateTime.


    $schedule = New-Object Microsoft.Open.MSGraph.Model.AzureADMSPrivilegedSchedule  
    $schedule.Type = "Once"  
    $schedule.StartDateTime = (Get-Date).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ss.fffZ")  
    $schedule.endDateTime = "2020-07-25T20:49:11.770Z"  

    This is covered in the PowerShell for Azure AD roles in Privileged Identity Management guide. I couldn't find an official example that shows how to do this in bulk, but there's a blog post with an example of this here.

    Let me know if this helps!

    0 comments No comments