This section describes the Get-MDTPersistentDrive Windows PowerShell cmdlet. Run this cmdlet from a Windows PowerShell console that has the MDT PowerShell snap-in loaded. For more information on how to start a Windows PowerShell console that has the MDT PowerShell snap-in loaded, see Loading the MDT Windows PowerShell Snap-In.

Syntax

Set-MDTMonitorData [-Path <String>] [-ComputerObject <PSObject>] [-Settings <Hashtable>] [<CommonParameters>]

–or–

Set-MDTMonitorData [-Path <String>] [-MacAddress <String>] [‑Settings <Hashtable>] [<CommonParameters>]

Description

This cmdlet creates a new monitoring data item, or updates an existing monitoring data item, in a deployment share. You can identify the monitoring data to remove by specifying the:

·     Computer object for the monitoring item in the deployment share. The computer object can be obtained using the Get-MDTMonitorData cmdlet. The first syntax example illustrates this usage.

·     MAC address of the primary network adapter of the monitoring item for a specific deployment share. The MAC address is automatically assigned to the monitoring data item when the item is created for the deployment share. The last syntax example illustrates this usage.

Note   Once the monitoring data has been removed, there is no method for recovering the information.

Parameters

This subsection provides information about the various parameters that can be used with the Get- MDTMonitorData cmdlet.

-Path <String>

This parameter specifies the MDTProvider Windows PowerShell drive for the desired deployment share.

Note   If this parameter is not provided, then the Windows PowerShell working directory must default to a location within the desired MDTProvider Windows PowerShell drive.

 

Parameter

Value

Required?

False

Position?

Named

Default value

Accept pipeline input?        

False

Accept wildcard characters?

False

 

-ComputerObject <PSObject>

This parameter specifies the monitoring data item to be created or updated using a computer object. If this parameter is not specified, then the MACAddress parameter must be specified to identify a particular monitoring data item.

 

Parameter

Value

Required?

False

Position?

Named

Default value

Accept pipeline input?        

True (ByValue)

Accept wildcard characters?

False

 

-MACAddress <String>

This parameter specifies the monitoring data item to be created or updated using the MAC address of the primary network adapter of the computer being monitored. The format of the MACAddress is xx:xx:xx:xx:xx:xx, where x is a hexadecimal character specified in uppercase (as required). If this parameter is not specified, then the ComputerObject parameter must be specified to identify a particular monitoring data item.

 

Parameter

Value

Required?

False

Position?

Named

Default value

Accept pipeline input?        

True (ByValue)

Accept wildcard characters?

False

 

-Settings <Hashtable>

This parameter specifies the monitoring data settings for the monitoring data item to be created or updated. The format of the hashtable provided with this parameter is @{"Setting"="Value"; "Setting1"="Value1"; "Setting2"="Value2}. If this parameter is not specified, then the monitoring data item is created, but no monitoring information is stored.

"Setting" can be any property listed in the ZTIGather.xml file. Value can be any valid value for the property specfied in "Setting".

 

Parameter

Value

Required?

False

Position?

Named

Default value

Accept pipeline input?        

True (ByValue)

Accept wildcard characters?

False

 

<CommonParameters>

This cmdlet supports the following common parameters: Verbose, Debug, ErrorAction, ErrorVariable, OutBuffer, OutVariable, WarningAction, and WarningVariable. For more information, see the topic, “about_CommonParameters,” which you can access by typing the following command, and then pressing ENTER:

Get-Help about_CommonParameters

Outputs

This cmdlet does not generate any output.

Example 1

$MonitorObject=Get-MDTMonitorData | Where-Object {$_.Name ‑eq 'WDG-REF-01'}

Set-MDTMonitorData -ComputerObject $MonitorObject ‑Setting @{"OSDComputerName"="WDG-MDT-01";"SkipWizard"="YES"}

Description

This example removes any monitoring data item where the name of the computer is WDG-REF-01. The object is found using the Get-MDTMonitorData cmdlet and the Where-Object cmdlet. For more information on the Where-Object cmdlet, see Using the Where-Object Cmdlet. The OSDComputerName property is recorded as having a value of WDG-MDT-01, and the SkipWizard property is recorded as having a value of YES.

Example 2

Set-MDTMonitorData -MACAddress "00:11:22:33:44:55" MonitorObject ‑Setting @{"OSDComputerName"="WDG-MDT-01";"SkipWizard"="YES"}

Description

This example creates or updates a monitoring data item with a MACAddress that has a value of 00:11:22:33:44:55. The OSDComputerName property is recorded as having a value of WDG-MDT-01, and the SkipWizard property is recorded as having a value of YES.

Related Topics

MDT Windows PowerShell Cmdlets