ContributionsMost RecentMost LikesSolutionsRe: [Feature request] Custom PowerShell script: increase timeout I love this idea, and it might be a nice vehicle to pivot away from our vendor specific language around data collection types (e.g. ConfigChecks = Text, PropertySources = Metadata, DataSources = Metrics, ect..) Whenever I hit these limits within DataSources, I’ll pivot to other Datacollection method for long running scripts. Generally for long running scripts I would choose NetScan, ConfigSource, or PropertySource methods. Each of these have longer timeouts associated and can be used to do time intensive collection. Otherwise, there are almost always script optimizations which enormously speed collection or processing (concepts like “filter left”); or alternative collection processes can split the stages between different scripts within a LogicModule (e.g Use scheduled NetScan to pull data to the Collector, then use this as a cache to speed up corollary steps). Re: How to create datasources from powershell script You can simplify this script if you use Get-ChildItem to grab the certs directly from the certificate store. Using the Powershell provider usually takes care of the variable typing and formatting which is very nice. Below, I pulled out EnhancedKeyUsageList, but the GetFormat() method might align to your preference for CertUtil template name schema. Example: $DesiredProperties = "CommonName,NotBefore,NotAfter,EnhancedKeyUsageList" $AllCerts = Get-ChildItem -Recurse -Path "Cert:\" | Where-Object {$_.Thumbprint} | Select-Object -Property $DesiredProperties ## Other neat uses of Get-ChildItem for the Powershell Certificate provider # $CodeSigningCert = Get-ChildItem -Recurse -Path "Cert:\CurrentUser\My" -CodeSigningCert # $RemoteAuthCert = Get-ChildItem -Recurse -Path "Cert:\CurrentUser\My" -SSLServerAuthentication Also, if you’re looking for performance optimizations: Using “+=” copies everything from the initial memory space into a new memory space with the extra object appended to the end. This is fine for small datasets, but you will see large performance impacts (and memory requirements) with increasing size. Select-String is extremely efficient for parsing through text, even more so than falling back to .NET in many cases. Looping through line by line with foreach, or Foreach-Object will be slower especially when used with unoptimized regex or match statements (which is another ~deep subject =).
Top ContributionsRe: How to create datasources from powershell scriptRe: [Feature request] Custom PowerShell script: increase timeout