Scripts/UpdateEndpointInventoryFromComment.ps1

$Credential = Get-Credential
$RogueGroupName = '[rogue]'
$ExpiredGroupName = '[Expired]'
$Pattern = '([a-z,A-Z]{2}|_|\b)(?<IV>0{1}\d{5})($|\D)'


$PSDefaultParameterValues = @{
  '*Macmon*:Credential' = $Credential
  '*Macmon*:HostName'   = 'SRVNAC01'
}

$EndPointColl = Get-MacmonEndpoint

foreach ($EndPoint in $EndPointColl)
{
  if (($EndPoint.comment) -match $Pattern)
  {
    Update-MacmonEndpointProperty -MACAddress $EndPoint.mac -Comment '' -Inventory $($Matches.IV) -Confirm
  }
}