<div dir="ltr"><div>If anyone is interested I made some progress on this. Currently it will disable the user but my next step is to have it only disable the projection.</div><div><br></div><div>Here is an example of the task:</div><div><br></div><div><task xmlns="<a href="http://midpoint.evolveum.com/xml/ns/public/common/common-3">http://midpoint.evolveum.com/xml/ns/public/common/common-3</a>"<br>      xmlns:c="<a href="http://midpoint.evolveum.com/xml/ns/public/common/common-3">http://midpoint.evolveum.com/xml/ns/public/common/common-3</a>"<br>      xmlns:q="<a href="http://prism.evolveum.com/xml/ns/public/query-3">http://prism.evolveum.com/xml/ns/public/query-3</a>"<br>      xmlns:s="<a href="http://midpoint.evolveum.com/xml/ns/public/model/scripting-3">http://midpoint.evolveum.com/xml/ns/public/model/scripting-3</a>"><br>    <name>Disable users last Google login over 2 years</name><br>    <ownerRef oid="00000000-0000-0000-0000-000000000002"/><br>    <executionState>runnable</executionState><br>    <activity><br>        <work><br>            <iterativeScripting><br>                <objects><br>                    <type>UserType</type><br>                    <query><br>                        <q:filter><br>                            <q:less><br>                                <q:path>extension/lastLogin</q:path><br>                                    <expression xmlns=""><br>                                       <script xmlns=""><br>                                          <code><br>                                              return basic.parseDateTime('yyyy-MM-dd', (basic.currentDateTime().getYear()-2) + '-' + (basic.currentDateTime().getMonth()-0) + '-' + (basic.currentDateTime().getDay()-0));<br>                                          </code><br>                                       </script><br>                                    </expression><br>                              </q:less><br>                        </q:filter><br>                    </query><br>                </objects><br>                <scriptExecutionRequest><br>                    <s:disable/><br>                </scriptExecutionRequest><br>            </iterativeScripting><br>        </work><br>    </activity><br></task><br></div><br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><p style="padding:0px;font-size:16px;line-height:1.6;color:rgb(75,73,69);font-family:caecilialtstd-roman,serif;font-weight:bold;margin:0px!important">Matt Widhalm</p><p style="padding:0px;font-size:16px;line-height:1.6;color:rgb(75,73,69);font-family:caecilialtstd-roman,serif;margin:0px!important"><br></p></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Feb 15, 2022 at 9:57 AM Matt Widhalm <<a href="mailto:matthewwidhalm@weber.edu">matthewwidhalm@weber.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">I am attempting to disable users by their last Google email login date. I am currently importing the last login date and account creation date from Google. I have created custom extensions for the attributes called creationDate and lastLogin. The data in the attributes is formatted as: 2021-01-08T00:04:09.000Z<div><br></div><div>Ultimately I would like to do the following:<div><br></div><div>-  If the users' last login is greater than 2 years from today's date, the Google account (projection) associated with the user will be disabled.</div><div>-  After 1 year of being disabled the projection associated with the user is deleted.</div><div><br></div><div>I suspect this would be handled using a scheduled task but that is about as far as my knowledge goes. If anyone has any experience with similar requirements any help would be appreciated.</div><div><br></div><div>Thank you,<br><div><br clear="all"><div><div dir="ltr"><div dir="ltr"><p style="padding:0px;font-size:16px;line-height:1.6;color:rgb(75,73,69);font-family:caecilialtstd-roman,serif;font-weight:bold;margin:0px">Matt Widhalm</p></div></div></div></div></div></div></div>
</blockquote></div>