Powershell DHCP

From Help
Jump to: navigation, search

Format: Brief Scope

Return to Main Page

Get-DhcpServerDatabase

  • Windows Server 2012 R2 and Windows 8.1
  • Get-DhcpServerDatabase [-AsJob] [-CimSession <CimSession[]> ] [-ComputerName <String> ] [-ThrottleLimit <Int32> ] [ <CommonParameters>]
    • -ComputerName<String>: Specifies the DNS name, or IPv4 or IPv6 address, of the target computer running the DHCP server service.
  • Get-DhcpServerDatabase -ComputerName realm.tpfnd.cat
  • returns:
FileName           : C:\Windows\system32\dhcp\dhcp.mdb
BackupPath         : C:\Windows\system32\dhcp\backup
BackupInterval(m)  : 60
CleanupInterval(m) : 60
LoggingEnabled     : True
RestoreFromBackup  : False

Return to Top

Get-DhcpServerv4Superscope

  • Windows Server 2012 R2 and Windows 8.1
  • Get-DhcpServerv4Superscope [[-SuperscopeName] <String[]> ] [-AsJob] [-CimSession <CimSession[]> ] [-ComputerName <String> ] [-ThrottleLimit <Int32> ] [ <CommonParameters>]
  • Get-DhcpServerv4Superscope -ComputerName realm.tpfnd.cat
  • returns:
SuperscopeName :
ScopeId        : {10.0.0.0, 10.1.0.0, 10.10.0.0, 172.16.10.0}

Return to Top

Get-DhcpServerv4Scope

  • Windows Server 2012 R2 and Windows 8.1
  • Get-DhcpServerv4Scope [[-ScopeId] <IPAddress[]> ] [-AsJob] [-CimSession <CimSession[]> ] [-ComputerName <String> ] [-ThrottleLimit <Int32> ] [ <CommonParameters>]
    • -ScopeId<IPAddress[]>: Specifies one or more scope identifiers (IDs), in IPv4 address format, from which the configuration is to be retrieved.
  • Get-DhcpServerv4Scope -ComputerName realm.tpfnd.cat
  • returns:
ScopeId         SubnetMask      Name           State    StartRange      EndRange        LeaseDuration
-------         ----------      ----           -----    ----------      --------        -------------
10.0.0.0        255.255.255.0   2              Active   10.0.0.1        10.0.0.254      8.00:00:00
10.1.0.0        255.255.255.0   Clients        Active   10.1.0.50       10.1.0.254      5.00:00:00
10.10.0.0       255.255.255.0   VOIP           Active   10.10.0.20      10.10.0.254     8.00:00:00
172.16.10.0     255.255.255.0   WiFi           Active   172.16.10.50    172.16.10.254   8.00:00:00

Return to Top

Get-DhcpServerv4OptionValue

  • -All: Gets the option values for a scope, server, or reservation. Option values can include vendor class, user class, and policy specific.
  • -OptionId<UInt32[]>: Specifies the numerical IDs of the options being requested.
  • -ScopeId<IPAddress>: Specifies the ID of the scope, in IP address format, for which one or more option values are requested.
  • Get-DhcpServerv4OptionValue -ComputerName realm.tpfnd.cat -ScopeId 10.0.0.0 -All | select Name, optionid, type, value| Format-Table -Property * -AutoSize | Out-String -Width 4096
  • returns:
Name                  optionid type        value
----                  -------- ----        -----
Lease                       51 DWord       {691200}
Router                       3 IPv4Address {10.0.0.1}
DNS Domain Name             15 String      {tpfnd.cat}
DNS Servers                  6 IPv4Address {10.0.0.59, 8.8.8.8, 172.13.47.109}
Boot Server Host Name       66 String      {10.0.0.59}
Cisco IPT                  150 IPv4Address {10.0.0.59}

Return to Top


Get-Alias

  • Windows Server 2012 R2 and Windows 8.1
  • Get-Aliasn -ComputerName realm.tpfnd.cat
  • returns:

Return to Top

References

Return to Top