Hello together, my appended Function returns the correct DomainJoinStatus, but the name is just a number ... why? Does someone has an idea why? Thanks in advance Jochen ;################################################################################################### # ; Sources for NetGetJoinInformation ; http://msdn2.microsoft.com/en-us/library/aa370423.aspx ; http://vbnet.mvps.org/index.html?code/netw...information.htm ;################################################################################################### # $ComputerJoinedDomain = "" $ComputerDomainJoinStatus = "0" :---Call Function with Variables--- NetGetJoinInfo(@Computername,$ComputerJoinedDomain,$ComputerDomainJoinStatus) If StringLeft($ComputerJoinedDomain,5) <> "Error" Then MsgBox(0,"Domain","ComputerDomain: " & $ComputerJoinedDomain) MsgBox(0,"Status","JoinedDomainStatus: " & $ComputerDomainJoinStatus) Else MsgBox(0,"Error",$ComputerJoinedDomain) EndIf Exit ;################################################################################################### # Func NetGetJoinInfo($wkst, ByRef $JoinedDomain, ByRef $DomainJoinStatus) Local $err, $domStruct, $bufferType, $typStruct If StringLen($wkst) = 0 Then $wkst = @Computername If StringLeft($wkst,2) <> "\\" Then $wkst = "\\" & $wkst Local $domStruct = DllStructCreate("ptr"), $typStruct = DllStructCreate("int") DllCall("NetApi32.dll", "int" ,"NetGetJoinInformation", _ "int_ptr" ,$wkst , _ "ptr" ,DllStructGetPtr($domStruct) , _ "ptr" ,DllStructGetPtr($typStruct)) If @error <> "0" Then $JoinedDomain="Error:" & @error Else $JoinedDomain=DllStructGetData ($domStruct,1) $DomainJoinStatus=DllStructGetData ($typStruct,1) EndIf DllCall ("netapi32.dll", "int" ,"NetApiBufferFree", "ptr" , DllStructGetData ($domStruct,1) ) EndFunc ;################################################################################################### #