question

Marvin-2045 avatar image
0 Votes"
Marvin-2045 asked MarileeTurscak-MSFT answered

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

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.

azure-ad-privileged-identity-management
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

MarileeTurscak-MSFT avatar image
0 Votes"
MarileeTurscak-MSFT answered

Hi @Marvin-2045,

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

Example:

 $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!


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.