If _CMD(@LogonServer & '\netlogon\ifmember Domain Admins') Then mapdrive("s:", $source & "\source")EndIf
The code that has been suppled as an example seems not to work..
#include <AD.au3> Global $aUser, $sFQDN_Group ; Open Connection to the Active Directory _AD_Open() ; Get the Fully Qualified Domain Name (FQDN) for the current user $sFQDN_User = _AD_SamAccountNameToFQDN() ; Get an array of group names (FQDN) that the current user is immediately a member of _AD_GetUserGroups($aUser, @UserName) $sFQDN_Group = $aUser[1] ; Check the group membership of the specified user for the specified group $iResult = _AD_IsMemberOf($sFQDN_Group, $sFQDN_User) Select Case $iResult = 1 MsgBox(64, "Active Directory Functions", _ "User: " & $sFQDN_User & @CRLF & _ "Group: " & $sFQDN_Group & @CRLF & _ "User is a member of the specified group!") Case ($iResult = 0 And @error = 1) MsgBox(64, "Active Directory Functions", _ "User: " & $sFQDN_User & @CRLF & _ "Group: " & $sFQDN_Group & @CRLF & _ "Group does not exist!") Case ($iResult = 0 And @error = 2) MsgBox(64, "Active Directory Functions", _ "User: " & $sFQDN_User & @CRLF & _ "Group: " & $sFQDN_Group & @CRLF & _ "User does not exist!") Case ($iResult = 0) MsgBox(64, "Active Directory Functions", _ "User: " & $sFQDN_User & @CRLF & _ "Group: " & $sFQDN_Group & @CRLF & _ "User is a not member of the specified group!") EndSelect ; Close Connection to the Active Directory _AD_Close()
Error I get is;
D:\addons\autoit\Logon Script\ad_test.au3 (13) : ==> Subscript used with non-Array variable.:
$sFQDN_Group = $aUser[1]
$sFQDN_Group = $aUser^ ERROR
unfortunately I am not too clear on the logic of this example.
Is it possible to show an example of how this code would be implemented for my case or show me where the above code went wrong.
Edited by PeterAtkin, 09 February 2010 - 05:30 PM.





