Search the Community
Showing results for tags 'AD UDF'.
Found 3 results
I was stuck on changing some areas on my username for some reason please check the script below : #include <AD.au3> #RequireAdmin _AD_Open() ; this portion works just fine _AD_ModifyAttribute("User.a", "GivenName", "John") _AD_ModifyAttribute("User.a", "displayName", "John, Smith") ; this portion I can't get it to work _AD_ModifyAttribute("User.a", "Surname", "Smith") _AD_ModifyAttribute("User.a", "City", "Orlando") _AD_ModifyAttribute("User.a", "State", "FL") _AD_ModifyAttribute("User.a", "country", "US") _AD_Close() Basically the top portion for the Givenname and display name works perfectly but the other portion I am unable to get it to work.
I have a question about the @error logging features in _AD_CreateUser. Hopefully I am just missing something obvious. In my app I am creating a user if it does not exist then manipulating some attributes. If the user does exist I would then call another function to remove groups from the user and modify some attributes. My question is... If the user already Exists, the _AD_CreateUser option gives $iValue = 0 and @error = 0. How can @error = 1 for the condition that the user already exists? I copied a small ship of the code in question along with my full .au3. I am using AD UDF 126.96.36.199 (Water, thanks for the awesome work on this!!!). $iValue = _AD_CreateUser ($sOU, $sUser, $sCN) If $iValue = 1 Then _FileWriteLog ($Log, "Func UserCheck() - User '" & $sUser & "' successfully created ==> Calling UserAttribsNewUser Function.") Call ("NewUser") ElseIf @error = 1 Then _FileWriteLog ($Log, $sUser & " already exists ==> Calling UserAttribsExistingUser Function.") Call ("ExistingUser") AccountSettingConfigurations-Test1.au3
When working on the new function _AD_GetObjectOU (returns the OU of a user, group, computer etc.) I noticed the big performance advantage you get when using ADsPath. (example: processing 120 users to retrieve the OU takes 207ms compared to 1041ms - so it is about 5 times faster). At the moment functions either accept SamAccountName or FQDN as parameters to identify an AD object. Where would you benefit? It takes a lot fo time when you use _AD_GetObjectsInOU to retrieve objects fitting the search pattern and then need to loop through the resulting array calling _AD_GetobjectProperties for each object to retrieve additional properties. By using ADsPath this should run much faster. But it needs me to modify a lot of functions in the AD UDF to accept ADsPath as a parameter you to change your script What do you think? Is it worth the effort.