This command does not work as documented. Just following the simple example on the cmdlet help page
fails with “Unable to determine type of provided column definition”.
Wondering if anyone knows a trick to get around this. My actual params look like this:
$Params = @{
displayName = 'EXO Mailbox Size Report'
columns = @(
@{
name = 'DisplayName'
text = @{}
required = $true
}
@{
name = 'PrimarySmtpAddress'
text = @{}
required = $true
indexed = $true
}
@{
name = 'PrimaryQuotaStatus'
choice = @{
allowTextEntry = $false
choices = @('OK', 'Issue Warning', 'Prohibit Send', 'Prohibit Send and Receive', 'Unchecked')
displayAs = 'dropDownMenu'
}
required = $true
defaultValue = 'Unchecked'
}
@{
name = 'MailboxSizeGB'
number = @{}
}
@{
name = 'IssueWarningQuota'
number = @{}
required = $true
}
@{
name = 'ProhibitSendQuota'
number = @{}
required = $true
}
@{
name = 'ProhibitSendReceiveQuota'
number = @{}
required = $true
}
@{
name = 'ArchiveQuotaStatus'
choice = @{
allowTextEntry = $false
choices = @('OK', 'Issue Warning', 'Prohibit Send', 'Prohibit Send and Receive', 'Unchecked')
displayAs = 'dropDownMenu'
}
required = $true
defaultValue = 'Unchecked'
}
@{
name = 'ArchiveSizeGB'
number = @{}
}
@{
name = 'ArchiveWarningQuota'
number = @{}
required = $true
}
@{
name = 'ArchiveQuota'
number = @{}
required = $true
}
@{
name = 'RecipientTypeDetails'
text = @{}
required = $true
}
@{
name = 'RetentionPolicy'
text = @{}
required = $true
}
@{
name = 'ExoGuid'
text = @{}
required = $true
indexed = $true
}
@{
name = 'EntraObjectId'
text = @{}
indexed = $true
}
@{
name = 'ADDomain'
text = @{}
}
@{
name = 'ADObjectGuid'
text = @{}
}
@{
name = 'ExchangeGuid'
text = @{}
enforceunique = $true
required = $true
indexed = $true
}
@{
name = 'ArchiveGuid'
text = @{}
required = $true
}
@{
name = 'RecoverableItemsGB'
number = @{}
description = 'TotalDeletedItemSize (in gigabytes) from Get-MailboxStatistics.'
}
@{
name = 'ArchiveRecoverableItemsGB'
number = @{}
description = 'TotalDeletedItemSize (in gigabytes) from Get-MailboxStatistics -Archive.'
}
@{
name = 'WhenCreated'
dateTime = @{
displayAs = 'standard'
format = 'dateOnly'
}
}
@{
name = 'WhenChanged'
dateTime = @{
displayAs = 'standard'
format = 'dateOnly'
}
}
@{
name = 'WhenMailboxCreated'
dateTime = @{
displayAs = 'standard'
format = 'dateTime'
}
}
@{
name = 'LastUserActionTime'
dateTime = @{
displayAs = 'standard'
format = 'dateOnly'
}
}
)
list = @{
template = "genericList"
}
}
New-MgSiteList -SiteId $siteId -BodyParameter $newMgSiteListParams
I tried the exact example from the documentation, as well as my own params with actual columns I want, and in either case I expected a 201 Created response code and a list object in the response body – per the documentation.
I’m unable to find a single online resource where somebody has pulled this off using the official New-MgSiteList cmdlet. I did find one example where somebody just creates the list with no columns initially. I’m not looking to do that.