public/Get-VPASSQLPlatforms.ps1

<#
.Synopsis
   Get SQL platforms
   CREATED BY: Vadim Melamed, EMAIL: vpasmodule@gmail.com
.DESCRIPTION
   Use this function to export all platform details into an SQL database
.LINK
   https://vpasmodule.com/commands.html#Get-VPASSQLPlatforms
.NOTES
   Category: PAM
   Tag: SQL Exports
   Since: v12.2.2
   Version: 10
   SelfHosted: TRUE
   PrivCloudStandard: TRUE
   SharedServices: TRUE
   SRS: TRUE
.PARAMETER token
   HashTable of data containing various pieces of login information (PVWA, LoginToken, HeaderType, etc).
   If -token is not passed, function will use last known hashtable generated by New-VPASToken
.PARAMETER InputParameters
   HashTable of values containing the parameters required to make the API call
.EXAMPLE
   $SQLPlatforms = Get-VPASSQLPlatforms
.EXAMPLE
   $InputParameters = @{}
   $SQLPlatforms = Get-VPASSQLPlatforms -InputParameters $InputParameters
.OUTPUTS
   $true if successful
   ---
   $false if failed
#>

function Get-VPASSQLPlatforms{
    [OutputType([bool])]
    [CmdletBinding(DefaultParameterSetName='Set1')]
    Param(
        [Parameter(Mandatory=$true,ParameterSetName='InputParameters',ValueFromPipelineByPropertyName=$true,HelpMessage="Hashtable of parameters required to make API call, refer to get-help -examples for valid inputs")]
        [hashtable]$InputParameters,

        [Parameter(Mandatory=$false,ValueFromPipelineByPropertyName=$true)]
        [hashtable]$token
    )

    Begin{
        $tokenval,$sessionval,$PVWA,$Header,$ISPSS,$IdentityURL,$EnableTextRecorder,$AuditTimeStamp,$NoSSL,$VaultVersion,$HideWarnings,$AuthenticatedAs,$SubDomain,$EnableTroubleshooting,$APICounter,$Creds,$AuthType,$IDPLogin,$SRS = Get-VPASSession -token $token
        $CommandName = $MyInvocation.MyCommand.Name
        $log = Write-VPASTextRecorder -inputval $CommandName -token $token -LogType COMMAND
    }
    Process{
        try{
            if($PSCmdlet.ParameterSetName -eq "InputParameters"){
                $KeyHash = @{
                    set1 = @{
                        AcceptableKeys = @()
                        MandatoryKeys = @()
                    }
                }
                $CheckSet = Test-VPASHashtableKeysHelper -InputHash $InputParameters -KeyHash $KeyHash

                if(!$CheckSet){
                    $log = Write-VPASTextRecorder -inputval "FAILED TO FIND TARGET PARAMETER SET" -token $token -LogType MISC
                    Write-Verbose "FAILED TO FIND TARGET PARAMETER SET"
                    Write-VPASOutput -str "FAILED TO FIND TARGET PARAMETER SET...VIEW EXAMPLES BELOW:" -type E
                    $examples = Write-VPASExampleHelper -CommandName $CommandName
                    return $false
                }
                else{
                    foreach($key in $InputParameters.Keys){
                        Set-Variable -Name $key -Value $InputParameters.$key
                    }
                }
            }
        }catch{
            $log = Write-VPASTextRecorder -inputval $_ -token $token -LogType ERROR
            $log = Write-VPASTextRecorder -inputval "REST API COMMAND RETURNED: FALSE" -token $token -LogType MISC
            Write-Verbose "FAILED TO RETRIEVE SQL DATA"
            Write-VPASOutput -str $_ -type E
            return $false
        }

        $curUser = $env:UserName
        $ConfigFile = "C:\Users\$curUser\AppData\Local\VPASModuleOutputs\SQL\SQLConfigFile.txt"

        try{
            if(Test-Path -Path $ConfigFile){
                Write-Verbose "FOUND SQL CONFIG FILE...PARSING DATA"
            }
            else{
                Write-Verbose "FAILED TO FIND SQL CONFIG FILE...RERUN Set-VPASSQLConnectionDetails"
                Write-VPASOutput -str "FAILED TO FIND SQL CONFIG FILE...RERUN Set-VPASSQLConnectionDetails" -type E
                return $false
            }
        }catch{
            Write-Verbose "FAILED TO FIND SQL CONFIG FILE...RERUN Set-VPASSQLConnectionDetails"
            Write-VPASOutput -str "FAILED TO FIND SQL CONFIG FILE...RERUN Set-VPASSQLConnectionDetails" -type E
            return $false
        }

        Write-Verbose "PARSING FILE CONTENTS"
        $SQLServerTemp = ""
        $SQLDatabaseTemp = ""
        $SQLUsernameTemp = ""
        $AAMTemp = ""
        $AppIDTemp = ""
        $FolderTemp = ""
        $SafeIDTemp = ""
        $ObjectNameTemp = ""
        $AIMServerTemp = ""
        $PasswordSDKTemp = ""
        $SQLPasswordTemp = ""
        $CertificateTPTemp = ""
        $AllLines = Get-Content -Path $ConfigFile
        foreach($line in $AllLines){
            if($line -match "SQLServer="){ $SQLServerTemp = $line }
            if($line -match "SQLDatabase="){ $SQLDatabaseTemp = $line }
            if($line -match "SQLUsername="){ $SQLUsernameTemp = $line }
            if($line -match "AAM="){ $AAMTemp = $line }
            if($line -match "AppID="){ $AppIDTemp = $line }
            if($line -match "Folder="){ $FolderTemp = $line }
            if($line -match "SafeID="){ $SafeIDTemp = $line }
            if($line -match "ObjectName="){ $ObjectNameTemp = $line }
            if($line -match "AIMServer="){ $AIMServerTemp = $line }
            if($line -match "PasswordSDK="){ $PasswordSDKTemp = $line }
            if($line -match "SQLPassword="){ $SQLPasswordTemp = $line }
            if($line -match "CERTIFICATETP="){ $CertificateTPTemp = $line }
        }

        $AAMSplit = $AAMTemp -split "="
        $AAM = $AAMSplit[1]
        Write-Verbose "AAM = $AAM"

        $SQLServerSplit = $SQLServerTemp -split "="
        $SQLServer = $SQLServerSplit[1]
        Write-Verbose "SQLServer = $SQLServer"

        $SQLDatabaseSplit = $SQLDatabaseTemp -split "="
        $SQLDatabase = $SQLDatabaseSplit[1]
        Write-Verbose "SQLDatabase = $SQLDatabase"

        $SQLUsernameSplit = $SQLUsernameTemp -split "="
        $SQLUsername = $SQLUsernameSplit[1]
        Write-Verbose "SQLUsername = $SQLUsername"

        if($AAM -eq "CCP"){
            #CCP
            $AppIDSplit = $AppIDTemp -split "="
            $AppID = $AppIDSplit[1]
            Write-Verbose "AppID = $AppID"

            $FolderSplit = $FolderTemp -split "="
            $Folder = $FolderSplit[1]
            Write-Verbose "Folder = $Folder"

            $SafeIDSplit = $SafeIDTemp -split "="
            $SafeID = $SafeIDSplit[1]
            Write-Verbose "SafeID = $SafeID"

            $ObjectNameSplit = $ObjectNameTemp -split "="
            $ObjectName = $ObjectNameSplit[1]
            Write-Verbose "ObjectName = $ObjectName"

            $AIMServerSplit = $AIMServerTemp -split "="
            $AIMServer = $AIMServerSplit[1]
            Write-Verbose "AIMServer = $AIMServer"

            if([String]::IsNullOrEmpty($CertificateTPTemp)){
                #DO NOTHING
            }
            else{
                $CertificateTPSplit = $CertificateTPTemp -split "="
                $CertificateTP = $CertificateTPSplit[1]
                Write-Verbose "CertificateTP = $CertificateTP"
            }

            try{
                if($NoSSL){
                    $uri = "http://$AIMServer/AIMWebService/api/accounts?AppID=$AppID&Safe=$SafeID&Folder=$Folder&Object=$ObjectName"
                    Write-Verbose "NO SSL ENABLED, USING HTTP INSTEAD OF HTTPS"
                }
                else{
                    $uri = "https://$AIMServer/AIMWebService/api/accounts?AppID=$AppID&Safe=$SafeID&Folder=$Folder&Object=$ObjectName"
                    Write-Verbose "SSL ENABLED BY DEFAULT, USING HTTPS"
                }
                if([String]::IsNullOrEmpty($CertificateTP)){
                    $CCPResult = Invoke-RestMethod -Uri $uri
                    $APICounter += 1
                }
                else{
                    $CCPResult = Invoke-RestMethod -Uri $uri -CertificateThumbprint $CertificateTP
                    $APICounter += 1
                }

                $Secret = $CCPResult.Content
                if($Secret){
                    write-verbose "SECRET RETRIEVED SUCCESSFULLY"
                }
                else{
                    Write-VPASOutput -str "FAILED TO RETRIEVE SQL SECRET...PLEASE CONFIRM SQLConfigFile ($ConfigFile) CONTENT AND CCP FUNCTIONALITY" -type E
                    return $false
                }
            }catch{
                Write-VPASOutput -str "FAILED TO RETRIEVE SQL SECRET...PLEASE CONFIRM SQLConfigFile ($ConfigFile) CONTENT AND CCP FUNCTIONALITY" -type E
                Write-VPASOutput -str $_ -type E
                return $false
            }

        }
        elseif($AAM -eq "CP"){
            #CP
            $AppIDSplit = $AppIDTemp -split "="
            $AppID = $AppIDSplit[1]
            Write-Verbose "AppID = $AppID"

            $FolderSplit = $FolderTemp -split "="
            $Folder = $FolderSplit[1]
            Write-Verbose "Folder = $Folder"

            $SafeIDSplit = $SafeIDTemp -split "="
            $SafeID = $SafeIDSplit[1]
            Write-Verbose "SafeID = $SafeID"

            $ObjectNameSplit = $ObjectNameTemp -split "="
            $ObjectName = $ObjectNameSplit[1]
            Write-Verbose "ObjectName = $ObjectName"

            $PasswordSDKSplit = $PasswordSDKTemp -split "="
            $PasswordSDK = $PasswordSDKSplit[1]
            Write-Verbose "PasswordSDK = $PasswordSDK"

            try{
                $Secret = & "$PasswordSDK" GetPassword /p AppDescs.AppID=$AppID /p Query="Safe=$SafeID;Folder=$Folder;Object=$ObjectName" /o Password
                if($Secret){
                    write-verbose "RETRIEVED SECRET SUCCESSFULLY"
                }
                else{
                    Write-VPASOutput -str "FAILED TO RETRIEVE SQL SECRET...PLEASE CONFIRM SQLConfigFile ($ConfigFile) CONTENT AND CP FUNCTIONALITY" -type E
                    return $false
                }
            }catch{
                Write-VPASOutput -str "FAILED TO RETRIEVE SQL SECRET...PLEASE CONFIRM SQLConfigFile ($ConfigFile) CONTENT AND CP FUNCTIONALITY" -type E
                Write-VPASOutput -str $_ -type E
                return $false
            }

        }
        else{
            #NONE
            $SQLPasswordSplit = $SQLPasswordTemp -split "="
            $SQLPassword = $SQLPasswordSplit[1]
            $SecureString = ConvertTo-SecureString -String $SQLPassword
            $Pointer = [Runtime.InteropServices.Marshal]::SecureStringToBSTR($SecureString)
            $Secret = [Runtime.InteropServices.Marshal]::PtrToStringAuto($Pointer)
        }

        try{
            import-module sqlserver -ErrorAction Stop
        }catch{
            Write-VPASOutput -str "FAILED TO LOAD SQLServer MODULE..." -type E
            Write-VPASOutput -str $_ -type E
            Write-VPASOutput -str "FAILED TO FIND SQLServer MODULE IN THE FOLLOWING DIRECTORIES:" -type E

            $str = $env:PSModulePath -split ";"
            foreach($strsplit in $str){
                Write-VPASOutput -str $strsplit -type E
            }

            Write-VPASOutput -str "DOWNLOAD THE MODULE BY TYPING IN 'Install-Module -Name SqlServer' THEN RERUN Set-VPASSQLConnectionDetails" -type E
            Write-VPASOutput -str "YOU CAN ALSO VIEW THIS LINK FOR MORE INFORMATION: 'https://www.powershellgallery.com/packages/SqlServer/21.1.18256'" -type E
            Write-VPASOutput -str "PROCESS TERMINATED" -type E
            return $false
        }

        try{
            $output = @()
            $result = Invoke-Sqlcmd -ServerInstance $SQLServer -Database $SQLDatabase -Query "SELECT DB_NAME()" -Username $SQLUsername -Password $Secret

            if($result.Column1 -eq $SQLDatabase){
                write-verbose "SQL CONNECTIVITY SUCCESSFUL"
            }
            else{
                Write-VPASOutput -str "FAILED TO CONNECT TO SQL DATABASE...PLEASE CONFIRM SQLConfigFile ($ConfigFile) CONTENT" -type E
                return $false
            }
        }catch{
            Write-VPASOutput -str "FAILED TO CONNECT TO SQL DATABASE...PLEASE CONFIRM SQLConfigFile ($ConfigFile) CONTENT" -type E
            Write-VPASOutput -str $_ -type E
            return $false
        }


        #DROP
        $TableName = "Vpas_Platform_Inventory"
        try{
            $query = "DROP TABLE $TableName"
            $result = Invoke-Sqlcmd -ServerInstance $SQLServer -Database $SQLDatabase -Query $query -Username $SQLUsername -Password $Secret -ErrorAction Stop
            Write-Verbose "$TableName DELETED SUCCESSFULLY"
        }catch{
            Write-Verbose "$TableName DOES NOT EXIST"
        }

        #CREATE
        try{
            $query = "CREATE TABLE $TableName ( ID varchar(255), Name varchar(255), SystemType varchar(255), Active varchar(255), Description varchar(255), PlatformBaseID varchar(255), PlatformType varchar(255), PropertiesRequired varchar(255), PropertiesOptional varchar(255), LinkedAccounts varchar(255), AllowedSafes varchar(255), AllowManualChange varchar(255), PerformPeriodicChange varchar(255), RequirePasswordChangeEveryXDays varchar(255), AllowManualVerification varchar(255), PerformPeriodicVerification varchar(255), RequirePasswordVerificationEveryXDays varchar(255), AllowManualReconciliation varchar(255), AutomaticReconcileWhenUnsynched varchar(255), RequirePrivilegedSessionMonitoringAndIsolation varchar(255), RecordAndSaveSessionActivity varchar(255), PSMServerID varchar(255), RequireDualControlPasswordAccessApproval varchar(255), EnforceCheckinCheckoutExclusiveAccess varchar(255), EnforceOnetimePasswordAccess varchar(255), ConnectionComponents varchar(255), SearchForUsages varchar(255), PolicyType varchar(255), ImmediateInterval varchar(255), Interval varchar(255), MaxConcurrentConnections varchar(255), MinValidityPeriod varchar(255), ResetOveridesMinValidity varchar(255), ResetOveridesTimeFrame varchar(255), Timeout varchar(255), UnlockIfFail varchar(255), UnrecoverableErrors varchar(255), MaximumRetries varchar(255), MinDelayBetweenRetries varchar(255), DllName varchar(255), XMLFile varchar(255), HeadStartInterval varchar(255), FromHour varchar(255), ToHour varchar(255), ChangeNotificationPeriod varchar(255), DaysNotifyPriorExpiration varchar(255), VFFromHour varchar(255), VFToHour varchar(255), RCReconcileReasons varchar(255), RCFromHour varchar(255), RCToHour varchar(255), NFNotifyPriorExpiration varchar(255), NFPriorExpirationRecipients varchar(255), NFNotifyOnPasswordDisable varchar(255), NFOnPasswordDisableRecipients varchar(255), NFNotifyOnVerificationErrors varchar(255), NFOnVerificationErrorsRecipients varchar(255), NFNotifyOnPasswordUsed varchar(255), NFOnPasswordUsedRecipients varchar(255), PasswordLength varchar(255), MinUpperCase varchar(255), MinLowerCase varchar(255), MinDigit varchar(255), MinSpecial varchar(255), PasswordLevelRequestTimeframe varchar(255) ); "
            $result = Invoke-Sqlcmd -ServerInstance $SQLServer -Database $SQLDatabase -Query $query -Username $SQLUsername -Password $Secret
            Write-Verbose "$TableName CREATED SUCCESSFULLY"
        }catch{
            Write-Verbose "FAILED TO CREATE $TableName"
            Write-VPASOutput -str "FAILED TO CREATE $TableName" -type E
            Write-VPASOutput -str $_ -type E
        }

        #START QUERYING
        try{
            if($NoSSL){
                $uri = "http://$PVWA/PasswordVault/API/Platforms"

                if($sessionval){
                    $result = Invoke-RestMethod -Headers @{"Authorization"=$Header} -Uri $uri -Method GET -ContentType "application/json" -WebSession $sessionval
                    $APICounter += 1
                }
                else{
                    $result = Invoke-RestMethod -Headers @{"Authorization"=$Header} -Uri $uri -Method GET -ContentType "application/json"
                    $APICounter += 1
                }
                $AllPlatforms = $result.Platforms
            }
            else{
                $uri = "https://$PVWA/PasswordVault/API/Platforms"

                if($sessionval){
                    $result = Invoke-RestMethod -Headers @{"Authorization"=$Header} -Uri $uri -Method GET -ContentType "application/json" -WebSession $sessionval
                    $APICounter += 1
                }
                else{
                    $result = Invoke-RestMethod -Headers @{"Authorization"=$Header} -Uri $uri -Method GET -ContentType "application/json"
                    $APICounter += 1
                }
                $AllPlatforms = $result.Platforms
            }

            $Data = @{}
            $counter = 1
            foreach($platform in $AllPlatforms){
                $temparr = @{}
                $PFGeneralID = $platform.general.id
                $PFGeneralName = $platform.general.name
                $PFGeneralSystemType = $platform.general.systemType
                $PFGeneralActive = $platform.general.active
                $PFGeneralDescription = $platform.general.description
                $PFGeneralPlatformBaseID = $platform.general.platformBaseID
                $PFGeneralPlatformType = $platform.general.platformType

                $str = ""
                $PFPropertiesRequiredTemp = $platform.properties.required
                foreach($rec in $PFPropertiesRequiredTemp){
                    $testval = $rec.name
                    if([String]::IsNullOrEmpty($testval)){
                        $testval = $rec.displayName
                    }
                    $str += $testval + ";"
                }
                $PFPropertiesRequired = $str

                $str = ""
                $PFPropertiesOptionalTemp = $platform.properties.optional
                foreach($rec in $PFPropertiesOptionalTemp){
                    $testval = $rec.name
                    if([String]::IsNullOrEmpty($testval)){
                        $testval = $rec.displayName
                    }
                    $str += $testval + ";"
                }
                $PFPropertiesOptional = $str

                $str = ""
                $PFLinkedAccountsTemp = $platform.linkedAccounts
                foreach($rec in $PFLinkedAccountsTemp){
                    $testval = $rec.name
                    if([String]::IsNullOrEmpty($testval)){
                        $testval = $rec.displayName
                    }
                    $str += $testval + ";"
                }
                $PFLinkedAccounts = $str

                $PFCredentialsManagementAllowedSafes = $platform.credentialsManagement.allowedSafes
                $PFCredentialsManagementAllowManualChange = $platform.credentialsManagement.allowManualChange
                $PFCredentialsManagementPerformPeriodicChange = $platform.credentialsManagement.performPeriodicChange
                $PFCredentialsManagementRequirePasswordChangeEveryXDays = $platform.credentialsManagement.requirePasswordChangeEveryXDays
                $PFCredentialsManagementAllowManualVerification = $platform.credentialsManagement.allowManualVerification
                $PFCredentialsManagementPerformPeriodicVerification = $platform.credentialsManagement.performPeriodicVerification
                $PFCredentialsManagementRequirePasswordVerificationEveryXDays = $platform.credentialsManagement.requirePasswordVerificationEveryXDays
                $PFCredentialsManagementAllowManualReconciliation = $platform.credentialsManagement.allowManualReconciliation
                $PFCredentialsManagementAutomaticReconcileWhenUnsynched = $platform.credentialsManagement.automaticReconcileWhenUnsynched

                $PFSessionManagementRequirePrivilegedSessionMonitoringAndIsolation = $platform.sessionManagement.requirePrivilegedSessionMonitoringAndIsolation
                $PFSessionManagementRecordAndSaveSessionActivity = $platform.sessionManagement.recordAndSaveSessionActivity
                $PFSessionManagementPSMServerID = $platform.sessionManagement.PSMServerID

                $PFPrivilegedAccessWorkflowsRequireDualControlPasswordAccessApproval = $platform.privilegedAccessWorkflows.requireDualControlPasswordAccessApproval
                $PFPrivilegedAccessWorkflowsEnforceCheckinCheckoutExclusiveAccess = $platform.privilegedAccessWorkflows.enforceCheckinCheckoutExclusiveAccess
                $PFPrivilegedAccessWorkflowsEnforceOnetimePasswordAccess = $platform.privilegedAccessWorkflows.enforceOnetimePasswordAccess
                $PFConnectionComponents = ""

                if($NoSSL){
                    $response2 = Get-VPASPSMSettingsByPlatformID -token $token -PlatformID $PFGeneralID
                }
                else{
                    $response2 = Get-VPASPSMSettingsByPlatformID -token $token -PlatformID $PFGeneralID
                }

                $AllConnectionComponents = $response2.PSMConnectors
                foreach($cc in $AllConnectionComponents){
                    $ccName = $cc.PSMConnectorID
                    $ccStatus = $cc.Enabled

                    if($ccStatus.ToString() -eq "True"){
                        $PFConnectionComponents += "$ccName(ACTIVE);"
                    }
                    else{
                        $PFConnectionComponents += "$ccName(DISABLED);"
                    }
                }

                #GET OTHER HALF OF PLATFORM PROPERTIES
                $PFSearchForUsages = ""
                $PFPolicyType = ""
                $PFImmediateInterval = ""
                $PFInterval = ""
                $PFMaxConcurrentConnections = ""
                $PFMinValidityPeriod = ""
                $PFResetOveridesMinValidity = ""
                $PFResetOveridesTimeFrame = ""
                $PFTimeout = ""
                $PFUnlockIfFail = ""
                $PFUnrecoverableErrors = ""
                $PFMaximumRetries = ""
                $PFMinDelayBetweenRetries = ""
                $PFDllName = ""
                $PFXMLFile = ""
                $PFHeadStartInterval = ""
                $PFFromHour = ""
                $PFToHour = ""
                $PFChangeNotificationPeriod = ""
                $PFDaysNotifyPriorExpiration = ""
                $PFVFFromHour = ""
                $PFVFToHour = ""
                $PFRCReconcileReasons = ""
                $PFRCFromHour = ""
                $PFRCToHour = ""
                $PFNFNotifyPriorExpiration = ""
                $PFNFPriorExpirationRecipients = ""
                $PFNFNotifyOnPasswordDisable = ""
                $PFNFOnPasswordDisableRecipients = ""
                $PFNFNotifyOnVerificationErrors = ""
                $PFNFOnVerificationErrorsRecipients = ""
                $PFNFNotifyOnPasswordUsed = ""
                $PFNFOnPasswordUsedRecipients = ""
                $PFPasswordLength = ""
                $PFMinUpperCase = ""
                $PFMinLowerCase = ""
                $PFMinDigit = ""
                $PFMinSpecial = ""
                $PFPasswordLevelRequestTimeframe = ""

                $MoreDetails = Get-VPASPlatformDetails -platformID $PFGeneralID -token $token
                if($MoreDetails){
                    $PFSearchForUsages = $MoreDetails.details.SearchForUsages
                    $PFPolicyType = $MoreDetails.details.PolicyType
                    $PFImmediateInterval = $MoreDetails.details.ImmediateInterval
                    $PFInterval = $MoreDetails.details.Interval
                    $PFMaxConcurrentConnections = $MoreDetails.details.MaxConcurrentConnections
                    $PFMinValidityPeriod = $MoreDetails.details.MinValidityPeriod
                    $PFResetOveridesMinValidity = $MoreDetails.details.ResetOveridesMinValidity
                    $PFResetOveridesTimeFrame = $MoreDetails.details.ResetOveridesTimeFrame
                    $PFTimeout = $MoreDetails.details.Timeout
                    $PFUnlockIfFail = $MoreDetails.details.UnlockIfFail
                    $PFUnrecoverableErrors = $MoreDetails.details.UnrecoverableErrors
                    $PFMaximumRetries = $MoreDetails.details.MaximumRetries
                    $PFMinDelayBetweenRetries = $MoreDetails.details.MinDelayBetweenRetries
                    $PFDllName = $MoreDetails.details.DllName
                    $PFXMLFile = $MoreDetails.details.XMLFile
                    $PFHeadStartInterval = $MoreDetails.details.HeadStartInterval
                    $PFFromHour = $MoreDetails.details.FromHour
                    $PFToHour = $MoreDetails.details.ToHour
                    $PFChangeNotificationPeriod = $MoreDetails.details.ChangeNotificationPeriod
                    $PFDaysNotifyPriorExpiration = $MoreDetails.details.DaysNotifyPriorExpiration
                    $PFVFFromHour = $MoreDetails.details.VFFromHour
                    $PFVFToHour = $MoreDetails.details.VFToHour
                    $PFRCReconcileReasons = $MoreDetails.details.RCReconcileReasons
                    $PFRCFromHour = $MoreDetails.details.RCFromHour
                    $PFRCToHour = $MoreDetails.details.RCToHour
                    $PFNFNotifyPriorExpiration = $MoreDetails.details.NFNotifyPriorExpiration
                    $PFNFPriorExpirationRecipients = $MoreDetails.details.NFPriorExpirationRecipients
                    $PFNFNotifyOnPasswordDisable = $MoreDetails.details.NFNotifyOnPasswordDisable
                    $PFNFOnPasswordDisableRecipients = $MoreDetails.details.NFOnPasswordDisableRecipients
                    $PFNFNotifyOnVerificationErrors = $MoreDetails.details.NFNotifyOnVerificationErrors
                    $PFNFOnVerificationErrorsRecipients = $MoreDetails.details.NFOnVerificationErrorsRecipients
                    $PFNFNotifyOnPasswordUsed = $MoreDetails.details.NFNotifyOnPasswordUsed
                    $PFNFOnPasswordUsedRecipients = $MoreDetails.details.NFOnPasswordUsedRecipients
                    $PFPasswordLength = $MoreDetails.details.PasswordLength
                    $PFMinUpperCase = $MoreDetails.details.MinUpperCase
                    $PFMinLowerCase = $MoreDetails.details.MinLowerCase
                    $PFMinDigit = $MoreDetails.details.MinDigit
                    $PFMinSpecial = $MoreDetails.details.MinSpecial
                    $PFPasswordLevelRequestTimeframe = $MoreDetails.details.PasswordLevelRequestTimeframe
                }

                if([String]::IsNullOrEmpty($PFGeneralID)){ $PFGeneralID = "NULL" }
                if([String]::IsNullOrEmpty($PFGeneralName)){ $PFGeneralName = "NULL" }
                if([String]::IsNullOrEmpty($PFGeneralSystemType)){ $PFGeneralSystemType = "NULL" }
                if([String]::IsNullOrEmpty($PFGeneralActive)){ $PFGeneralActive = "NULL" }
                if([String]::IsNullOrEmpty($PFGeneralDescription)){ $PFGeneralDescription = "NULL" }
                if([String]::IsNullOrEmpty($PFGeneralPlatformBaseID)){ $PFGeneralPlatformBaseID = "NULL" }
                if([String]::IsNullOrEmpty($PFGeneralPlatformType)){ $PFGeneralPlatformType = "NULL" }
                if([String]::IsNullOrEmpty($PFPropertiesRequired)){ $PFPropertiesRequired = "NULL" }
                if([String]::IsNullOrEmpty($PFPropertiesOptional)){ $PFPropertiesOptional = "NULL" }
                if([String]::IsNullOrEmpty($PFLinkedAccounts)){ $PFLinkedAccounts = "NULL" }
                if([String]::IsNullOrEmpty($PFCredentialsManagementAllowedSafes)){ $PFCredentialsManagementAllowedSafes = "NULL" }
                if([String]::IsNullOrEmpty($PFCredentialsManagementAllowManualChange)){ $PFCredentialsManagementAllowManualChange = "NULL" }
                if([String]::IsNullOrEmpty($PFCredentialsManagementPerformPeriodicChange)){ $PFCredentialsManagementPerformPeriodicChange = "NULL" }
                if([String]::IsNullOrEmpty($PFCredentialsManagementRequirePasswordChangeEveryXDays)){ $PFCredentialsManagementRequirePasswordChangeEveryXDays = "NULL" }
                if([String]::IsNullOrEmpty($PFCredentialsManagementAllowManualVerification)){ $PFCredentialsManagementAllowManualVerification = "NULL" }
                if([String]::IsNullOrEmpty($PFCredentialsManagementPerformPeriodicVerification)){ $PFCredentialsManagementPerformPeriodicVerification = "NULL" }
                if([String]::IsNullOrEmpty($PFCredentialsManagementRequirePasswordVerificationEveryXDays)){ $PFCredentialsManagementRequirePasswordVerificationEveryXDays = "NULL" }
                if([String]::IsNullOrEmpty($PFCredentialsManagementAllowManualReconciliation)){ $PFCredentialsManagementAllowManualReconciliation = "NULL" }
                if([String]::IsNullOrEmpty($PFCredentialsManagementAutomaticReconcileWhenUnsynched)){ $PFCredentialsManagementAutomaticReconcileWhenUnsynched = "NULL" }
                if([String]::IsNullOrEmpty($PFSessionManagementRequirePrivilegedSessionMonitoringAndIsolation)){ $PFSessionManagementRequirePrivilegedSessionMonitoringAndIsolation = "NULL" }
                if([String]::IsNullOrEmpty($PFSessionManagementRecordAndSaveSessionActivity)){ $PFSessionManagementRecordAndSaveSessionActivity = "NULL" }
                if([String]::IsNullOrEmpty($PFSessionManagementPSMServerID)){ $PFSessionManagementPSMServerID = "NULL" }
                if([String]::IsNullOrEmpty($PFPrivilegedAccessWorkflowsRequireDualControlPasswordAccessApproval)){ $PFPrivilegedAccessWorkflowsRequireDualControlPasswordAccessApproval = "NULL" }
                if([String]::IsNullOrEmpty($PFPrivilegedAccessWorkflowsEnforceCheckinCheckoutExclusiveAccess)){ $PFPrivilegedAccessWorkflowsEnforceCheckinCheckoutExclusiveAccess = "NULL" }
                if([String]::IsNullOrEmpty($PFPrivilegedAccessWorkflowsEnforceOnetimePasswordAccess)){ $PFPrivilegedAccessWorkflowsEnforceOnetimePasswordAccess = "NULL" }
                if([String]::IsNullOrEmpty($PFConnectionComponents)){ $PFConnectionComponents = "NULL" }
                if([String]::IsNullOrEmpty($PFSearchForUsages)){ $PFSearchForUsages = "NULL" }
                if([String]::IsNullOrEmpty($PFPolicyType)){ $PFPolicyType = "NULL" }
                if([String]::IsNullOrEmpty($PFImmediateInterval)){ $PFImmediateInterval = "NULL" }
                if([String]::IsNullOrEmpty($PFInterval)){ $PFInterval = "NULL" }
                if([String]::IsNullOrEmpty($PFMaxConcurrentConnections)){ $PFMaxConcurrentConnections = "NULL" }
                if([String]::IsNullOrEmpty($PFMinValidityPeriod)){ $PFMinValidityPeriod = "NULL" }
                if([String]::IsNullOrEmpty($PFResetOveridesMinValidity)){ $PFResetOveridesMinValidity = "NULL" }
                if([String]::IsNullOrEmpty($PFResetOveridesTimeFrame)){ $PFResetOveridesTimeFrame = "NULL" }
                if([String]::IsNullOrEmpty($PFTimeout)){ $PFTimeout = "NULL" }
                if([String]::IsNullOrEmpty($PFUnlockIfFail)){ $PFUnlockIfFail = "NULL" }
                if([String]::IsNullOrEmpty($PFUnrecoverableErrors)){ $PFUnrecoverableErrors = "NULL" }
                if([String]::IsNullOrEmpty($PFMaximumRetries)){ $PFMaximumRetries = "NULL" }
                if([String]::IsNullOrEmpty($PFMinDelayBetweenRetries)){ $PFMinDelayBetweenRetries = "NULL" }
                if([String]::IsNullOrEmpty($PFDllName)){ $PFDllName = "NULL" }
                if([String]::IsNullOrEmpty($PFXMLFile)){ $PFXMLFile = "NULL" }
                if([String]::IsNullOrEmpty($PFHeadStartInterval)){ $PFHeadStartInterval = "NULL" }
                if([String]::IsNullOrEmpty($PFFromHour)){ $PFFromHour = "NULL" }
                if([String]::IsNullOrEmpty($PFToHour)){ $PFToHour = "NULL" }
                if([String]::IsNullOrEmpty($PFChangeNotificationPeriod)){ $PFChangeNotificationPeriod = "NULL" }
                if([String]::IsNullOrEmpty($PFDaysNotifyPriorExpiration)){ $PFDaysNotifyPriorExpiration = "NULL" }
                if([String]::IsNullOrEmpty($PFVFFromHour)){ $PFVFFromHour = "NULL" }
                if([String]::IsNullOrEmpty($PFVFToHour)){ $PFVFToHour = "NULL" }
                if([String]::IsNullOrEmpty($PFRCReconcileReasons)){ $PFRCReconcileReasons = "NULL" }
                if([String]::IsNullOrEmpty($PFRCFromHour)){ $PFRCFromHour = "NULL" }
                if([String]::IsNullOrEmpty($PFRCToHour)){ $PFRCToHour = "NULL" }
                if([String]::IsNullOrEmpty($PFNFNotifyPriorExpiration)){ $PFNFNotifyPriorExpiration = "NULL" }
                if([String]::IsNullOrEmpty($PFNFPriorExpirationRecipients)){ $PFNFPriorExpirationRecipients = "NULL" }
                if([String]::IsNullOrEmpty($PFNFNotifyOnPasswordDisable)){ $PFNFNotifyOnPasswordDisable = "NULL" }
                if([String]::IsNullOrEmpty($PFNFOnPasswordDisableRecipients)){ $PFNFOnPasswordDisableRecipients = "NULL" }
                if([String]::IsNullOrEmpty($PFNFNotifyOnVerificationErrors)){ $PFNFNotifyOnVerificationErrors = "NULL" }
                if([String]::IsNullOrEmpty($PFNFOnVerificationErrorsRecipients)){ $PFNFOnVerificationErrorsRecipients = "NULL" }
                if([String]::IsNullOrEmpty($PFNFNotifyOnPasswordUsed)){ $PFNFNotifyOnPasswordUsed = "NULL" }
                if([String]::IsNullOrEmpty($PFNFOnPasswordUsedRecipients)){ $PFNFOnPasswordUsedRecipients = "NULL" }
                if([String]::IsNullOrEmpty($PFPasswordLength)){ $PFPasswordLength = "NULL" }
                if([String]::IsNullOrEmpty($PFMinUpperCase)){ $PFMinUpperCase = "NULL" }
                if([String]::IsNullOrEmpty($PFMinLowerCase)){ $PFMinLowerCase = "NULL" }
                if([String]::IsNullOrEmpty($PFMinDigit)){ $PFMinDigit = "NULL" }
                if([String]::IsNullOrEmpty($PFMinSpecial)){ $PFMinSpecial = "NULL" }
                if([String]::IsNullOrEmpty($PFPasswordLevelRequestTimeframe)){ $PFPasswordLevelRequestTimeframe = "NULL" }

                $PFGeneralID = $PFGeneralID -replace "'","''"
                $PFGeneralName = $PFGeneralName -replace "'","''"
                $PFGeneralSystemType = $PFGeneralSystemType -replace "'","''"
                $PFGeneralActive = $PFGeneralActive -replace "'","''"
                $PFGeneralDescription = $PFGeneralDescription -replace "'","''"
                $PFGeneralPlatformBaseID = $PFGeneralPlatformBaseID -replace "'","''"
                $PFGeneralPlatformType = $PFGeneralPlatformType -replace "'","''"
                $PFPropertiesRequired = $PFPropertiesRequired -replace "'","''"
                $PFPropertiesOptional = $PFPropertiesOptional -replace "'","''"
                $PFLinkedAccounts = $PFLinkedAccounts -replace "'","''"
                $PFCredentialsManagementAllowedSafes = $PFCredentialsManagementAllowedSafes -replace "'","''"
                $PFCredentialsManagementAllowManualChange = $PFCredentialsManagementAllowManualChange -replace "'","''"
                $PFCredentialsManagementPerformPeriodicChange = $PFCredentialsManagementPerformPeriodicChange -replace "'","''"
                $PFCredentialsManagementRequirePasswordChangeEveryXDays = $PFCredentialsManagementRequirePasswordChangeEveryXDays -replace "'","''"
                $PFCredentialsManagementAllowManualVerification = $PFCredentialsManagementAllowManualVerification -replace "'","''"
                $PFCredentialsManagementPerformPeriodicVerification = $PFCredentialsManagementPerformPeriodicVerification -replace "'","''"
                $PFCredentialsManagementRequirePasswordVerificationEveryXDays = $PFCredentialsManagementRequirePasswordVerificationEveryXDays -replace "'","''"
                $PFCredentialsManagementAllowManualReconciliation = $PFCredentialsManagementAllowManualReconciliation -replace "'","''"
                $PFCredentialsManagementAutomaticReconcileWhenUnsynched = $PFCredentialsManagementAutomaticReconcileWhenUnsynched -replace "'","''"
                $PFSessionManagementRequirePrivilegedSessionMonitoringAndIsolation = $PFSessionManagementRequirePrivilegedSessionMonitoringAndIsolation -replace "'","''"
                $PFSessionManagementRecordAndSaveSessionActivity = $PFSessionManagementRecordAndSaveSessionActivity -replace "'","''"
                $PFSessionManagementPSMServerID = $PFSessionManagementPSMServerID -replace "'","''"
                $PFPrivilegedAccessWorkflowsRequireDualControlPasswordAccessApproval = $PFPrivilegedAccessWorkflowsRequireDualControlPasswordAccessApproval -replace "'","''"
                $PFPrivilegedAccessWorkflowsEnforceCheckinCheckoutExclusiveAccess = $PFPrivilegedAccessWorkflowsEnforceCheckinCheckoutExclusiveAccess -replace "'","''"
                $PFPrivilegedAccessWorkflowsEnforceOnetimePasswordAccess = $PFPrivilegedAccessWorkflowsEnforceOnetimePasswordAccess -replace "'","''"
                $PFConnectionComponents = $PFConnectionComponents -replace "'","''"
                $PFSearchForUsages = $PFSearchForUsages -replace "'","''"
                $PFPolicyType = $PFPolicyType -replace "'","''"
                $PFImmediateInterval = $PFImmediateInterval -replace "'","''"
                $PFInterval = $PFInterval -replace "'","''"
                $PFMaxConcurrentConnections = $PFMaxConcurrentConnections -replace "'","''"
                $PFMinValidityPeriod = $PFMinValidityPeriod -replace "'","''"
                $PFResetOveridesMinValidity = $PFResetOveridesMinValidity -replace "'","''"
                $PFResetOveridesTimeFrame = $PFResetOveridesTimeFrame -replace "'","''"
                $PFTimeout = $PFTimeout -replace "'","''"
                $PFUnlockIfFail = $PFUnlockIfFail -replace "'","''"
                $PFUnrecoverableErrors = $PFUnrecoverableErrors -replace "'","''"
                $PFMaximumRetries = $PFMaximumRetries -replace "'","''"
                $PFMinDelayBetweenRetries = $PFMinDelayBetweenRetries -replace "'","''"
                $PFDllName = $PFDllName -replace "'","''"
                $PFXMLFile = $PFXMLFile -replace "'","''"
                $PFHeadStartInterval = $PFHeadStartInterval -replace "'","''"
                $PFFromHour = $PFFromHour -replace "'","''"
                $PFToHour = $PFToHour -replace "'","''"
                $PFChangeNotificationPeriod = $PFChangeNotificationPeriod -replace "'","''"
                $PFDaysNotifyPriorExpiration = $PFDaysNotifyPriorExpiration -replace "'","''"
                $PFVFFromHour = $PFVFFromHour -replace "'","''"
                $PFVFToHour = $PFVFToHour -replace "'","''"
                $PFRCReconcileReasons = $PFRCReconcileReasons -replace "'","''"
                $PFRCFromHour = $PFRCFromHour -replace "'","''"
                $PFRCToHour = $PFRCToHour -replace "'","''"
                $PFNFNotifyPriorExpiration = $PFNFNotifyPriorExpiration -replace "'","''"
                $PFNFPriorExpirationRecipients = $PFNFPriorExpirationRecipients -replace "'","''"
                $PFNFNotifyOnPasswordDisable = $PFNFNotifyOnPasswordDisable -replace "'","''"
                $PFNFOnPasswordDisableRecipients = $PFNFOnPasswordDisableRecipients -replace "'","''"
                $PFNFNotifyOnVerificationErrors = $PFNFNotifyOnVerificationErrors -replace "'","''"
                $PFNFOnVerificationErrorsRecipients = $PFNFOnVerificationErrorsRecipients -replace "'","''"
                $PFNFNotifyOnPasswordUsed = $PFNFNotifyOnPasswordUsed -replace "'","''"
                $PFNFOnPasswordUsedRecipients = $PFNFOnPasswordUsedRecipients -replace "'","''"
                $PFPasswordLength = $PFPasswordLength -replace "'","''"
                $PFMinUpperCase = $PFMinUpperCase -replace "'","''"
                $PFMinLowerCase = $PFMinLowerCase -replace "'","''"
                $PFMinDigit = $PFMinDigit -replace "'","''"
                $PFMinSpecial = $PFMinSpecial -replace "'","''"
                $PFPasswordLevelRequestTimeframe = $PFPasswordLevelRequestTimeframe -replace "'","''"

                try{
                    $query = "INSERT INTO $TableName ( ID, Name, SystemType, Active, Description, PlatformBaseID, PlatformType, PropertiesRequired, PropertiesOptional, LinkedAccounts, AllowedSafes, AllowManualChange, PerformPeriodicChange, RequirePasswordChangeEveryXDays, AllowManualVerification, PerformPeriodicVerification, RequirePasswordVerificationEveryXDays, AllowManualReconciliation, AutomaticReconcileWhenUnsynched, RequirePrivilegedSessionMonitoringAndIsolation, RecordAndSaveSessionActivity, PSMServerID, RequireDualControlPasswordAccessApproval, EnforceCheckinCheckoutExclusiveAccess, EnforceOnetimePasswordAccess, ConnectionComponents, SearchForUsages, PolicyType, ImmediateInterval, Interval, MaxConcurrentConnections, MinValidityPeriod, ResetOveridesMinValidity, ResetOveridesTimeFrame, Timeout, UnlockIfFail, UnrecoverableErrors, MaximumRetries, MinDelayBetweenRetries, DllName, XMLFile, HeadStartInterval, FromHour, ToHour, ChangeNotificationPeriod, DaysNotifyPriorExpiration, VFFromHour, VFToHour, RCReconcileReasons, RCFromHour, RCToHour, NFNotifyPriorExpiration, NFPriorExpirationRecipients, NFNotifyOnPasswordDisable, NFOnPasswordDisableRecipients, NFNotifyOnVerificationErrors, NFOnVerificationErrorsRecipients, NFNotifyOnPasswordUsed, NFOnPasswordUsedRecipients, PasswordLength, MinUpperCase, MinLowerCase, MinDigit, MinSpecial, PasswordLevelRequestTimeframe ) VALUES ( '$PFGeneralID', '$PFGeneralName', '$PFGeneralSystemType', '$PFGeneralActive', '$PFGeneralDescription', '$PFGeneralPlatformBaseID', '$PFGeneralPlatformType', '$PFPropertiesRequired', '$PFPropertiesOptional', '$PFLinkedAccounts', '$PFCredentialsManagementAllowedSafes', '$PFCredentialsManagementAllowManualChange', '$PFCredentialsManagementPerformPeriodicChange', '$PFCredentialsManagementRequirePasswordChangeEveryXDays', '$PFCredentialsManagementAllowManualVerification', '$PFCredentialsManagementPerformPeriodicVerification', '$PFCredentialsManagementRequirePasswordVerificationEveryXDays', '$PFCredentialsManagementAllowManualReconciliation', '$PFCredentialsManagementAutomaticReconcileWhenUnsynched', '$PFSessionManagementRequirePrivilegedSessionMonitoringAndIsolation', '$PFSessionManagementRecordAndSaveSessionActivity', '$PFSessionManagementPSMServerID', '$PFPrivilegedAccessWorkflowsRequireDualControlPasswordAccessApproval', '$PFPrivilegedAccessWorkflowsEnforceCheckinCheckoutExclusiveAccess', '$PFPrivilegedAccessWorkflowsEnforceOnetimePasswordAccess', '$PFConnectionComponents', '$PFSearchForUsages', '$PFPolicyType', '$PFImmediateInterval', '$PFInterval', '$PFMaxConcurrentConnections', '$PFMinValidityPeriod', '$PFResetOveridesMinValidity', '$PFResetOveridesTimeFrame', '$PFTimeout', '$PFUnlockIfFail', '$PFUnrecoverableErrors', '$PFMaximumRetries', '$PFMinDelayBetweenRetries', '$PFDllName', '$PFXMLFile', '$PFHeadStartInterval', '$PFFromHour', '$PFToHour', '$PFChangeNotificationPeriod', '$PFDaysNotifyPriorExpiration', '$PFVFFromHour', '$PFVFToHour', '$PFRCReconcileReasons', '$PFRCFromHour', '$PFRCToHour', '$PFNFNotifyPriorExpiration', '$PFNFPriorExpirationRecipients', '$PFNFNotifyOnPasswordDisable', '$PFNFOnPasswordDisableRecipients', '$PFNFNotifyOnVerificationErrors', '$PFNFOnVerificationErrorsRecipients', '$PFNFNotifyOnPasswordUsed', '$PFNFOnPasswordUsedRecipients', '$PFPasswordLength', '$PFMinUpperCase', '$PFMinLowerCase', '$PFMinDigit', '$PFMinSpecial', '$PFPasswordLevelRequestTimeframe' );"
                    $UpdateRec = Invoke-Sqlcmd -ServerInstance $SQLServer -Database $SQLDatabase -Query $query -Username $SQLUsername -Password $Secret
                    Write-Verbose "ADDED RECORD INTO $TableName FOR PLATFORMID: $PFPlatformID"
                }catch{
                    Write-Verbose "FAILED TO ADD RECORD INTO $TableName FOR PLATFORMID: $PFPlatformID"
                    Write-VPASOutput -str "FAILED TO ADD RECORD INTO $TableName FOR PLATFORMID: $PFPlatformID" -type E
                    Write-VPASOutput -str $_ -type E
                }
            }
        }catch{
            Write-Verbose "GET ALL PLATFORMS API FAILED: $_"
            Write-Verbose "RUNNING Get-VPASAllTargetPlatforms INSTEAD"
            Write-VPASOutput -str "FAILED TO GET ALL PLATFORMS, RUNNING Get-VPASAllTargetPlatforms INSTEAD" -type M
            Write-VPASOutput -str "KEEP IN MIND THE RETURN JSON SYNTAX DIFFERS FOR Get-VPASAllTargetPlatforms" -type M

            if($NoSSL){
                $uri = "http://$PVWA/PasswordVault/API/Platforms/targets"

                if($sessionval){
                    $result = Invoke-RestMethod -Headers @{"Authorization"=$Header} -Uri $uri -Method GET -ContentType "application/json" -WebSession $sessionval
                    $APICounter += 1
                }
                else{
                    $result = Invoke-RestMethod -Headers @{"Authorization"=$Header} -Uri $uri -Method GET -ContentType "application/json"
                    $APICounter += 1
                }
                $AllPlatforms = $result.Platforms
            }
            else{
                $uri = "https://$PVWA/PasswordVault/API/Platforms/targets"

                if($sessionval){
                    $result = Invoke-RestMethod -Headers @{"Authorization"=$Header} -Uri $uri -Method GET -ContentType "application/json" -WebSession $sessionval
                    $APICounter += 1
                }
                else{
                    $result = Invoke-RestMethod -Headers @{"Authorization"=$Header} -Uri $uri -Method GET -ContentType "application/json"
                    $APICounter += 1
                }
                $AllPlatforms = $result.Platforms
            }

            $Data = @{}
            $counter = 1
            foreach($platform in $AllPlatforms){
                $temparr = @{}
                $PFGeneralID = $platform.PlatformID
                $PFGeneralName = $platform.Name
                $PFGeneralSystemType = $platform.SystemType
                $PFGeneralActive = $platform.Active
                $PFGeneralDescription = ""
                $PFGeneralPlatformBaseID = $platform.PlatformBaseID
                $PFGeneralPlatformType = $platform.PlatformBaseType

                $str = ""
                $PFPropertiesRequiredTemp = $platform.properties.required
                foreach($rec in $PFPropertiesRequiredTemp){
                    $testval = $rec.name
                    if([String]::IsNullOrEmpty($testval)){
                        $testval = $rec.displayName
                    }
                    $str += $testval + ";"
                }
                $PFPropertiesRequired = $str

                $str = ""
                $PFPropertiesOptionalTemp = $platform.properties.optional
                foreach($rec in $PFPropertiesOptionalTemp){
                    $testval = $rec.name
                    if([String]::IsNullOrEmpty($testval)){
                        $testval = $rec.displayName
                    }
                    $str += $testval + ";"
                }
                $PFPropertiesOptional = $str

                $str = ""
                $PFLinkedAccountsTemp = $platform.linkedAccounts
                foreach($rec in $PFLinkedAccountsTemp){
                    $testval = $rec.name
                    if([String]::IsNullOrEmpty($testval)){
                        $testval = $rec.displayName
                    }
                    $str += $testval + ";"
                }
                $PFLinkedAccounts = $str

                $PFCredentialsManagementAllowedSafes = $platform.AllowedSafes
                $PFCredentialsManagementAllowManualChange = $platform.CredentialsManagementPolicy.Change.AllowManual
                $PFCredentialsManagementPerformPeriodicChange = $platform.CredentialsManagementPolicy.Change.PerformAutomatic
                $PFCredentialsManagementRequirePasswordChangeEveryXDays = $platform.CredentialsManagementPolicy.Change.RequirePasswordEveryXDays
                $PFCredentialsManagementAllowManualVerification = $platform.CredentialsManagementPolicy.Verification.AllowManual
                $PFCredentialsManagementPerformPeriodicVerification = $platform.CredentialsManagementPolicy.Verification.PerformAutomatic
                $PFCredentialsManagementRequirePasswordVerificationEveryXDays = $platform.CredentialsManagementPolicy.Verification.RequirePasswordEveryXDays
                $PFCredentialsManagementAllowManualReconciliation = $platform.CredentialsManagementPolicy.Reconcile.AllowManual
                $PFCredentialsManagementAutomaticReconcileWhenUnsynched = $platform.CredentialsManagementPolicy.Reconcile.AutomaticReconcileWhenUnsynced
                $PFSessionManagementRequirePrivilegedSessionMonitoringAndIsolation = ""
                $PFSessionManagementRecordAndSaveSessionActivity = ""
                $PFSessionManagementPSMServerID = ""
                $PFPrivilegedAccessWorkflowsRequireDualControlPasswordAccessApproval = $platform.privilegedAccessWorkflows.RequireDualControlPasswordAccessApproval.IsActive
                $PFPrivilegedAccessWorkflowsEnforceCheckinCheckoutExclusiveAccess = $platform.privilegedAccessWorkflows.EnforceCheckinCheckoutExclusiveAccess.IsActive
                $PFPrivilegedAccessWorkflowsEnforceOnetimePasswordAccess = $platform.privilegedAccessWorkflows.EnforceOnetimePasswordAccess.IsActive
                $PFConnectionComponents = ""

                if($NoSSL){
                    $response2 = Get-VPASPSMSettingsByPlatformID -token $token -PlatformID $PFGeneralID
                }
                else{
                    $response2 = Get-VPASPSMSettingsByPlatformID -token $token -PlatformID $PFGeneralID
                }

                $AllConnectionComponents = $response2.PSMConnectors
                foreach($cc in $AllConnectionComponents){
                    $ccName = $cc.PSMConnectorID
                    $ccStatus = $cc.Enabled

                    if($ccStatus.ToString() -eq "True"){
                        $PFConnectionComponents += "$ccName(ACTIVE);"
                    }
                    else{
                        $PFConnectionComponents += "$ccName(DISABLED);"
                    }
                }

                #GET OTHER HALF OF PLATFORM PROPERTIES
                $PFSearchForUsages = ""
                $PFPolicyType = ""
                $PFImmediateInterval = ""
                $PFInterval = ""
                $PFMaxConcurrentConnections = ""
                $PFMinValidityPeriod = ""
                $PFResetOveridesMinValidity = ""
                $PFResetOveridesTimeFrame = ""
                $PFTimeout = ""
                $PFUnlockIfFail = ""
                $PFUnrecoverableErrors = ""
                $PFMaximumRetries = ""
                $PFMinDelayBetweenRetries = ""
                $PFDllName = ""
                $PFXMLFile = ""
                $PFHeadStartInterval = ""
                $PFFromHour = ""
                $PFToHour = ""
                $PFChangeNotificationPeriod = ""
                $PFDaysNotifyPriorExpiration = ""
                $PFVFFromHour = ""
                $PFVFToHour = ""
                $PFRCReconcileReasons = ""
                $PFRCFromHour = ""
                $PFRCToHour = ""
                $PFNFNotifyPriorExpiration = ""
                $PFNFPriorExpirationRecipients = ""
                $PFNFNotifyOnPasswordDisable = ""
                $PFNFOnPasswordDisableRecipients = ""
                $PFNFNotifyOnVerificationErrors = ""
                $PFNFOnVerificationErrorsRecipients = ""
                $PFNFNotifyOnPasswordUsed = ""
                $PFNFOnPasswordUsedRecipients = ""
                $PFPasswordLength = ""
                $PFMinUpperCase = ""
                $PFMinLowerCase = ""
                $PFMinDigit = ""
                $PFMinSpecial = ""
                $PFPasswordLevelRequestTimeframe = ""

                $MoreDetails = Get-VPASPlatformDetails -platformID $PFGeneralID -token $token
                if($MoreDetails){
                    $PFSearchForUsages = $MoreDetails.details.SearchForUsages
                    $PFPolicyType = $MoreDetails.details.PolicyType
                    $PFImmediateInterval = $MoreDetails.details.ImmediateInterval
                    $PFInterval = $MoreDetails.details.Interval
                    $PFMaxConcurrentConnections = $MoreDetails.details.MaxConcurrentConnections
                    $PFMinValidityPeriod = $MoreDetails.details.MinValidityPeriod
                    $PFResetOveridesMinValidity = $MoreDetails.details.ResetOveridesMinValidity
                    $PFResetOveridesTimeFrame = $MoreDetails.details.ResetOveridesTimeFrame
                    $PFTimeout = $MoreDetails.details.Timeout
                    $PFUnlockIfFail = $MoreDetails.details.UnlockIfFail
                    $PFUnrecoverableErrors = $MoreDetails.details.UnrecoverableErrors
                    $PFMaximumRetries = $MoreDetails.details.MaximumRetries
                    $PFMinDelayBetweenRetries = $MoreDetails.details.MinDelayBetweenRetries
                    $PFDllName = $MoreDetails.details.DllName
                    $PFXMLFile = $MoreDetails.details.XMLFile
                    $PFHeadStartInterval = $MoreDetails.details.HeadStartInterval
                    $PFFromHour = $MoreDetails.details.FromHour
                    $PFToHour = $MoreDetails.details.ToHour
                    $PFChangeNotificationPeriod = $MoreDetails.details.ChangeNotificationPeriod
                    $PFDaysNotifyPriorExpiration = $MoreDetails.details.DaysNotifyPriorExpiration
                    $PFVFFromHour = $MoreDetails.details.VFFromHour
                    $PFVFToHour = $MoreDetails.details.VFToHour
                    $PFRCReconcileReasons = $MoreDetails.details.RCReconcileReasons
                    $PFRCFromHour = $MoreDetails.details.RCFromHour
                    $PFRCToHour = $MoreDetails.details.RCToHour
                    $PFNFNotifyPriorExpiration = $MoreDetails.details.NFNotifyPriorExpiration
                    $PFNFPriorExpirationRecipients = $MoreDetails.details.NFPriorExpirationRecipients
                    $PFNFNotifyOnPasswordDisable = $MoreDetails.details.NFNotifyOnPasswordDisable
                    $PFNFOnPasswordDisableRecipients = $MoreDetails.details.NFOnPasswordDisableRecipients
                    $PFNFNotifyOnVerificationErrors = $MoreDetails.details.NFNotifyOnVerificationErrors
                    $PFNFOnVerificationErrorsRecipients = $MoreDetails.details.NFOnVerificationErrorsRecipients
                    $PFNFNotifyOnPasswordUsed = $MoreDetails.details.NFNotifyOnPasswordUsed
                    $PFNFOnPasswordUsedRecipients = $MoreDetails.details.NFOnPasswordUsedRecipients
                    $PFPasswordLength = $MoreDetails.details.PasswordLength
                    $PFMinUpperCase = $MoreDetails.details.MinUpperCase
                    $PFMinLowerCase = $MoreDetails.details.MinLowerCase
                    $PFMinDigit = $MoreDetails.details.MinDigit
                    $PFMinSpecial = $MoreDetails.details.MinSpecial
                    $PFPasswordLevelRequestTimeframe = $MoreDetails.details.PasswordLevelRequestTimeframe
                }

                if([String]::IsNullOrEmpty($PFGeneralID)){ $PFGeneralID = "NULL" }
                if([String]::IsNullOrEmpty($PFGeneralName)){ $PFGeneralName = "NULL" }
                if([String]::IsNullOrEmpty($PFGeneralSystemType)){ $PFGeneralSystemType = "NULL" }
                if([String]::IsNullOrEmpty($PFGeneralActive)){ $PFGeneralActive = "NULL" }
                if([String]::IsNullOrEmpty($PFGeneralDescription)){ $PFGeneralDescription = "NULL" }
                if([String]::IsNullOrEmpty($PFGeneralPlatformBaseID)){ $PFGeneralPlatformBaseID = "NULL" }
                if([String]::IsNullOrEmpty($PFGeneralPlatformType)){ $PFGeneralPlatformType = "NULL" }
                if([String]::IsNullOrEmpty($PFPropertiesRequired)){ $PFPropertiesRequired = "NULL" }
                if([String]::IsNullOrEmpty($PFPropertiesOptional)){ $PFPropertiesOptional = "NULL" }
                if([String]::IsNullOrEmpty($PFLinkedAccounts)){ $PFLinkedAccounts = "NULL" }
                if([String]::IsNullOrEmpty($PFCredentialsManagementAllowedSafes)){ $PFCredentialsManagementAllowedSafes = "NULL" }
                if([String]::IsNullOrEmpty($PFCredentialsManagementAllowManualChange)){ $PFCredentialsManagementAllowManualChange = "NULL" }
                if([String]::IsNullOrEmpty($PFCredentialsManagementPerformPeriodicChange)){ $PFCredentialsManagementPerformPeriodicChange = "NULL" }
                if([String]::IsNullOrEmpty($PFCredentialsManagementRequirePasswordChangeEveryXDays)){ $PFCredentialsManagementRequirePasswordChangeEveryXDays = "NULL" }
                if([String]::IsNullOrEmpty($PFCredentialsManagementAllowManualVerification)){ $PFCredentialsManagementAllowManualVerification = "NULL" }
                if([String]::IsNullOrEmpty($PFCredentialsManagementPerformPeriodicVerification)){ $PFCredentialsManagementPerformPeriodicVerification = "NULL" }
                if([String]::IsNullOrEmpty($PFCredentialsManagementRequirePasswordVerificationEveryXDays)){ $PFCredentialsManagementRequirePasswordVerificationEveryXDays = "NULL" }
                if([String]::IsNullOrEmpty($PFCredentialsManagementAllowManualReconciliation)){ $PFCredentialsManagementAllowManualReconciliation = "NULL" }
                if([String]::IsNullOrEmpty($PFCredentialsManagementAutomaticReconcileWhenUnsynched)){ $PFCredentialsManagementAutomaticReconcileWhenUnsynched = "NULL" }
                if([String]::IsNullOrEmpty($PFSessionManagementRequirePrivilegedSessionMonitoringAndIsolation)){ $PFSessionManagementRequirePrivilegedSessionMonitoringAndIsolation = "NULL" }
                if([String]::IsNullOrEmpty($PFSessionManagementRecordAndSaveSessionActivity)){ $PFSessionManagementRecordAndSaveSessionActivity = "NULL" }
                if([String]::IsNullOrEmpty($PFSessionManagementPSMServerID)){ $PFSessionManagementPSMServerID = "NULL" }
                if([String]::IsNullOrEmpty($PFPrivilegedAccessWorkflowsRequireDualControlPasswordAccessApproval)){ $PFPrivilegedAccessWorkflowsRequireDualControlPasswordAccessApproval = "NULL" }
                if([String]::IsNullOrEmpty($PFPrivilegedAccessWorkflowsEnforceCheckinCheckoutExclusiveAccess)){ $PFPrivilegedAccessWorkflowsEnforceCheckinCheckoutExclusiveAccess = "NULL" }
                if([String]::IsNullOrEmpty($PFPrivilegedAccessWorkflowsEnforceOnetimePasswordAccess)){ $PFPrivilegedAccessWorkflowsEnforceOnetimePasswordAccess = "NULL" }
                if([String]::IsNullOrEmpty($PFConnectionComponents)){ $PFConnectionComponents = "NULL" }
                if([String]::IsNullOrEmpty($PFSearchForUsages)){ $PFSearchForUsages = "NULL" }
                if([String]::IsNullOrEmpty($PFPolicyType)){ $PFPolicyType = "NULL" }
                if([String]::IsNullOrEmpty($PFImmediateInterval)){ $PFImmediateInterval = "NULL" }
                if([String]::IsNullOrEmpty($PFInterval)){ $PFInterval = "NULL" }
                if([String]::IsNullOrEmpty($PFMaxConcurrentConnections)){ $PFMaxConcurrentConnections = "NULL" }
                if([String]::IsNullOrEmpty($PFMinValidityPeriod)){ $PFMinValidityPeriod = "NULL" }
                if([String]::IsNullOrEmpty($PFResetOveridesMinValidity)){ $PFResetOveridesMinValidity = "NULL" }
                if([String]::IsNullOrEmpty($PFResetOveridesTimeFrame)){ $PFResetOveridesTimeFrame = "NULL" }
                if([String]::IsNullOrEmpty($PFTimeout)){ $PFTimeout = "NULL" }
                if([String]::IsNullOrEmpty($PFUnlockIfFail)){ $PFUnlockIfFail = "NULL" }
                if([String]::IsNullOrEmpty($PFUnrecoverableErrors)){ $PFUnrecoverableErrors = "NULL" }
                if([String]::IsNullOrEmpty($PFMaximumRetries)){ $PFMaximumRetries = "NULL" }
                if([String]::IsNullOrEmpty($PFMinDelayBetweenRetries)){ $PFMinDelayBetweenRetries = "NULL" }
                if([String]::IsNullOrEmpty($PFDllName)){ $PFDllName = "NULL" }
                if([String]::IsNullOrEmpty($PFXMLFile)){ $PFXMLFile = "NULL" }
                if([String]::IsNullOrEmpty($PFHeadStartInterval)){ $PFHeadStartInterval = "NULL" }
                if([String]::IsNullOrEmpty($PFFromHour)){ $PFFromHour = "NULL" }
                if([String]::IsNullOrEmpty($PFToHour)){ $PFToHour = "NULL" }
                if([String]::IsNullOrEmpty($PFChangeNotificationPeriod)){ $PFChangeNotificationPeriod = "NULL" }
                if([String]::IsNullOrEmpty($PFDaysNotifyPriorExpiration)){ $PFDaysNotifyPriorExpiration = "NULL" }
                if([String]::IsNullOrEmpty($PFVFFromHour)){ $PFVFFromHour = "NULL" }
                if([String]::IsNullOrEmpty($PFVFToHour)){ $PFVFToHour = "NULL" }
                if([String]::IsNullOrEmpty($PFRCReconcileReasons)){ $PFRCReconcileReasons = "NULL" }
                if([String]::IsNullOrEmpty($PFRCFromHour)){ $PFRCFromHour = "NULL" }
                if([String]::IsNullOrEmpty($PFRCToHour)){ $PFRCToHour = "NULL" }
                if([String]::IsNullOrEmpty($PFNFNotifyPriorExpiration)){ $PFNFNotifyPriorExpiration = "NULL" }
                if([String]::IsNullOrEmpty($PFNFPriorExpirationRecipients)){ $PFNFPriorExpirationRecipients = "NULL" }
                if([String]::IsNullOrEmpty($PFNFNotifyOnPasswordDisable)){ $PFNFNotifyOnPasswordDisable = "NULL" }
                if([String]::IsNullOrEmpty($PFNFOnPasswordDisableRecipients)){ $PFNFOnPasswordDisableRecipients = "NULL" }
                if([String]::IsNullOrEmpty($PFNFNotifyOnVerificationErrors)){ $PFNFNotifyOnVerificationErrors = "NULL" }
                if([String]::IsNullOrEmpty($PFNFOnVerificationErrorsRecipients)){ $PFNFOnVerificationErrorsRecipients = "NULL" }
                if([String]::IsNullOrEmpty($PFNFNotifyOnPasswordUsed)){ $PFNFNotifyOnPasswordUsed = "NULL" }
                if([String]::IsNullOrEmpty($PFNFOnPasswordUsedRecipients)){ $PFNFOnPasswordUsedRecipients = "NULL" }
                if([String]::IsNullOrEmpty($PFPasswordLength)){ $PFPasswordLength = "NULL" }
                if([String]::IsNullOrEmpty($PFMinUpperCase)){ $PFMinUpperCase = "NULL" }
                if([String]::IsNullOrEmpty($PFMinLowerCase)){ $PFMinLowerCase = "NULL" }
                if([String]::IsNullOrEmpty($PFMinDigit)){ $PFMinDigit = "NULL" }
                if([String]::IsNullOrEmpty($PFMinSpecial)){ $PFMinSpecial = "NULL" }
                if([String]::IsNullOrEmpty($PFPasswordLevelRequestTimeframe)){ $PFPasswordLevelRequestTimeframe = "NULL" }

                $PFGeneralID = $PFGeneralID -replace "'","''"
                $PFGeneralName = $PFGeneralName -replace "'","''"
                $PFGeneralSystemType = $PFGeneralSystemType -replace "'","''"
                $PFGeneralActive = $PFGeneralActive -replace "'","''"
                $PFGeneralDescription = $PFGeneralDescription -replace "'","''"
                $PFGeneralPlatformBaseID = $PFGeneralPlatformBaseID -replace "'","''"
                $PFGeneralPlatformType = $PFGeneralPlatformType -replace "'","''"
                $PFPropertiesRequired = $PFPropertiesRequired -replace "'","''"
                $PFPropertiesOptional = $PFPropertiesOptional -replace "'","''"
                $PFLinkedAccounts = $PFLinkedAccounts -replace "'","''"
                $PFCredentialsManagementAllowedSafes = $PFCredentialsManagementAllowedSafes -replace "'","''"
                $PFCredentialsManagementAllowManualChange = $PFCredentialsManagementAllowManualChange -replace "'","''"
                $PFCredentialsManagementPerformPeriodicChange = $PFCredentialsManagementPerformPeriodicChange -replace "'","''"
                $PFCredentialsManagementRequirePasswordChangeEveryXDays = $PFCredentialsManagementRequirePasswordChangeEveryXDays -replace "'","''"
                $PFCredentialsManagementAllowManualVerification = $PFCredentialsManagementAllowManualVerification -replace "'","''"
                $PFCredentialsManagementPerformPeriodicVerification = $PFCredentialsManagementPerformPeriodicVerification -replace "'","''"
                $PFCredentialsManagementRequirePasswordVerificationEveryXDays = $PFCredentialsManagementRequirePasswordVerificationEveryXDays -replace "'","''"
                $PFCredentialsManagementAllowManualReconciliation = $PFCredentialsManagementAllowManualReconciliation -replace "'","''"
                $PFCredentialsManagementAutomaticReconcileWhenUnsynched = $PFCredentialsManagementAutomaticReconcileWhenUnsynched -replace "'","''"
                $PFSessionManagementRequirePrivilegedSessionMonitoringAndIsolation = $PFSessionManagementRequirePrivilegedSessionMonitoringAndIsolation -replace "'","''"
                $PFSessionManagementRecordAndSaveSessionActivity = $PFSessionManagementRecordAndSaveSessionActivity -replace "'","''"
                $PFSessionManagementPSMServerID = $PFSessionManagementPSMServerID -replace "'","''"
                $PFPrivilegedAccessWorkflowsRequireDualControlPasswordAccessApproval = $PFPrivilegedAccessWorkflowsRequireDualControlPasswordAccessApproval -replace "'","''"
                $PFPrivilegedAccessWorkflowsEnforceCheckinCheckoutExclusiveAccess = $PFPrivilegedAccessWorkflowsEnforceCheckinCheckoutExclusiveAccess -replace "'","''"
                $PFPrivilegedAccessWorkflowsEnforceOnetimePasswordAccess = $PFPrivilegedAccessWorkflowsEnforceOnetimePasswordAccess -replace "'","''"
                $PFConnectionComponents = $PFConnectionComponents -replace "'","''"
                $PFSearchForUsages = $PFSearchForUsages -replace "'","''"
                $PFPolicyType = $PFPolicyType -replace "'","''"
                $PFImmediateInterval = $PFImmediateInterval -replace "'","''"
                $PFInterval = $PFInterval -replace "'","''"
                $PFMaxConcurrentConnections = $PFMaxConcurrentConnections -replace "'","''"
                $PFMinValidityPeriod = $PFMinValidityPeriod -replace "'","''"
                $PFResetOveridesMinValidity = $PFResetOveridesMinValidity -replace "'","''"
                $PFResetOveridesTimeFrame = $PFResetOveridesTimeFrame -replace "'","''"
                $PFTimeout = $PFTimeout -replace "'","''"
                $PFUnlockIfFail = $PFUnlockIfFail -replace "'","''"
                $PFUnrecoverableErrors = $PFUnrecoverableErrors -replace "'","''"
                $PFMaximumRetries = $PFMaximumRetries -replace "'","''"
                $PFMinDelayBetweenRetries = $PFMinDelayBetweenRetries -replace "'","''"
                $PFDllName = $PFDllName -replace "'","''"
                $PFXMLFile = $PFXMLFile -replace "'","''"
                $PFHeadStartInterval = $PFHeadStartInterval -replace "'","''"
                $PFFromHour = $PFFromHour -replace "'","''"
                $PFToHour = $PFToHour -replace "'","''"
                $PFChangeNotificationPeriod = $PFChangeNotificationPeriod -replace "'","''"
                $PFDaysNotifyPriorExpiration = $PFDaysNotifyPriorExpiration -replace "'","''"
                $PFVFFromHour = $PFVFFromHour -replace "'","''"
                $PFVFToHour = $PFVFToHour -replace "'","''"
                $PFRCReconcileReasons = $PFRCReconcileReasons -replace "'","''"
                $PFRCFromHour = $PFRCFromHour -replace "'","''"
                $PFRCToHour = $PFRCToHour -replace "'","''"
                $PFNFNotifyPriorExpiration = $PFNFNotifyPriorExpiration -replace "'","''"
                $PFNFPriorExpirationRecipients = $PFNFPriorExpirationRecipients -replace "'","''"
                $PFNFNotifyOnPasswordDisable = $PFNFNotifyOnPasswordDisable -replace "'","''"
                $PFNFOnPasswordDisableRecipients = $PFNFOnPasswordDisableRecipients -replace "'","''"
                $PFNFNotifyOnVerificationErrors = $PFNFNotifyOnVerificationErrors -replace "'","''"
                $PFNFOnVerificationErrorsRecipients = $PFNFOnVerificationErrorsRecipients -replace "'","''"
                $PFNFNotifyOnPasswordUsed = $PFNFNotifyOnPasswordUsed -replace "'","''"
                $PFNFOnPasswordUsedRecipients = $PFNFOnPasswordUsedRecipients -replace "'","''"
                $PFPasswordLength = $PFPasswordLength -replace "'","''"
                $PFMinUpperCase = $PFMinUpperCase -replace "'","''"
                $PFMinLowerCase = $PFMinLowerCase -replace "'","''"
                $PFMinDigit = $PFMinDigit -replace "'","''"
                $PFMinSpecial = $PFMinSpecial -replace "'","''"
                $PFPasswordLevelRequestTimeframe = $PFPasswordLevelRequestTimeframe -replace "'","''"

                try{
                    $query = "INSERT INTO $TableName ( ID, Name, SystemType, Active, Description, PlatformBaseID, PlatformType, PropertiesRequired, PropertiesOptional, LinkedAccounts, AllowedSafes, AllowManualChange, PerformPeriodicChange, RequirePasswordChangeEveryXDays, AllowManualVerification, PerformPeriodicVerification, RequirePasswordVerificationEveryXDays, AllowManualReconciliation, AutomaticReconcileWhenUnsynched, RequirePrivilegedSessionMonitoringAndIsolation, RecordAndSaveSessionActivity, PSMServerID, RequireDualControlPasswordAccessApproval, EnforceCheckinCheckoutExclusiveAccess, EnforceOnetimePasswordAccess, ConnectionComponents, SearchForUsages, PolicyType, ImmediateInterval, Interval, MaxConcurrentConnections, MinValidityPeriod, ResetOveridesMinValidity, ResetOveridesTimeFrame, Timeout, UnlockIfFail, UnrecoverableErrors, MaximumRetries, MinDelayBetweenRetries, DllName, XMLFile, HeadStartInterval, FromHour, ToHour, ChangeNotificationPeriod, DaysNotifyPriorExpiration, VFFromHour, VFToHour, RCReconcileReasons, RCFromHour, RCToHour, NFNotifyPriorExpiration, NFPriorExpirationRecipients, NFNotifyOnPasswordDisable, NFOnPasswordDisableRecipients, NFNotifyOnVerificationErrors, NFOnVerificationErrorsRecipients, NFNotifyOnPasswordUsed, NFOnPasswordUsedRecipients, PasswordLength, MinUpperCase, MinLowerCase, MinDigit, MinSpecial, PasswordLevelRequestTimeframe ) VALUES ( '$PFGeneralID', '$PFGeneralName', '$PFGeneralSystemType', '$PFGeneralActive', '$PFGeneralDescription', '$PFGeneralPlatformBaseID', '$PFGeneralPlatformType', '$PFPropertiesRequired', '$PFPropertiesOptional', '$PFLinkedAccounts', '$PFCredentialsManagementAllowedSafes', '$PFCredentialsManagementAllowManualChange', '$PFCredentialsManagementPerformPeriodicChange', '$PFCredentialsManagementRequirePasswordChangeEveryXDays', '$PFCredentialsManagementAllowManualVerification', '$PFCredentialsManagementPerformPeriodicVerification', '$PFCredentialsManagementRequirePasswordVerificationEveryXDays', '$PFCredentialsManagementAllowManualReconciliation', '$PFCredentialsManagementAutomaticReconcileWhenUnsynched', '$PFSessionManagementRequirePrivilegedSessionMonitoringAndIsolation', '$PFSessionManagementRecordAndSaveSessionActivity', '$PFSessionManagementPSMServerID', '$PFPrivilegedAccessWorkflowsRequireDualControlPasswordAccessApproval', '$PFPrivilegedAccessWorkflowsEnforceCheckinCheckoutExclusiveAccess', '$PFPrivilegedAccessWorkflowsEnforceOnetimePasswordAccess', '$PFConnectionComponents', '$PFSearchForUsages', '$PFPolicyType', '$PFImmediateInterval', '$PFInterval', '$PFMaxConcurrentConnections', '$PFMinValidityPeriod', '$PFResetOveridesMinValidity', '$PFResetOveridesTimeFrame', '$PFTimeout', '$PFUnlockIfFail', '$PFUnrecoverableErrors', '$PFMaximumRetries', '$PFMinDelayBetweenRetries', '$PFDllName', '$PFXMLFile', '$PFHeadStartInterval', '$PFFromHour', '$PFToHour', '$PFChangeNotificationPeriod', '$PFDaysNotifyPriorExpiration', '$PFVFFromHour', '$PFVFToHour', '$PFRCReconcileReasons', '$PFRCFromHour', '$PFRCToHour', '$PFNFNotifyPriorExpiration', '$PFNFPriorExpirationRecipients', '$PFNFNotifyOnPasswordDisable', '$PFNFOnPasswordDisableRecipients', '$PFNFNotifyOnVerificationErrors', '$PFNFOnVerificationErrorsRecipients', '$PFNFNotifyOnPasswordUsed', '$PFNFOnPasswordUsedRecipients', '$PFPasswordLength', '$PFMinUpperCase', '$PFMinLowerCase', '$PFMinDigit', '$PFMinSpecial', '$PFPasswordLevelRequestTimeframe' );"
                    $UpdateRec = Invoke-Sqlcmd -ServerInstance $SQLServer -Database $SQLDatabase -Query $query -Username $SQLUsername -Password $Secret
                    Write-Verbose "ADDED RECORD INTO $TableName FOR PLATFORMID: $PFPlatformID"
                }catch{
                    Write-Verbose "FAILED TO ADD RECORD INTO $TableName FOR PLATFORMID: $PFPlatformID"
                    Write-VPASOutput -str "FAILED TO ADD RECORD INTO $TableName FOR PLATFORMID: $PFPlatformID" -type E
                    Write-VPASOutput -str $_ -type E
                }
            }
        }
        #######################
        return $true
    }
    End{
        $log = Write-VPASTextRecorder -inputval $CommandName -token $token -LogType DIVIDER
        $token = Update-VPASSession -AddCounter $APICounter -InputToken $token
    }
}

# SIG # Begin signature block
# MIIsuQYJKoZIhvcNAQcCoIIsqjCCLKYCAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB
# gjcCAQSgWzBZMDQGCisGAQQBgjcCAR4wJgIDAQAABBAfzDtgWUsITrck0sYpfvNR
# AgEAAgEAAgEAAgEAAgEAMCEwCQYFKw4DAhoFAAQUSLG+/Ro06LbNYuUMaqQ4Zau0
# vRWggiXzMIIFbzCCBFegAwIBAgIQSPyTtGBVlI02p8mKidaUFjANBgkqhkiG9w0B
# AQwFADB7MQswCQYDVQQGEwJHQjEbMBkGA1UECAwSR3JlYXRlciBNYW5jaGVzdGVy
# MRAwDgYDVQQH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