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 dencom 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

    ...' ' 1. Add column names for CPU Supports and Current OS ' (Add info to easier identifiablity) ' COMPLETED: 14 July 2015 ' **2. Find user last logged on ' (identify main users of said system) ' **3. Find lastLogon in AD for computers not online ' (to see how stale) ' **4. If possible...
  2. Keyster86

    Return multiple values from function.

    ...---------------------------------------- ' Find MAC ' ---------------------------------------- SET colItems = objWMIService.ExecQuery("Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True") ' Search for MAC address. Once MAC is found, it is stored into the...
  3. Keyster86

    Return multiple values from function.

    ...to WMI on " & strComputer & " - DESCRIPTION NOT CHANGED - FINDMAC" EXIT FUNCTION ELSE SET colItems = objWMIService.ExecQuery _ ("Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True") ' Search for MAC address. Once MAC is found, it is stored into the "Function" as...
  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

    ...= TRUE END IF SET objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") SET colItems = objWMIService.ExecQuery _ ("Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True") ' Search for MAC address. Once MAC is found, it is stored into the "Function" as...
  10. Keyster86

    Setting objIE window to max height

    ...strComputer = "." Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Set colItems = objWMIService.ExecQuery _ ("Select * From Win32_DisplayConfiguration") For Each objItem in colItems gfx = "Name: " & objItem.DeviceName colours = "Color depth: " & objItem.BitsPerPel...
  11. Keyster86

    ADO Computer Description Name from AD

    ...(UCase(TypeName(lngBiasKey)) = "VARIANT()") THEN lngBias = 0 For k = 0 To UBound(lngBiasKey) lngBias = lngBias + (lngBiasKey(k) * 256^k) Next END IF ' Use ADO to search the domain for all computers. SET adoConnection = CreateObject("ADODB.Connection") SET adoCommand =...
  12. Keyster86

    ADO Computer Description Name from AD

    ...(UCase(TypeName(lngBiasKey)) = "VARIANT()") THEN lngBias = 0 For k = 0 To UBound(lngBiasKey) lngBias = lngBias + (lngBiasKey(k) * 256^k) Next END IF ' Use ADO to search the domain for all computers. SET adoConnection = CreateObject("ADODB.Connection") SET adoCommand =...
  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…

    .../NP /M /LOG+:Backup.txt" ' backup switches for Robocopy, including the /m switch to only copy new/modified files 'Asks to start the backup ****************************************************************************** X=MsgBox(" Good Afternoon todays date is " & Date & " **** Are you...
  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