Get-DhcpServerv4Lease cmdlet returns error

Welcome Forums General PowerShell Q&A Get-DhcpServerv4Lease cmdlet returns error

This topic contains 1 reply, has 2 voices, and was last updated by

4 years, 11 months ago.

  • Author
  • #14291

    Points: 0
    Rank: Member

    My Windows 2012R2 Server running powershell is a memberserver, the DHCP Server is a Windows 2003 Server

    I tried running below command
    Get-DhcpServerv4Lease -Computername DHCPSERVERNAME Scope

    I get below error
    Failed to get leases from scope from DHCP Server
    Fully Qualified Error ID: Win32 1745,Get-DhcpServerv4Lease

    Is this because this cmdlet is not fully compatible with Windows 2003 Server. If yes, is there a workaround?

  • #14308

    Points: 0
    Rank: Member

    That's one of the CIM cmdlets that were added in Windows Server 2012; they can't be used to manage downlevel DHCP servers, because the necessary WMI namespaces / classes don't exist on older operating systems.

    For older computers, netsh.exe offers quite a bit of functionality (though it'll be giving you text instead of objects.) For example:

    netsh dhcp server \\DHCPSERVERNAME v4 scope show clients

    I haven't tried it, but a web search turned up a PowerShell module that is a wrapper around netsh, which might help you with parsing the text and working with objects:

The topic ‘Get-DhcpServerv4Lease cmdlet returns error’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort