darkleton
Active Members-
Posts
114 -
Joined
-
Last visited
darkleton's Achievements
Adventurer (3/7)
0
Reputation
-
one thing i've just found with your code (perhaps just me!) is that if you set a password, then type an incorrect password in the box and slide to unlock, it goes back to show its wrong, but if you then type the correct password in it wont work. the only way i can then get it to work is exit the app, rerun and put the correct password in first time. if you put the wrong one in first and try to unlock it seems it doesn't then check your entry the next time it tries to unlock?
-
you sir, have thought of just about everything haven't you
-
sorry, me again!!! i'm trying to get a little tool to select an OU. I want it to display the AD structure and you select an OU and it will copy to notepad (or wherever) the full ou you have selected. I have this code from an old script i found that someone had done that will display all the structure as i want, but in doing so it strips the full OU down to just the name. is there a way of having this sort of display, but when you click the > button it will display for example OU=Test,OU=BigTest,DC=Test,DC=Com rather than just "Test" #include <ad.au3> #include <GuiListBox.au3> #include <ListBoxConstants.au3> #Include <GUIConstants.au3> #Include <GuiListView.au3> #include <WindowsConstants.au3> #include <Constants.au3> #Include <GuiTreeView.au3> #include <GUIConstantsEx.au3> #include <array.au3> Dim $listmenu, $treemenu, $listselect, $ou Const $ouIdentifier = "OU=" Const $cnIdentifier = "CN=" Const $ouSeparator = "\" Global $gui = GUICreate("OU Browser",400,600) GUISetBkColor("0xA0A0A0") UpdateTree() GUISetState() $checktree = GUICtrlRead ($treemenu) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $listselect ;;;;need command here to display the full ou path to the ou selected EndSelect If IsNumber (Number (GUICtrlRead ($treemenu))) And GUICtrlRead ($treemenu) <> $checktree Then $checktree = GUICtrlRead ($treemenu) EndIf WEnd Func UpdateTree() Dim $allOUsArray _ad_open () $arAllOU = _Ad_GetAllOUs () _ad_close () _ArrayDelete ($arAllOU, 0) Global $treemenu = GUICtrlCreateTreeView (5, 5, 300, 590, BitOR($GUI_SS_DEFAULT_TREEVIEW, $WS_BORDER), $WS_EX_CLIENTEDGE) Global $listselect = GUICtrlCreateButton(">",340,50,25) Dim $reversedAllOUsArray[1] For $i = 0 To UBound ($arAllOU, 1) - 1 $reversedOU = returnReversedOU($arAllOU [$i] [0]) $arrayAddStatus = _ArrayAdd($reversedAllOUsArray, $reversedOU) Next $sortRevArrayStatus = _ArraySort($reversedAllOUsArray) Dim $treeIDArray[UBound($reversedAllOUsArray)*2] $adCurrentObjectNumber = 0 For $i = 0 To UBound ($arAllOU) - 1 $ou = returnReversedOU($arAllOU [$i] [0]) $fullOU = StringStripWS($ou, 3) $friendlyOU = returnFriendlyName($fullOU) $parentFullOU = returnParentOU($fullOU) $parentTreeID = _ArraySearch($treeIDArray, $parentFullOU) If ( $parentTreeID <> "-1" ) Then $treeID = GUICtrlCreateTreeViewItem ($friendlyOU, $parentTreeID) Else $treeID = GUICtrlCreateTreeViewItem ($friendlyOU, $treemenu) EndIf $treeIDArray[$treeID] = $fullOU $adCurrentObjectNumber = $adCurrentObjectNumber + 1 Next EndFunc Func returnReversedOU($ou) $subOUArray = StringSplit($ou, $ouSeparator) $reversedOU = "" For $i = (UBound($subOUArray) - 1 ) To 1 Step -1 If $i = (UBound($subOUArray) - 1 ) Then $reversedOU = $reversedOU & $subOUArray[$i] Else $reversedOU = $reversedOU & $ouSeparator & $subOUArray[$i] EndIf Next return $reversedOU EndFunc Func returnFriendlyName($dn) return StringMid($dn, StringInStr($dn, "=")+1, StringInStr($dn, $ouSeparator)-(StringInStr($dn, "=")+1)) EndFunc Func returnParentOU($fullOU) return StringRight($fullOU, ( StringLen($fullOU)-StringInStr($fullOU, $ouSeparator) ) ) EndFunc
-
not a problem, thanks for the update
-
hi water, me again, sorry! i've just read through some previous replies, is it still the case that the _ad_createmailbox won't work with exchange 2007/2010 even if i have the exchange management tools installed? i just wanted to double check before I spend time troubleshooting. thanks
-
Create remote share on server 2008 r2
darkleton replied to darkleton's topic in AutoIt General Help and Support
Nevermind, I actually got it to work in the end using WMI to remotely run a cmd prompt and do rmtshare.exe Could a MOD delete this if they are available, as the issue is resolved for my needs. Sorry! -
On our old server 2003 server I had the following code that would remotely share a folder and set its permissions. Now on server 2008 r2 its not working and I can't figure out why $FILE_SHARE=0 $MAXIMUM_CONNECTIONS=-1 $objWMIService = ObjGet("winmgmts:" & "{impersonationLevel=impersonate}!\\" & $datacomp & "\root\cimv2:Win32_Process") $Locator=ObjCreate("WbemScripting.SWbemLocator") $objWMIService = $Locator.ConnectServer($datacomp, "\root\CIMV2") $objNewShare = $objWMIService.Get("Win32_Share") $objNewShare.Create('"' & "F:\Home Directories\Users\" & $username & '"', $username & "$", $FILE_SHARE, $MAXIMUM_CONNECTIONS, "Share for " & $username) Is there anything I'm missing, or is there another way? I also tried using rmtshare.exe but that has to be run directly on the server, not remotely any help would be greatly appreciated
-
aha that would explain it. my apologies for not reading through the other options. Thanks so much
-
If I create a user, the cn and name attributes are automatically set to, for example, JBloggs despite me putting that they should be a full name. If $name = "Joe Bloggs" This works _AD_ModifyAttribute($username, "displayName", $name) While these two don't. Is there something I'm missing? _AD_ModifyAttribute($username, "name", $name) _AD_ModifyAttribute($username, "cn", $name)
-
thanks a lot. i never really got to grips with arrays (as i've shown hehe!)
-
hi water. so would this work if it only returns unread email count? $oOutlook = _OutlookOpen() $xx = _OutlookGetMail($oOutlook,$olFolderInbox ,False,"","","","","","",True,"",0,True) msgbox(0,'',"you have " & $xx & " unread email/s") Thanks
-
i know this is probably such a basic question, but when i do _outlookgetmail and it returns the array of how many items and how many unread items, how do i extract JUST the unread items? I want it to display a msgbox saying "you have x unread emails" but if i remember the unread email count is row 0 column 2 (i think) so how do i get it to output that? Thanks mike
-
set home directory with ad.au3
darkleton replied to darkleton's topic in AutoIt General Help and Support
no probs, had a feeling it would be. thanks for the help -
set home directory with ad.au3
darkleton replied to darkleton's topic in AutoIt General Help and Support
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 -
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!