The New-MDMInventoryItemcmdlet creates a new device inventory collection task.
The New-MDMInventoryItemcmdlet adds the new device inventory collection task to the list of inventory collection tasks on the server. The inventory collection task executes at the interval specified. Additionally, the New-MDMInventoryItemcmdlet adds the new task to the server Uniform Resource Identifier (URI) table.
New-MDMInventoryItem -Name <String> -Uri <String> -CollectionFrequency <CollectionFrequency> -Category <InventoryCategory> -Type <UriDataType> [-WhatIf] [-Confirm] [<CommonParameters>] New-MDMInventoryItem [-Instance] <MDMInventoryItem> [-WhatIf] [-Confirm] [<CommonParameters>]
The following describes the New-MDMInventoryItemcmdlet parameters.
- Name <String>
A unique name to assign to the new collection task. The name cannot contain spaces. If the name is already being used, an error occurs and the command fails.
- Uri <String>
The location in the client Open Mobile Alliance (OMA) device management (DM) tree for the new collection task. This location must be unique. The cmdlet does not make other validity checks. If the URI specified is already being used, an error results and the command fails.
- CollectionFrequency <CollectionFrequency>
The name that represents one of the supported collection frequencies. If the name does not match the existing frequency descriptions, an error results and the command fails. Valid frequencies are NotCollected, EveryConnect, Daily, EveryOtherDay, Weekly, EveryOtherWeek, Monthly, EveryOtherMonth, Quarterly, Semiannually, Annually, and InitialDiscovery.
- Category <InventoryCategory>
The name that represents one of the supported device data categories. If the name is not a valid category name, an error results and the command fails. Valid categories are GeneralInformation, ApplicationSettings, DeviceSettings, ProxySettings, NapSettings, VpnSettings, RomPackage, Certificates, InstalledSoftware, and FileInformation.
- Type <UriDataType>
Alias of the standard data type associated with the new data element. Valid types are Chr, Int, Bool, Time, Date, and Node.
- Instance <MDMInventoryItem>
Accepts an MDMInventoryItemobject as input.
Informs you of what changes would be made if the action were to be performed (the cmdlet is not executed).
Prompts you for confirmation before the cmdlet executes.
This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, and -OutVariable. For more information, at the Mobile Device Manager (MDM) Shell prompt, type get-help about_commonparameters.
The New-MDMInventoryItemcmdlet accepts an MDMInventoryItemobject. To see all the properties for this object, at the MDM Shell prompt, type Get-MDMInventoryItem | Get-Member.
This New-MDMInventoryItemcommand example creates a new device inventory collection task that has the name, OpenOrders. The task runs every time that the device connects to the server and it collects application settings of the type Int, and then stores the result in a new URI.
C:\PS>New-MDMInventoryItem -name OpenOrders -collectionfrequency EveryConnect –category ApplicationSettings -type Int -uri “\Vendor\MSFT\Registry\HKLM\Software\Fusebox\Orders”
This sequence of commands creates a copy of an existing inventory collection task that has the name, OpenOrders. The copy, named YearOrders, has a collection frequency of Annually. The server stores the results from the task in a new URI.
C:\PS>$a = Get-MDMInventoryItem –identity OpenOrders C:\PS>$a.name=YearOrders C:\PS>$a.collectionfrequency = Annually C:\PS>$a.URI=“\Vendor\MSFT\Registry\HKLM\Software\Fusebox\Orders" C:\PS>New-MDMInventoryItem $a
To view this information online, at the MDM Shell prompt, type:
get-help New-MDMInventoryItem -detailed, or get-help New-MDMInventoryItem -full