Another one about finding VBS usage… Since Microsoft has announced the deprecation of VBScript. VBS files can be used in the install and/or uninstall command line:
and also can be chosen as the script language in a detection script:
I originally wrote this in PowerShell, but it was taking an awfully long time, so I decided to try it in SQL.
declare @LocaleID int = (select LocaleID from vSMSData) declare @CommandLineSearchString varchar (100) = '%.vbs%' declare @DetectionMethod varchar (100) = 'Script' declare @DetectionScriptLanguage varchar (100) = 'VBScript' ; WITH XMLNAMESPACES (DEFAULT 'http://schemas.microsoft.com/SystemCenterConfigurationManager/2009/AppMgmtDigest') select app.DisplayName [Application] , app.Description , dt.SDMPackageDigest.value ('(/AppMgmtDigest/DeploymentType/Title)[1]', 'nvarchar(max)') [Deployment Type] , case when dt.SDMPackageDigest.value ('(/AppMgmtDigest/DeploymentType/Installer/InstallAction/Args/Arg)[1]', 'nvarchar(max)') like @CommandLineSearchString then dt.SDMPackageDigest.value ('(/AppMgmtDigest/DeploymentType/Installer/InstallAction/Args/Arg)[1]', 'nvarchar(max)') else '' end [InstallCommandLine] , case when dt.SDMPackageDigest.value ('(/AppMgmtDigest/DeploymentType/Installer/UninstallAction/Args/Arg)[1]', 'nvarchar(max)') like @CommandLineSearchString then dt.SDMPackageDigest.value ('(/AppMgmtDigest/DeploymentType/Installer/UninstallAction/Args/Arg)[1]', 'nvarchar(max)') else '' end [UninstallCommandLine] , case when dt.SDMPackageDigest.value ('(/AppMgmtDigest/DeploymentType/Installer/CustomData/DetectionMethod)[1]', 'nvarchar(max)') = @DetectionMethod and dt.SDMPackageDigest.value ('(/AppMgmtDigest/DeploymentType/Installer/CustomData/DetectionScript/@Language)[1]', 'nvarchar(max)') = @DetectionScriptLanguage then @DetectionMethod + ' - ' + @DetectionScriptLanguage else '' end [DetectionMethod-ScriptLanguage] from v_ConfigurationItems dt INNER JOIN v_CIRelation AS rel ON dt.CI_ID = rel.ToCIID INNER JOIN fn_ListApplicationCIs_List(@LocaleID) AS app ON app.CI_ID = rel.FromCIID where (dt.CIType_ID = 21 and dt.IsLatest = 1) and ( dt.SDMPackageDigest.value ('(/AppMgmtDigest/DeploymentType/Installer/InstallAction/Args/Arg)[1]', 'nvarchar(max)') like @CommandLineSearchString or dt.SDMPackageDigest.value ('(/AppMgmtDigest/DeploymentType/Installer/UninstallAction/Args/Arg)[1]', 'nvarchar(max)') like @CommandLineSearchString or ( dt.SDMPackageDigest.value ('(/AppMgmtDigest/DeploymentType/Installer/CustomData/DetectionMethod)[1]', 'nvarchar(max)') = @DetectionMethod and dt.SDMPackageDigest.value ('(/AppMgmtDigest/DeploymentType/Installer/CustomData/DetectionScript/@Language)[1]', 'nvarchar(max)') = @DetectionScriptLanguage ) )
Results look like: