Sign in to follow this  
Followers 0
darkleton

set home directory with ad.au3

7 posts in this topic

#1 ·  Posted (edited)

I know I can use ad.au3 (active directory script) to create users etc, but is it possible to use it to set individual properties of the user?

things such as homedrive/scriptpath/givenname/description etc? I used to do it using a long winded approach and objuser.put commands, but if i could use this au3 in a similar such way, it would be a lot easier.

thanks

mike

**edit** im guessing that would be _AD_modifyattribute....my bad! please feel free to delete this, my apologies!

Edited by darkleton

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Please have a look at _AD_ModifyAttribute

Edit: Too late :x

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Please have a look at _AD_ModifyAttribute

Edit: Too late :x

hey water, is there a way within any ad functions to create the users home directory too? so in attributes i tell it the home dir is \\server\user$ but can i then create that folder on the server and share it or would that have to be with another script?

thanks

Share this post


Link to post
Share on other sites

The creation of a directory on a server and the setting of access rights is not within the scope of the Active Directory UDF.

You will have to do that in a separate script.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

no probs, had a feeling it would be.

thanks for the help :x

Share this post


Link to post
Share on other sites

I will have to solve the same problem in the near future.

Would you mind sharing your code?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Here's an alternative that sets the home directory of the logged in user...if they have permission to do so. (just the homedirectory part)

$oMyError = ObjEvent("AutoIt.Error","MyErrFunc")
$adSys = ObjCreate("ADSystemInfo")
ConsoleWrite($adSys.UserName & @CRLF)
$objOU = ObjGet("LDAP://" & $adSys.UserName)

$objOU.Put("homeDirectory","\\server\share\")
$objOU.Put("homeDrive", "Z:")

$objOU.SetInfo

Func MyErrFunc()

  Msgbox(0,"AutoItCOM Test","We intercepted a COM Error !"      & @CRLF  & @CRLF & _
             "err.description is: "    & @TAB & $oMyError.description    & @CRLF & _
             "err.windescription:"     & @TAB & $oMyError.windescription & @CRLF & _
             "err.number is: "         & @TAB & hex($oMyError.number,8)  & @CRLF & _
             "err.lastdllerror is: "   & @TAB & $oMyError.lastdllerror   & @CRLF & _
             "err.scriptline is: "     & @TAB & $oMyError.scriptline     & @CRLF & _
             "err.source is: "         & @TAB & $oMyError.source         & @CRLF & _
             "err.helpfile is: "       & @TAB & $oMyError.helpfile       & @CRLF & _
             "err.helpcontext is: "    & @TAB & $oMyError.helpcontext _
            )

    Local $err = $oMyError.number
    If $err = 0 Then $err = -1

    $g_eventerror = $err  ; to check for after this function returns
Endfunc
Edited by spudw2k

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0