New-MDMInventoryItem

2/9/2009

The New-MDMInventoryItem cmdlet creates a new device inventory collection task.

The New-MDMInventoryItem cmdlet adds the new device inventory collection task to the list of inventory collection tasks on the server. The inventory collection task runs at the interval specified. Additionally, the New-MDMInventoryItem cmdlet adds the new task to the server Uniform Resource Identifier (URI) table.

Syntax

New-MDMInventoryItem -Category <InventoryCategory> -CollectionFrequency <CollectionFrequency> -Name <string> -Type <UriDataType> -Uri <string> [-confirm] [-whatif] [<CommonParameters>]

New-MDMInventoryItem [-Item] <MDMInventoryItem> [-confirm] [-whatif] [<CommonParameters>]

Parameters

The following describes the New-MDMInventoryItem cmdlet 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 Device Management (OMA 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.
  • Item <MDMInventoryItem>
    Accepts an MDMInventoryItem object as input.
  • WhatIf
    Informs you of what changes would be made if the action were to be performed (the cmdlet is not executed).
  • Confirm
    Prompts you for confirmation before the cmdlet executes.
  • CommonParameters
    This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, and -OutVariable. For more information, at the MDM Shell prompt, type get-help about_commonparameters.

Input Type

The New-MDMInventoryItem cmdlet accepts an MDMInventoryItem object. To see all the properties for this object, at the MDM Shell prompt, type Get-MDMInventoryItem | Get-Member.

Output Type

None

Examples

This New-MDMInventoryItem command 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

Cmdlet Help

To view this information online, at the MDM Shell prompt, type:

get-help New-MDMInventoryItem -detailed, or get-help New-MDMInventoryItem -full

See Also

Reference

Get-MDMInventoryItem
Set-MDMInventoryItem
Remove-MDMInventoryItem