0

I can see its possible to set expiration on groups via PowerShell. However I haven’t found any IP on adding specific groups to an expiration policy from c#. Any ideas how this can be performed? Ultimately through the graph API would be great.

Add retention to groups

New-AzureADMSGroupLifecyclePolicy -GroupLifetimeInDays 365 -ManagedGroupTypes All -AlternateNotificationEmails emailaddress@contoso.com

Thomas Segato
  • 4,567
  • 11
  • 55
  • 104
  • There seems to be an ActiveDS Com library that can be used for this. Looks like there's a related thread on this. You might be able to manually set maxPwdAge + pwdLastSet. https://stackoverflow.com/questions/3764327/active-directory-user-password-expiration-date-net-ou-group-policy – Marilee Turscak - MSFT Feb 08 '19 at 00:42
  • The post about settings a users password and expiration? I am looking for 365 group retention policies. Is this related? – Thomas Segato Feb 09 '19 at 09:15

1 Answers1

1

According the Group API documentation, the Graph API currently (as of Jan-2019) does support setting group lifecycle info.

If your requirement is purely about being able to do the above via C#, why now PowerShell.Invoke the above command from your c# app?

Michael Mainer
  • 3,387
  • 1
  • 13
  • 32