Use NETBIOS name for non-domain hosts instead of hostname

Fixes #49
This commit is contained in:
Christian Stein 2020-03-10 17:01:43 +01:00
parent 825ee4c666
commit a45d0e2fbb
2 changed files with 7 additions and 1 deletions

View file

@ -0,0 +1,6 @@
function Get-IcingaNetbiosName()
{
$ComputerData = Get-WmiObject Win32_ComputerSystem;
return $ComputerData.Name;
}

View file

@ -12,7 +12,7 @@ function Get-IcingaUserSID()
$Domain = $TmpArray[0]; $Domain = $TmpArray[0];
$Username = $TmpArray[1]; $Username = $TmpArray[1];
} else { } else {
$Domain = Get-IcingaHostname; $Domain = Get-IcingaNetbiosName;
$Username = $User; $Username = $User;
} }