We have an aggressive schedule to retire computers after 15 days for reporting purposes.
A computer is retired, 20 days later it is reimaged. The computer will never communicate back to the Notification Server to obtain a GUID, generate inventory, run software delivery jobs or applied MS patches.
Someone manually needs to set the status back to "active" to reset the "ismanaged" back to 1 in order for the computer to be managed.
If a retired computer sends inventory to the server, it will reset the status the " ismanaged" flag automatically.
But this won't work is a retired computer was reimaged with the same name because the client computer will never download the inventory files from the NS.
Having someone manually set the status is fine, but this isn't effective in a large environment with 20 plus sites, hundreds of support staff and permissions needed.
The only files processed on the NS from a retired computer are events and the only events sent are client logins.
With a notification policy and a SQL query we can manipulate the asset status automatically. This is also handy when a helpdesk retires a computer when they shouldn't have.
Create A Notification Policy.
Select a schedule, I found 1 hour was enough to meet my needs.
Set Source to Query and use the following query. You can modify the getdate to a different date to meet your needs.
select distinct _resourceguid AS GUID from evt_aex_client_logon ac join resourceassociation ra on ac._resourceguid = ra.parentresourceguid where ra.resourceassociationtypeguid like '%3028166f%' and ra.childresourceguid like '%492c463b%' and datediff(hh, ac._eventtime, getdate())< 168
For automated auto type select " Set asset status"