Quantcast
Channel: TechCenter
Viewing all articles
Browse latest Browse all 2350

Track user who performs a deprovision

$
0
0
Revision 1 posted to Active Roles Script Center by DELL-Tatiana G on 2/24/2014 5:18:37 AM

Back to Permission management

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>

Back to Permission management


Viewing all articles
Browse latest Browse all 2350

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>