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 Rhinorhino 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: *

  • Users: sn0rg
  • Content: Threads
  • Order by date
  1. sn0rg

    Chart - DataSeries Order

    Hi All I'm a bit of a novice with PS, and have been trying to create a graphic, following the tutorial here. There a section where he enters x & y values using an array: # add data to chart $Cities = @{London=7556900; Berlin=3429900; Madrid=3213271; Rome=2726539; Paris=2188500}...
  2. sn0rg

    Determine file type

    Hi guys I am opening text files in vbscript, and need to discover if I should use TriStateTrue or TriStateFalse. e.g. Set objInputFile = objFSO.OpenTextFile(strFilePath, ForReading, False, TristateTrue) is there a way to interrogate the file before I open it? If I open in the wrong format...
  3. sn0rg

    Create user in another AD

    Hi all, I've got to create a user account (with vbscript) in a different Forest. I know the account I'm using has the relevant permission in that Forest, but am struggling to create the object. On the objUser.setinfo line, I get the error: -2147016651 The server is unwilling to process the...
  4. sn0rg

    Text file strangeness

    Hi Guys i've created a CSV file with a vbscript and the filesystemobject. Now I want to read the content of that file into an array. Trouble is, when I attempt to read the file using objFile.readline, it's garbage. Always starts with "ÿþF", and nothing else will echo out. I can manually...
  5. sn0rg

    Query another AD forest

    Hi Guys My Company has joined with another, and we have both got a Win 2003 AD. I want to run a query against their AD via ADO as follows: set ons=getobject("LDAP:") set ocontainer=ons.OpenDSObject( _ "LDAP://Company2DC.company2.com/cn=users,dc=company2,dc=com", _ szUsername, _...
  6. sn0rg

    Redim preserve multi dimensional array

    Hi all I'm trying to build a 2 dimensional array from values in a spreadsheet. I am used to using the redmin preserve array(x) command to add values, but when I try this for a multi-dimentsional array I get an "out of range" error. Can anyone help? n = 0 intColumn = 1 dim m Dim...
  7. sn0rg

    Declare multiple variables

    I need to have a load of similar string variables in my script, with the same name, but incremented with a number. Normally I would do something like: dim item1, item2, item3, item4, item5, item6 I was hoping that there may be an easier way to refer to these, but am a bit rusty on vbscript...
  8. sn0rg

    Display domain\user from SID (Exchange 55)

    I'm trying to audit our Exchange 55 environment as part of a migration (finally) to E2k3. One of the jobs I'm doing means I want to know what accounts are permissioned against mailboxes, so I'm using an LDAP query that returns the SID of Assoc-NT-Account. I've got ADsSecurity.dll installed...
  9. sn0rg

    Call a vbscript from inside HTML

    I'm presenting the output of my VBScript in an HTML page. What I'd like to do is place a button at the bottom of this page which executes the same script again. I'm trying the form button (see bottom of the script below) but not having any luck - nothing happens) Can anyone help? Const...
  10. sn0rg

    Create an OU under the System OU (Active Directory)

    I'm attempting to script the creation of an OU required for SMS. The OU must be created underneath the Top Level OU of System, but when I run the code, I receive the error "object not founf on the server" where the script attempts to bind to that OU. The error doesn't occur when pointed at...
  11. sn0rg

    Natural progression

    I've been doing bits of VBscript on and off for a few years now, and I'd like to be able to consolidate some of the work I do into small applications. What would be the best place for me to start? I assume VB is a fairly obvious place to migrate my skillset to, but tools like Visual Studio...
  12. sn0rg

    Save HTML progress Log?

    I'm using the code: Set objExplorer = CreateObject("InternetExplorer.Application") to create an IE window, and write the progress of scripts into it. How can I save this file as an HTML page after the script completes? Thanks
  13. sn0rg

    When is > not >

    I'm using a peice of code: if intDNSServer > ubound(arrDNSSServers) then When I echo out the values, they are both 0 (zero). Fine. However, when I run this code, the "if" condition is found to be true when it clearly isn't. If I change the "ubound(arrDNSServers)" code for "0" (zero), the...
  14. sn0rg

    Parse MultiDimensional Array?

    Having just about grasped MD arrays I now have the following problem. Previously, I would build an array (eg arrCars), and then pass through it with a "for each, next" loop. eg: Dim arrCars(1) arrCars(0) = "Ford" arrCars(1) = "Vauxhall" For each objcar in arrCars wscript.echo objCar Next...
  15. sn0rg

    IE Progress Window

    I'm using the following code: Set objExplorer =CreateObject("InternetExplorer.Application") updating it via: objExplorer.Document.Body.InnerHTML = strInner Once the viewable window has filled up, it isn't possible to view new window content without constantly scrolling down. Is there a way...
  16. sn0rg

    Dreaded MultiDimensional Array

    Having real problems creating and populating one. I want to read in the content of a spreadsheet into an array. I count each row incrementing a variable (intRow) until I reach the end of the sheet. I know there will be 4 columns. Problem is, that I cannot then use the intRow variable to...
  17. sn0rg

    Printer Port Amendment

    Guys I have some 2003 print servers setup with IP Printer ports. The ports have been set with hostnames instead of IP addresses. I need a way of converting the hostname to an IP address. Name resolution is not an issue. I need to be able to change the entry in the port properties from the...
  18. sn0rg

    XCACLS

    Chaps, Using XCACLS in a script with a WMI command like this: strCommand = "cmd /k xcacls \\server\drive$\folder /E /G User:RCXD" Const HIDDEN_WINDOW = 12 Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2") Set objStartup =...
  19. sn0rg

    WMI & NetConnectionID

    I've got a peice of code to enumerate the MAC addresses and connection names of network cards. Where a network connection name is not present, I want to set the string to some valid data (ie "Not present"). However, when I use the following code, I can't trap the empty data. Can anyone help...
  20. sn0rg

    Network Adapter Name

    Esteemed Guru's I'm looking to write a WMI script to enumerate the NICs installed on a machine. I'm having a problem identifying the WMI class/attribute which holds the value for the name given to each connection by the user/system (eg"Local Area Connection", "Production LAN", "Local Area...

Part and Inventory Search

Back
Top