public/Get-VPASSQLPlatforms.ps1

<#
.Synopsis
   GET SQL PLATFORMS
   CREATED BY: Vadim Melamed, EMAIL: vpasmodule@gmail.com
.DESCRIPTION
   USE THIS FUNCTION TO OUTPUT ALL PLATFORM DETAILS INTO AN SQL TABLE
.LINK
   https://vpasmodule.com/commands/Get-VPASSQLPlatforms
.NOTES
   SelfHosted: TRUE
   PrivCloudStandard: TRUE
   SharedServices: 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 = 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
                }
                else{
                    $CCPResult = Invoke-RestMethod -Uri $uri -CertificateThumbprint $CertificateTP
                }

                $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
                }
                else{
                    $result = Invoke-RestMethod -Headers @{"Authorization"=$Header} -Uri $uri -Method GET -ContentType "application/json"
                }
                $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
                }
                else{
                    $result = Invoke-RestMethod -Headers @{"Authorization"=$Header} -Uri $uri -Method GET -ContentType "application/json"
                }
                $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
                }
                else{
                    $result = Invoke-RestMethod -Headers @{"Authorization"=$Header} -Uri $uri -Method GET -ContentType "application/json"
                }
                $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
                }
                else{
                    $result = Invoke-RestMethod -Headers @{"Authorization"=$Header} -Uri $uri -Method GET -ContentType "application/json"
                }
                $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
    }
}

# SIG # Begin signature block
# MIIroAYJKoZIhvcNAQcCoIIrkTCCK40CAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB
# gjcCAQSgWzBZMDQGCisGAQQBgjcCAR4wJgIDAQAABBAfzDtgWUsITrck0sYpfvNR
# AgEAAgEAAgEAAgEAAgEAMCEwCQYFKw4DAhoFAAQU/Y0+IRoM4GuTestOMGVZHsQj
# jmWggiTbMIIFbzCCBFegAwIBAgIQSPyTtGBVlI02p8mKidaUFjANBgkqhkiG9w0B
# AQwFADB7MQswCQYDVQQGEwJHQjEbMBkGA1UECAwSR3JlYXRlciBNYW5jaGVzdGVy
# MRAwDgYDVQQHDAdTYWxmb3JkMRowGAYDVQQKDBFDb21vZG8gQ0EgTGltaXRlZDEh
# MB8GA1UEAwwYQUFBIENlcnRpZmljYXRlIFNlcnZpY2VzMB4XDTIxMDUyNTAwMDAw
# MFoXDTI4MTIzMTIzNTk1OVowVjELMAkGA1UEBhMCR0IxGDAWBgNVBAoTD1NlY3Rp
# Z28gTGltaXRl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