dell / OpenManage-PowerShell-Modules

Apache License 2.0
20 stars 8 forks source link

Create a group and add devices to the group #8

Closed SirRuggie closed 1 year ago

SirRuggie commented 1 year ago

Good Morning,

reaching out to you once again to see if something can be implemented or if it already is if you could point me in the right direction. I've been working with one of the Senior Engineers in Dell and he pointed me to this API in the following link.

I wanted to see if this could be implemented? Create a group and add devices to the group

TrevorSquillario commented 1 year ago

So you're looking to create a Services plugin group and add devices to the group? I'll look into it.

SirRuggie commented 1 year ago

Yes sir!

TrevorSquillario commented 1 year ago

This is possible with the current module. See below

# Get the example json. Edit and store this in a file or variable.
New-OMESupportAssistGroup -ExportExampleJson

# Create Services group from file 
New-OMESupportAssistGroup -AddGroup $(Get-Content "C:\Temp\Group.json" -Raw) -Verbose

# Get newly created group
"Support Assist Test Group 1" | Get-OMEGroup | Format-List

$devices = $("859N3L3", "759N3L3" | Get-OMEDevice -FilterBy "ServiceTag")
"Support Assist Test Group 1" | Get-OMEGroup | Edit-OMESupportAssistGroup -Devices $devices -Verbose

I posted a more in-depth example using variables https://github.com/dell/OpenManage-PowerShell-Modules/blob/main/Examples/ServicesGroupCreateAddDevices.ps1

SirRuggie commented 1 year ago

I'm having trouble with adding the shipping details with the module. The snippet you included above works, but the one I'm listing does not.


$GroupJsonString = @'
{
  "Id": 0,
  "Name": "string",
  "Description": "string",
  "ContactOptIn": true,
  "DispatchOptIn": false,
  "MyAccountId": "string",
  "CustomerDetails": {
    "PrimaryContact": {
      "FirstName": "string",
      "LastName": "string",
      "Email": "string",
      "Phone": "string",
      "AlternatePhone": "string",
      "TimeFrame": "10:00 AM-4:00 PM",
      "TimeZone": "TZ_ID_66,
      "ContactMethod": "phone"
    },
    "SecondaryContact": {
      "FirstName": "string",
      "LastName": "string",
      "Email": "string",
      "Phone": "string",
      "AlternatePhone": "string",
      "TimeFrame": "10:00 AM-4:00 PM",
      "TimeZone": "TZ_ID_66",
      "ContactMethod": "phone"
    },
    "ShippingDetails": {
      "PrimaryContact": {
        "FirstName": "string",
        "LastName": "string",
        "Email": "string",
        "Phone": "string",
        "AlternatePhone": "string"
      },
      "SecondaryContact": {
        "FirstName": "string",
        "LastName": "string",
        "Email": "string",
        "Phone": "string",
        "AlternatePhone": "string"
      },
      "Country": "US",
      "State": "string",
      "City": "string",
      "Zip": "string",
      "Cnpj": "string",
      "Ie": "string",
      "AddressLine1": "string",
      "AddressLine2": "string",
      "AddressLine3": "string",
      "AddressLine4": "string",
      "PreferredContactTimeZone": "TZ_ID_66",
      "PreferredContactTimeFrame": "10:00 AM-4:00 PM",
      "TechnicianRequired": true,
      "DispatchNotes": "string"
    }
  }
}
'@
TrevorSquillario commented 1 year ago

The Shipping Details are related to auto parts dispatch so this will need to be set to true.

"DispatchOptIn": false,

SirRuggie commented 1 year ago

image How would I check the box "I want Dell EMC to expedite dispatch of the replacement parts"

TrevorSquillario commented 1 year ago

"DispatchOptIn": true,

SirRuggie commented 1 year ago

I set it to that and it's creating the group, but it is not checking that option inside of OME.

TrevorSquillario commented 1 year ago

It's checked under the Services group > Edit Services Group. I'm assuming you would like it checked globally under Plugins > Services > Settings > Shipping Details. The idea behind Services groups is that they have different contact and shipping details for the group.

image