Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. Keyster86

    Need Help and Suggestions to Clean Up Script

    Any suggestions on how to clean up/optimize the following script? '---INSTRUCTIONS:--------------------------------------------------------------------- ' ' 1. Obtain list of computers from AD (IP address will work also) ' 2. Copy list of computers into a text file named "computers.txt" ' '...
  2. Keyster86

    Return multiple values from function.

    I found a work around... FUNCTION FindInfo(strComputer) ' Continue with script if error occures. ON ERROR RESUME NEXT SET objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") IF objWMIservice IS NOTHING THEN 'WRITE_CSV_LINE strComputer & ",Error: " & err.number & "...
  3. Keyster86

    Return multiple values from function.

    OK, I have three seperate functions that I would like to combine into one. However, I need to find out the most effective way of using a Function to output three different string vaules. For example, I have a function to find a MAC address, IP address and Dell Serial Number. How can these be...
  4. Keyster86

    Bad File Mode

    I must be half asleep - I can't for the life of me figure out why the code is throwing an error. Please help. SET objFSO = CreateObject("Scripting.fileSystemObject") SET objFileTEXT = objFSO.OpenTextFile("hosts.txt",2,TRUE) DO UNTIL objFileTEXT.AtEndOfStream strComputer =...
  5. Keyster86

    How to start script over?

    Well, depending on what exactly you are trying to do...you may want to do something similar to below: strInput = Inputbox("Enter text") DO SearchFiles(strInput) LOOP FUNCTION SearchFiles(strInput) Your code here...strInput is for file to be searched. END FUNCTION Or if you are...
  6. Keyster86

    Find Section of String

    You are awesome...thanks a million. I made a slight variation to the provided script to get exact information versus having the identifying prefixes. This way - I can compare strings. strInformation = "john.key ; MAC: 00:18:8B:D6:29:B6 ; IP: 192.168.1.1 ; SN: ####### ; US ARMY ; SPC John Key"...
  7. Keyster86

    Find Section of String

    Whom it may concern: I am trying to find the formula for finding specific sections in a string. My string format: <USER> ; <MAC> ; <IP> ; <SN> ; <OFFICE> ; <ADMIN> Example: john.key ; MAC: 00:18:8B:D6:29:B6 ; IP: 192.168.1.1 ; SN: ####### ; US ARMY ; SPC John Key What would be the formula to...
  8. Keyster86

    Edit Computer Object Description in AD Part 2

    OK, this post is in connection with another post: http://www.tek-tips.com/viewthread.cfm?qid=1515298&page=1 Let's say I have three specific computer names. And on those three specific computers, I want to change the description field in Active Directory. What would be the vbscript code for...
  9. Keyster86

    Edit Computer Object Description in AD

    Whom it may concern: I am working on a script that reads a text file containing computer names on each. And for each computer in the given text file, the script will find the MAC Address, IP address, Serial Number for that computer. Now my problem is this issue. I want to then take that read...
  10. Keyster86

    Setting objIE window to max height

    Interesting question... This link may assist in what you are trying to do. http://forums.teamphoenixrising.net/showthread.php?t=34213 From above link - Posted by Damski: Dim gfx, colours, horiz, vert strComputer = "." Set objWMIService = GetObject("winmgmts:\\" & strComputer &...
  11. Keyster86

    ADO Computer Description Name from AD

    Thanks tsuji - it worked like a charm. Final product: OPTION EXPLICIT DIM objFSO, objFile, objRootDSE, objShell, objDate, objTargetOU, objComputer, objRootLDAP, objTest DIM strFilePath, strDNSDomain, strFilter, strQuery, strComputerDN, strTargetOU, strScriptName, strParentFolder...
  12. Keyster86

    ADO Computer Description Name from AD

    ALL, This portion of code is not working for me...why? adoRecordset.Fields("description").Value I am trying to extract the "Description" field of computer objects out of Active Directory (AD) utilizing ADO language. I keep getting an Line: 94 Char: 5 error: "Item cannot be found in the...
  13. Keyster86

    I need a little assistance with my Robocopy Syntax…

    Also...you may want to remove the extra "&" sign right before and after text. Call WshShell.Run("cmd.exe /c C:\robocopy.exe """ & spath & """ """ & dpath & "-.txt"" " & s0) V/r, SPC Key United States Army
  14. Keyster86

    I need a little assistance with my Robocopy Syntax…

    Also to add for future refference. As far as I know if you are feeding a variable into a command, you need to initlize the variable first prior to the command. BAD EXAMPLE: wscript.echo strText strText = "What I want to echo!" RESULT WILL BE: "" < A blank echo box. GOOD EXAMPLE: strText =...
  15. Keyster86

    I need a little assistance with my Robocopy Syntax…

    I haven't messed with Robocopy yet. However, I suggest taking your command and feeding it into a wscript.echo prior to the Call WshShell.RUN line...and just double check the syntax is the way you want it. Try: wscript.echo "cmd.exe /c C:\robocopy.exe " & spath & " " & dpath & "-" & ".txt" &...
  16. Keyster86

    Self Contained List

    Good pointa. You are both right, I could use an array to fill in the computer names (a self contained list); however, I think option two would be more efficient as it will require less typing. Thanks for the input guys...really appericate it. V/r, SPC Key United States Army
  17. Keyster86

    Getting Error 800A0046

    OK, so I tested the code on my own system. I have user level access rights (when not in admin mode) and the code worked like a charm - no error. So... I looked up the error code by going to Google and typing in the error number. The error number seems to be related to permissions. Maybe try...
  18. Keyster86

    Self Contained List

    Here would be my way of querying AD for computer names...What is your way? OPTION EXPLICIT DIM objOU, objComputer, objRootDSE, objLastLogon DIM strContainer, strDNSDomain DIM intLastLogonTime, intGuyTime strContainer = "OU=COMPUTERS," SET objRootDSE = GetObject("LDAP://RootDSE")...
  19. Keyster86

    Self Contained List

    A script that reads AD computer list directly might be another answer. V/r, SPC Key United States Army
  20. Keyster86

    Self Contained List

    So, thinking out loud here. I want to know if there is a way to contain a list within a script running. For example, I have a script that changes an admin password on all systems in my OU based on a list of computer names. The VBScript changes the password on each machine grabing the machine...

Part and Inventory Search

Back
Top