New-CMSoftwareMeteringRule
Creates a Configuration Manager software metering rule.
Syntax
New-CMSoftwareMeteringRule
[-Comment <String>]
[-FileName <String>]
[-FileVersion <String>]
[-LanguageId <Int32>]
[-OriginalFileName <String>]
-ProductName <String>
[-SiteCode <String>]
[-DisableWildcardHandling]
[-ForceWildcardHandling]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-CMSoftwareMeteringRule
-Path <String>
[-ProductName <String>]
[-SiteCode <String>]
[-DisableWildcardHandling]
[-ForceWildcardHandling]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The New-CMSoftwareMeteringRule cmdlet creates a Configuration Manager software metering rule. A software metering rule specifies a piece of software, along with version information. You can obtain necessary file information from Windows Explorer.
Software metering monitors and collects software usage data from Configuration Manager clients, such as when clients began using a particular software program and how long users have worked with that software. You can create software metering rules that specify which software to monitor.
For more information about software metering in Configuration Manager, see Introduction to Software Metering in Configuration Manager.
Note
Run Configuration Manager cmdlets from the Configuration Manager site drive, for example PS XYZ:\>
. For more information, see getting started.
Examples
Example 1: Create a software metering rule
PS XYZ:\> New-CMSoftwareMeteringRule -Path "Notepad.exe" -SiteCode "CM1" -FileVersion "6.1.7600.16385" -OriginalFileName "NOTEPAD.EXE" -ProductName "Microsoft Windows Operating System"
ApplyToChildSites : True
Comment :
Enabled : True
FileName : Notepad.exe
FileVersion : 6.1.7600.16385
LanguageID :
LastUpdateTime :
OriginalFileName : NOTEPAD.EXE
ProductName : Microsoft Windows Operating System
RuleID :
SecurityKey :
SiteCode : CM1
SourceSite :
This command creates a software metering rule for the Configuration Manager site named CM1. The command specifies the file name, version, original file name, and product name for the software product.
Parameters
-Comment
Specifies a comment for a software metering rule.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Confirm
Prompts you for confirmation before running the cmdlet.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DisableWildcardHandling
This parameter treats wildcard characters as literal character values. You can't combine it with ForceWildcardHandling.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-FileName
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-FileVersion
Specifies a version of the software that a rule meters.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ForceWildcardHandling
This parameter processes wildcard characters and may lead to unexpected behavior (not recommended). You can't combine it with DisableWildcardHandling.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-LanguageId
Specifies a LocaleID of the software that a rule meters. For more information and a list of locale identifiers, see Appendix A: Product Behavior.
Type: | Int32 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-OriginalFileName
Specifies an original file name of the software that a rule meters. This parameter can differ from the Path parameter if a user changed the name.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Path
Specifies a file path of the software that a rule meters.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ProductName
Specifies a name for a product that a rule meters.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-SiteCode
Specifies a site code for a Configuration Manager site.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet doesn't run.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Inputs
None
Outputs
IResultObject