@Kalaimani Thirupathi We don't have a sample script readily available. However, you can write your own script using Azure Monitor powershell. The main cmdlet involved is Get-AzDiagnosticSetting (https://learn.microsoft.com/powershell/module/az.monitor/get-azdiagnosticsetting?view=azps-5.3.0)
You can run this cmdlet for all your vaults, and if the output has 'WorkspaceId' field as non-null, it means that vault is enabled for Log Analytics.
----------------------------------------------------------------------------------------------------------------------
If the response helped, do "Accept Answer" and up-vote it