DESCRIPTION
This script will log the user name (in the form domain\samAccountName) of the user who perfoms a deprovision against a target user object. This information is stored in the description attribute of the deprovisioned target user object.
Note This code may use functions from the ARS Script Policy Best Practices. Please, follow the link to obtain instructions and code for those functions.
SCRIPT
'*********************************************************************************
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
' EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
' WARRANTIES OF MERCHANTBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
' IF YOU WANT THIS FUNCTIONALITY TO BE CONDITIONALLY SUPPORTED,
' PLEASE CONTACT QUEST PROFESSIONAL SERVICES.
'*********************************************************************************
'
' This code is published on the ActiveRoles Script Center:
' http://communities.quest.com/docs/DOC-9991
'
' This code may use functions from the ARS Script Policy Best Practices:
' http://communities.quest.com/docs/DOC-10016
'
' Please, follow the link to obtain instructions and code for those functions.
'*********************************************************************************
'
' The purpose of this script is to note the user who performed the
' deprovision action in the deprovisioned user object's description
' attribute.
'
' ********************************************************
' ********************************************************
Sub onDeprovision(Request)
On Error Resume Next
DirObj.GetInfo
strOldDesc = DirObj.Get("description")
Set Session = Security.Sessions.Current
strDate = CStr(Date)
strDepro = "[Deprovisioned by " & Session.UserName & " on " & strDate & "] " & strOldDesc
DirObj.Put "description", strDepro
DirObj.SetInfo
Set Session = Nothing
End Sub
'***** END OF CODE ***************************************************************
COMPATIBILITY
Script compatible with the following version(s): <Not specified>