Quest Active Server Roles - WRITE OUT DAILY CSV FILES

WRITE OUT DAILY CSV FILES


  1. create a managed unit of the report you would like to export.  User/computer/Groups
  2. create a workflow that will run a script everyday to create daily CSV files
  3. create a script that will create and execute the CSV 



Create Script - Named DailyCSV
#################################  WRITE OUT DAILY CSV FILES   ###########
# CREATE DAILY All-Employee-Accounts CSV
function CreateDailyAllEmployeeCSV($Request)
{
    # CONNECTING TO THE POWERSHELL ACCESS TO ARS SERVER
    Connect-QADService -Service ars01.domain.com -Proxy
    $Name = $workflow.foundobject("All-EmployeeSearch").get("SamaccountName")
    # CREATE DIRECTORY STRUCTURE
if (Test-Path "D:\LOGS\UserAccountAdministration\All-Employee-Accounts\All-Employee($(Get-Date -uformat %Y%m%d)).csv") {
$proceed = $true
}
else {
New-Item "D:\LOGS\UserAccountAdministration\All-Employee-Accounts\All-Employee($(Get-Date -uformat %Y%m%d)).csv" -type file
if (Test-Path "D:\LOGS\UserAccountAdministration\All-Employee-Accounts\All-Employee($(Get-Date -uformat %Y%m%d)).csv") {
$proceed = $true
}
}
# EXPORT REPORT TO D:\LOGS\UserAccountAdministration\All-Employee-Accounts\All-EmployeeDATE.CSV
Get-QADUser $Name -IncludeAllproperties | Select-Object displayName,SamAccountName,edsvaparentcanonicalname,Description,employeeID,title,city,useraccountcontrol,accountexpires,lastlogonTimestamp | Export-Csv "D:\LOGS\UserAccountAdministration\All-Employee-Accounts\All-Employee($(Get-Date -uformat %Y%m%d)).csv" -Append -NoTypeInformation -Encoding ASCII
}
#################################  WRITE OUT DAILY CSV FILES   ###########