15 lines
274 B
PowerShell
15 lines
274 B
PowerShell
function Get-CurrentDomainName {
|
|
<#
|
|
.SYNOPSIS
|
|
Get the current domain name of the machine
|
|
#>
|
|
[CmdletBinding()]
|
|
param (
|
|
)
|
|
|
|
if (Test-IsWindowsPlatform) {
|
|
return (Get-CimInstance Win32_ComputerSystem -Property Domain).Domain
|
|
}
|
|
|
|
return $null
|
|
} |