Get-DhcpServerv4Scope -ScopeId issue

Hello!

Im having issues with showing IPadress as Grid , works perfect with normal strings like “Name” and “Description”.

My code:
New-UdGrid -Title “DHCP Scopes” -Headers @(“Name”,“Description”,“ScopeId”) -Properties @(“Name”,“Description”,“ScopeId”) -Endpoint {
Get-DhcpServerv4Scope -Computername dhcpsrv1.xxx.com | Select Name, Description,ScopeId | Out-UdGridData
}

If i try it manually from powershell i get output:
“recordsTotal”: 1,
“data”: [
{
“Name”: “Test”,
“Description”: “tes”,
“ScopeId”: {
“Address”: 6269120,
“AddressFamily”: 2,
“ScopeId”: null,
“IsIPv6Multicast”: false,
“IsIPv6LinkLocal”: false,
“IsIPv6SiteLocal”: false,
“IsIPv6Teredo”: false,
“IsIPv4MappedToIPv6”: false,
“IPAddressToString”: “192.168.95.0”
}
}
],

But i want it to only show the “IPAddressToString”…

Anyone got a hint? :slight_smile:

Nevermind, got it working! :laughing:

Should just have used:

Get-DhcpServerv4Scope | Select Name, Description, @{Name = ‘ScopeId’; Expression = {$_.ScopeId.IPAddressToString} } | Out-UdGridData