Jump to content

BigNoter

Members
  • Posts

    18
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

BigNoter's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. One more question, does it modify the users in sub OUs as well? TIA
  2. It worked... Without any change. Thnx
  3. So why I'm getting this error? TIA
  4. I checked the path and it was OK! Global $sOU = "LDAP://OU=OUName2,OU=OUName1,OU=OUName0,DC=1,DC=2,DC=3" ; OU to process Is this the write way of FQDN? TIA
  5. I got this error, which I don't know what does it mean! Function _AD_GetObjectsInOU encountered a problem. @error = 1, @extended = 0 TIA
  6. Thnx for the quick reply. This pseudo code helps, but a little. last time I did code was, as I remember, 2007...! If you, or anybody, provide a piece of code will help a lot. TIA
  7. Hi, I need to remove all groups from "Member Of" tab, and add two groups to it, for a list of users in an OU. How can I do that...? Anyone got this piece of code or similar, will be appreciated. TIA
  8. Thanx for the quick reply. The 4 commands line with its sequence, will do the job exactly the way I wonted (in DOS prompt) with no error or conflict in ownership! ACL = Access Control List ICAcLa = Inegrated Control Access List I did not yet started with the script! May be someone has it laying somewhere in his archive. I think I have to get rid of my old dusty AutoIt information and start the coding..!
  9. Hi all, I'm trying to do the following steps: 1. Ask the user to select a File from a dialog window "Open" (save its original owner and permissions) and also a UserName from the dialog window "Select User or Group" and grant the ownership and full access of the File to the UserName. 2. Wait for the user to finish accessing the File. 3. Automatically return the original owner and permissions (the one that saved in step 1) back to the File. Using the following commands: TakeOwn /F "full path of the File" ICAcLs "full path of the File" /Grant "UserName":F ICAcLs "full path of the File" /SetOwner "original user" ICAcLs "full path of the File" /Grant:R "original user":RX Any help will be appreciated. TIA
  10. Thanx a lot muttley Two more Qs: Why it quits with the Esc key (strange behavior), without declaring "GUICloseOnESC"? Can U explain whats all about the "LoWord" & "HiWord" thing? TIA
  11. you have to hit "Esc" for the process to stop!!! and afterwards the fun "Install" never get called it got to be the interrupt call! (little bit confusing) I removed the msgbox & add statusbar #Include <GuiButton.au3> #include <GuiStatusBar.au3> #include <GuiIPAddress.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt ("GUIOnEventMode", 1) Opt ("MustDeclareVars", 1) Global $aParts [2] = [500, -1] Global $hGUIWin, $hStartIPAddress, $hEndIPAddress, $Start, $Stop, $Exit, $Interrupt = False, $hStatusBar Global $aStartIP [4] = [10, 10, 64, 0], $aEndIP [4] = [10, 10, 95, 255] $hGUIWin = GUICreate ("Workstation Installation Tool", 550, 125, -1, -1) GUISetOnEvent ($GUI_EVENT_CLOSE, "Close", $hGUIWin) GUICtrlCreateGroup ("Start IP:", 80, 5, 145, 50) $hStartIPAddress = _GUICtrlIpAddress_Create ($hGUIWin, 100, 26, 100, 18) _GUICtrlIpAddress_SetArray ($hStartIPAddress, $aStartIP) _GUICtrlIpAddress_SetFocus ($hStartIPAddress, 2) _GUICtrlIpAddress_SetRange ($hStartIPAddress, 2, 64, 200) _GUICtrlIpAddress_SetRange ($hStartIPAddress, 3, 6, 254) GUICtrlCreateGroup ("End IP:", 250, 5) $hEndIPAddress = _GUICtrlIpAddress_Create ($hGUIWin, 270, 26, 100, 18) _GUICtrlIpAddress_SetArray ($hEndIPAddress, $aEndIP) _GUICtrlIpAddress_SetRange ($hEndIPAddress, 2, 64, 200) _GUICtrlIpAddress_SetRange ($hEndIPAddress, 3, 6, 254) $Start = GUICtrlCreateButton ("&Start", 430, 20, 110, 25, $BS_DEFPUSHBUTTON) GUICtrlSetOnEvent ($Start, "Start") $Exit = GUICtrlCreateButton ("&Exit", 430, 60, 110, 25) GUICtrlSetOnEvent ($Exit, "Close") $hStatusBar = _GUICtrlStatusBar_Create ($hGUIWin, $aParts) _GUICtrlStatusBar_SetMinHeight ($hStatusBar, 22) GUIRegisterMsg ($WM_COMMAND, "WM_COMMAND") GUISetState (@SW_SHOW, $hGUIWin) While 1 Sleep (100) WEnd ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Func SetInterrupt () ;changes the value of your flag $Interrupt = True EndFunc;==>SetInterrupt ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Func Close () ;new function to handle the Exit event Exit EndFunc;==>Close ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Func Start () ;new function to handle the pressing of $start button Switch @GUI_CtrlId Case $Start If GUICtrlRead ($Start) = "Stop" Then ;if the text is "Stop" and the button was pressed SetInterrupt () ;set the flag GUICtrlSetData ($Start, "Start") ;change the button text Else If CheckIP () Then GUICtrlSetData ($Start, "Stop") ;set the text to "Stop" Install () ;do your work EndIf EndIf EndSwitch EndFunc;==>Start ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Func CheckIP () $aStartIP = _GUICtrlIpAddress_GetArray ($hStartIPAddress) $aEndIP = _GUICtrlIpAddress_GetArray ($hEndIPAddress) If $aStartIP [2] > $aEndIP [2] Then Return False ElseIf $aStartIP [2] = $aEndIP [2] Then If $aStartIP [3] > $aEndIP [3] Then Return False Else Return True EndIf Else Return True EndIf EndFunc;==>CheckIP ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Func Install () Local $PCName Dim $WorkIP = $aStartIP Do Do If $Interrupt Then $Interrupt = False Return EndIf If $WorkIP [2] = $aEndIP [2] And $WorkIP [3] > $aEndIP [3] Then ExitLoop EndIf Local $PCIP = $WorkIP [0] & "." & $WorkIP [1] & "." & $WorkIP [2] & "." & $WorkIP [3] _GUICtrlStatusBar_SetText ($hStatusBar, " Pinging IP: " & $PCIP) If Ping ($PCIP, 250) Then $PCName = RegRead ("\\" & $PCIP & "\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters", "Hostname") EndIf $WorkIP [3] += 1 Until $WorkIP [3] > 254 $WorkIP [3] = 6 $WorkIP [2] += 1 Until $WorkIP [2] > $aEndIP [2] EndFunc;==>Install ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Func WM_COMMAND ($hWnd, $Msg, $wParam, $lParam) #forceref $hWnd, $Msg Local $nNotifyCode = BitShift ($wParam, 16) Local $hCtrl = $lParam Switch $hCtrl Case $Stop Switch $nNotifyCode Case $BN_CLICKED $Interrupt = True EndSwitch Return 0 EndSwitch Return $GUI_RUNDEFMSG EndFunc;==>WM_COMMAND
  12. I'll try that. Just in case, Thanx a lot muttley
  13. That's a good solution. But, I like to quit the loop by pushing the button "$Stop". Is there anyway to do that?
×
×
  • Create New...