Guys - I have used the AD scrips often... and it works great! .. but I just tried it on a Windows 2016 Server and it fails with a simple Create User function?
I get a failed message with return code -2147352567
Even the Example Script (Modified slightly below) fails.
Global $sOU , $sUser
_AD_Open()
If @error Then Exit MsgBox(16, "Active Directory Example Skript", "Function _AD_Open encountered a problem. @error = " & @error & ", @extended = " & @extended)
$sOU = "OU=Users,OU=CPT,OU=Locations,OU=AMSOLONE,DC=amsolone,DC=local"
$sUser = "Test"
Global $iValue = _AD_CreateUser($sOU, $sUser, "Test User")
If $iValue = 1 Then
MsgBox(64, "Active Directory Functions - Example 1", "User '" & $sUser & "' in OU '" & $sOU & "' successfully created")
ElseIf @error = 1 Then
MsgBox(64, "Active Directory Functions - Example 1", "User '" & $sUser & "' already exists")
ElseIf @error = 2 Then
MsgBox(64, "Active Directory Functions - Example 1", "OU '" & $sOU & "' does not exist")
ElseIf @error = 3 Then
MsgBox(64, "Active Directory Functions - Example 1", "Value for CN (e.g. Lastname Firstname) is missing")
ElseIf @error = 4 Then
MsgBox(64, "Active Directory Functions - Example 1", "Value for $sAD_User is missing")
Else
MsgBox(64, "Active Directory Functions - Example 1", "Return code '" & @error & "' from Active Directory")
EndIf
_AD_Close()