Jump to content

joshiieeii

Active Members
  • Posts

    137
  • Joined

  • Last visited

Everything posted by joshiieeii

  1. Hmm.... I am getting a "The requested action with this object has failed" in regards to the line: .Open ("file://./BackOfficeStorage/"& $domain &"/MBX/" & $username,"",3);Opens the user's file **Edit: could be the path on my end and nothing wrong with the script, I am looking into it.
  2. Guy been working on a script to change the Outlook Web Access (OWA) 2003 signature (had this posted there, but I think the Topic Title was throwing people off). I found this VB script that allows the changing of the ADO ( ActiveX Data Objects ) for OWA. This is the code I am trying to convert: rem Update Exchange OWA Dim oRec Set oRec=CreateObject("ADODB.Record") With oRec .Open "file://./backofficestorage/iff.uni-stuttgart.de/MBX/"+username,,3 .Fields("http://schemas.microsoft.com/exchange/previewmarkasread")=2 .Fields("http://schemas.microsoft.com/exchange/autoaddsignature")=True .Fields("http://schemas.microsoft.com/exchange/quicklinks")=1 .Fields("http://schemas.microsoft.com/exchange/signaturetext")=signature_tex t .Fields("http://schemas.microsoft.com/exchange/signaturehtml")=signature_htm l .Fields.Update .Close End With Set oRec = Nothing End If This is what I have thus far for autoit: Dim $domain = @LogonDomain ;pulls domain that user is logged into Dim $username = @UserName ;pulls username that is logged in Dim $signature_path = ( @AppDataDir &'\microsoft\signatures') ;path to Outlook signature default location Dim $signature_html = "test.htm" ;name of the global htm signature file Dim $signature_text = "test.txt" ;name of the global txt signature file ; Update Exchange OWA Dim $oRec $oRec =ObjCreate("ADODB.Record") $oRec.Open("file://./BackOfficeStorage/"& $domain &"/MBX/"& $username &",,3") ;Opens the user's file ;Dim $test = $oRec.Fields("http://schemas.microsoft.com/exchange/previewmarkasread") ;MsgBox (0,"Test", "Preview Mark As Read = "& $test) $oRec.Fields("http://schemas.microsoft.com/exchange/previewmarkasread")=2 ;Changes the preview mark as read 0: Mark item displayes in reading pane as read 1: Mark item as read when seletion changes 2: Do not automatically mark items as read $oRec.Fields("http://schemas.microsoft.com/exchange/autoaddsignature")=1 ;Changes Options> Automatically include my signature on outgoing messages True/False $oRec.Fields("http://schemas.microsoft.com/exchange/signaturetext")= $signature_text ;Sets the text signature to the Global signature $oRec.Fields("http://schemas.microsoft.com/exchange/signaturehtml")= $signature_html ;Sets the html signature to the Global signature $oRec.Fields.Update () ;Updates the fields?? $oRec.Close () ;Closes the user's file $oRec = Nothing ;what does this do??? Can anyone help me to convert this? I found the script HERE *Edit: I wanted to mention that I have been searching everywhere, found the VBscript to Autoit converter, but it is not quite right.
  3. AutoIT is a valuable tool, trust me when I say that its a unreplacable tool when working with windows. It is going to be worth the time to learn it as you can use it in sooo many places and do soo many things with it. Read the help file and take a tour with Valuater's 1-2-3
  4. ***wow, a lot of posts by me...hehe see first post
  5. That would be interesting....I took a look at your work, it's really nice! I will have to see about possible integration.
  6. Yes, i realize that there are some 3rd party apps out there that can do similar stuff, but most have limitations and are not customizable at all. Plus where would the fun be... I wanted to create this 1) so its customizable 2) to learn more about Autoit 3) to meet some needs that the other did not have. Either way, it is going to be a good project...
  7. Update: 7-19-2006 Check out post in signature, I have successfully created a script that modifies the OWA signatures along with Outlook.
  8. DISCLAIMER: As always be careful when messing with scripts that can manipulate AD data This little tool with basically display what you get when you go to "Active Directory Users and Computers" in Adminpack and look at a user's profile. It enables you to unlock the account (UNTESTED) and view information about a user. *Updated 7-19-2006 #include <GUIConstants.au3> #include <Misc.au3> Const $ADS_NAME_INITTYPE_GC = 3 Const $ADS_NAME_TYPE_NT4 = 3 Const $ADS_NAME_TYPE_1779 = 1 DIM $unlock DIM $mgrvalue DIM $mgrsplit DIM $manager DIM $mgr DIM $title DIM $pwdexpires $oMyError = ObjEvent("AutoIt.Error", "ComError") $objRootDSE = ObjGet("LDAP://RootDSE") $username = InputBox("Username","Please input a username:") If @error Then MsgBox(0, 'username', 'Username does not exist or not able to communicate with ' & @LogonDomain) Else ; DNS domain name. $objTrans = ObjCreate("NameTranslate") $objTrans.Init ($ADS_NAME_INITTYPE_GC, "") $objTrans.Set ($ADS_NAME_TYPE_1779, @LogonDomain) $objTrans.Set ($ADS_NAME_TYPE_NT4, @LogonDomain & "\" & $username) $strUserDN = $objTrans.Get ($ADS_NAME_TYPE_1779) $UserObj = ObjGet("LDAP://" & $strUserDN) If @error Then MsgBox(0, 'username', 'Username does not exist or not able to communicate with ' & @LogonDomain) Else ;MsgBox(0, 'test', 'test: ' & $test) Call ("Displayinfo") EndIf EndIf $UserObj = "" $oMyError = ObjEvent("AutoIt.Error", "") ;COM Error function Func ComError() If IsObj($oMyError) Then $HexNumber = Hex($oMyError.number, 8) SetError($HexNumber) Else SetError(1) EndIf Return 0 EndFunc ;==>ComError Func Displayinfo() GUICreate ( "Active Directory Information", 500, 600, 300, 300) GUICtrlCreateLabel ("Username: ", 10, 10, 60, 20) GUICtrlCreateLabel ("First Name: ", 10, 30, 60, 20) GUICtrlCreateLabel ("Last Name: ", 200, 30, 60, 20) GUICtrlCreateLabel ("Display Name: ", 10, 50, 100, 20) GUICtrlCreateLabel ("Title: ", 10, 70, 100, 20) GUICtrlCreateLabel ("Manager: ", 10, 90, 100, 20) GUICtrlCreateLabel ("Description: ", 10, 150, 100, 20) GUICtrlCreateLabel ("Office: ", 10, 190, 60, 20) GUICtrlCreateLabel ("Department: ", 10, 250, 100, 20) GUICtrlCreateLabel ("Telephone Number: ", 10, 290, 90, 40) GUICtrlCreateLabel ("Mobile Number: ", 10, 320, 100, 20) GUICtrlCreateLabel ("Home Number: ", 10, 350, 100, 20) GUICtrlCreateLabel ("Email Address: ", 10, 370, 100, 20) GUICtrlCreateLabel ("Logon Script: ", 10, 410, 100, 20) GUICtrlCreateLabel ("Account:", 10, 430, 100, 20) GUICtrlCreateLabel ("Number of bad logon attempts since last reset: ", 310, 420, 120, 40) GUICtrlCreateLabel ("Password Last Changed: ", 10, 460, 100, 40) GUICtrlCreateLabel ("90 Day Password Expiration: ", 10, 490, 100, 40) GUICtrlCreateLabel ("Last Logon: ", 10, 540, 100, 20) $font="Tahoma" GUISetFont (9, 600, $font) ; will display underlined characters $unlock = GUICtrlCreateButton ( "UNLOCK Account", 180, 425, 120, 25) GUICtrlSetState ( $unlock, $Gui_Disable ) GUICtrlCreateLabel ( ''& $username, 100, 10, 100, 20) GUICtrlSetColor(-1,0x0000CC) ; Blue GUICtrlCreateLabel (''& $UserObj.FirstName, 100, 30, 100, 20) GUICtrlCreateLabel (''& $UserObj.LastName, 300, 30, 100, 20) GUICtrlCreateLabel (''& $UserObj.FullName, 100, 50, 300, 20) GUICtrlCreateLabel (''& $UserObj.Title, 100, 70, 100, 20) $title = GUICtrlRead ( $title ) If $title = 0 Then GUICtrlCreateLabel ('', 100, 70, 100, 20) Endif $mgr = GUICtrlCreateLabel (''& $UserObj.Manager, 100, 90, 400, 70) $mgrvalue = GUICtrlRead ( $mgr ) $mgrsplit = StringSplit ( ""& $mgrvalue, ",") $manager = StringTrimLeft ( ''& $mgrsplit[1], 3 ) GUICtrlCreateLabel (''& $manager, 100, 90, 400, 70) GUICtrlCreateLabel (''& $UserObj.Description, 100, 150, 300, 40) GUICtrlCreateLabel (''& $UserObj.physicalDeliveryOfficeName, 100, 190, 100, 50) GUICtrlCreateLabel (''& $UserObj.Department, 100, 250, 200, 20) GUICtrlCreateLabel (''& $UserObj.TelephoneNumber, 100, 300, 250, 20) GUICtrlCreateLabel (''& $UserObj.TelephoneMobile, 100, 320, 250, 20) GUICtrlCreateLabel (''& $UserObj.TelephoneHome, 120, 350, 250, 20) GUICtrlCreateLabel (''& $UserObj.EmailAddress, 100, 370, 300, 20) GUICtrlCreateLabel (''& $UserObj.LoginScript, 100, 410, 200, 15) $locked = GUICtrlCreateLabel (""& $UserObj.IsAccountLocked, 100, 430, 10, 20) If GuiCtrlread ($locked) = 0 or 39 Then GUICtrlCreateLabel ("NOT Locked", 100, 430, 80, 15) GUICtrlSetBkColor(-1, 0x00ff00);Green Else MsgBox(0, 'INFO', "User Account Lock value is: "& $locked) GUICtrlCreateLabel ("LOCKED", 10, 430, 60, 15) GUICtrlSetBkColor(-1, 0xff0000) ; Red GUICtrlSetState ( $unlock, $Gui_Enable ) EndIf $lastchange = $UserObj.PasswordLastChanged $Date = StringMid($lastchange, 5, 2) & "/" & StringMid($lastchange, 7, 2) & "/" & StringMid($lastchange, 1, 4) $Time = StringMid($lastchange, 9, 2) & ":" & StringMid($lastchange, 11, 2) & ":" & StringMid($lastchange, 13, 2) GUICtrlCreateLabel ($Date & " "& $Time, 100, 460, 150, 20) $pwdexpires = StringMid($lastchange, 5, 2) + 3 & "/" & StringMid($lastchange, 7, 2) & "/" & StringMid($lastchange, 1, 4) GUICtrlCreateLabel ( $pwdexpires & ' ' & $Time, 100, 490, 150, 20) $lastlogin = $UserObj.LastLogin $Date = StringMid($lastlogin, 5, 2) & "/" & StringMid($lastlogin, 7, 2) & "/" & StringMid($lastlogin, 1, 4) $Time = StringMid($lastlogin, 9, 2) & ":" & StringMid($lastlogin, 11, 2) & ":" & StringMid($lastlogin, 13, 2) GUICtrlCreateLabel ($Date & " "& $Time, 100, 540, 150, 20) $badlogin = GUICtrlCreateLabel (""& $UserObj.BadLoginCount, 430, 430, 20, 15) If GuiCtrlread ($badlogin) = 0 Then GUICtrlSetBkColor(-1, 0x00ff00);Green Else GUICtrlSetBkColor(-1, 0xff0000) ; Red EndIf GUISetState () While 1 $msg = GUIGetMsg() Select Case $msg = $unlock If $UserObj.IsAccountLocked Then $UserObj.IsAccountLocked = False $UserObj.SetInfo MsgBox(0, 'INFO', "User Account was Unlocked. It will take approximately 5 mins to reflect this change.") GUICtrlCreateLabel (""& $UserObj.IsAccountLocked, 100, 430, 10, 20) EndIf Case $msg = $GUI_EVENT_CLOSE Exit EndSelect WEnd EndFunc
  9. Updated the first post with the latest version and included the major changes and additions. Thanks a ton JdeB for all your help!! I have truly learned a lot just from what you have shown me.
  10. Figured it out....... $number = 20060526091415 $year = StringTrimRight(""& $number, 10) $month = StringTrimRight(""& $number, 8) $month = StringTrimleft(""& $month, 4) $day = StringTrimRight(""& $number, 6) $day = StringTrimleft(""& $day, 6) $hour = StringTrimRight(""& $number, 4) $hour = StringTrimleft(""& $hour, 8) $min = StringTrimRight(""& $number, 2) $min = StringTrimleft(""& $min, 10) $sec = StringTrimleft(""& $number, 12) *edit* Boy you are fast JdeB!! **Edit** And I like your code betta!! Thanks!!
  11. JdeB, You have any idea how you would format some of the numbers that "Password last changed" and "LastLogin" spits out.... I am getting numbers like this: 20060526091415 20060629143432 I was thinking about a Date Time split, but I am still trying to figure out how I would do that Let's see.... 2006 06 29 143432 YYYY MM DD HHMMSS So how would you translate that into a MM DD YYYY HH:MM??
  12. HAHA...I wish I could do that...If I lock my own account, I can't unlock it, I have to get someone higher than I to unlock it. So yeah.....
  13. Thank you very much JdeB!~! I am incorporating it into my script....now if I can only get someone to lock their account....hehe
  14. Yeah, I must have missed that the first time i read that
  15. This portion is wrong... While 1 Sleep(1000) ; Idle around WEnd oÝ÷ Ø×vËh$)¶¬jëh×6 While 1 $msg = GUIGetMsg() Select Case $msg = $okbutton Exit EndSelect WEnd
  16. It could be this portion Or WinExists ($Client) = 0 I usually put in some debug msgbox's to help figure out where it is failing. Try puting some message boxes before and after this portion so it will popup a box to tell you what point it is reaching.
  17. I am not sure this is the case, but "some" games do not allow some of the functions that Autoit is capable of.
  18. Since I am still learning about COM objects, is it possible to make and save changes in a similar way? For Example, if I wanted to unlock someone's account, would it be possible to (with authentication of course) do this via the same script?
×
×
  • Create New...