Help with New-UDTable

I have the below script:

Import-Module UniversalDashboard.Community -Force

$Theme = Get-UDTheme Default
$cred = [System.Net.CredentialCache]::DefaultCredentials
[System.Net.WebRequest]::DefaultWebProxy.Credentials = $cred

$username = “”
$password = Get-Content ‘’ | ConvertTo-SecureString
$Credentials = new-object -typename System.Management.Automation.PSCredential -argumentlist $username, $password

$Port = 10004

$proxyOptions = New-PSSessionOption -ProxyAccessType IEConfig
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri -Credential $Credentials -Authentication Basic -AllowRedirection -SessionOption $proxyOptions
Import-PSSession $Session -AllowClobber

Dashboard = New-UDPage -Name "Quarantined Emails" -Icon home -Content { New-UDRow -Columns { New-UDColumn -Size 12 { New-UDTable -Title "Quarantined Emails" -Headers @("ReceivedTime", "RecipientAddress","Subject", "Release") -Endpoint { Get-QuarantineMessage -SenderAddress *Email Address* | Select-Object ReceivedTime,RecipientAddress,Subject,MessageId | ForEach-Object { [PSCustomObject]@{ ReceivedTime = .ReceivedTime
RecipientAddress = _.RecipientAddress Subject =
Release = New-UDButton -Floating -Icon unlock_alt -OnClick {Release-QuarantineMessage -MessageID $_.MessageId; Show-UDToast -Message “Message Released”}
} | Out-UDTableData -Property @(“ReceivedTime”, “RecipientAddress”,“Subject”, “Release”)

		New-UDButton -Text "Release all" -OnClick {
            Get-QuarantineMessage -SenderAddress *Email Address* | Release-QuarantineMessage
			Show-UDToast -Message "All Quarantined Emails Released"


Get-UDDashboard | Stop-UDDashboard
$Dashboard = New-UDDashboard -Title “Quarantined Emails” -Theme $Theme -Pages @($Dashboard)
Start-UDDashboard -Port $Port -Dashboard $Dashboard

I am trying to query O365 Quarantine items for a particular email address and display them with the option of releaseing one or all emails.

Whenever I run this it comes up with an error saying that Get-QuarantineMessage is an unknown command, although I have connected to O365.

Any help would be great

Kind Regards

Sean Buckle

You may need to import that module under the endpoint where you are using the get-quarantined command. What I do is I have a script folder with all my external commands and just call the script with parameters to return the data I want. I think there is a new-udendpointmodule or something like that in UD, I just havent figured all that out yet.

You need to used New-UDEndpointInitialization -Function @(“your functions”) -Module @(“module name or the path to the psm1 file”)

take a look at this