Back to User management: Disable, Delete, Deprovision
DESCRIPTION
This script demonstrates how to get user account properties (for example, sAMAccountName) in onPostDelete() handler.
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.
'*********************************************************************************
Sub onPreDelete(Request)
'---- get sAMAccountName attribute from deleting user account ----
strSAMAccountName = DirObj.Get("sAMAccountName")
'---- store it in "my-control-1" ----
Request.PutOutControl "my-control-1", ADSTYPE_CASE_IGNORE_STRING, strSAMAccountName
End Sub
Sub onPostDelete(Request)
'---- get stored sAMAccountName form "my-control-1" ----
strSAMAccountName = Request.GetOutControl("my-control-1")
End Sub
'***** END OF CODE ***************************************************************
COMPATIBILITY
Script compatible with the following version(s): <Not specified>