This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

I am working on deprovision task, I would like to save all the users information in CSV file along with data format using powershell. Can anyone help on this Output example 2017-may-17 , user1,firstname,lastname,...

I am working on deprovision task, I would like to save all the users information in CSV file along with data format using powershell.
Can anyone help on this

Output example
2017-may-17 , user1,firstname,lastname,...

  • 1. Add a new script module (policy script) to ActiveRoles containing the following code:

    Function DeprovInfoDump ($Request)
    {

    $DeprovDate = $(get-date -UFormat %Y-%B-%d).tostring()

    # $Request.GUID obtains the GUID of the user being deprovisioned by the current ActiveRoles
    # transaction

    $UserInfo = Get-QADUser -Identity $Request.GUID

    # Add our calculated deprovision date stamp to the user property set

    $UserInfo | Add-Member -MemberType NoteProperty -Name DeprovisionDate -Value $DeprovDate

    # Export the selected attributes from the property set of the current user to a CSV file

    # Additional desired attributes may be added to the 'Select' below

    $UserInfo | select DeprovisionDate,samaccountname,givenname,sn | export-csv "MyDeprovUsers.txt" -NoTypeInformation -Append

    }

    2. Create an ActiveRoles workflow with a trigger condition of User | Deprovision

    3. Add your script module created above as a script activity to the workflow created in step 2.