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 Mike Lewis 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. withanh

    vMA scripting

    Unfortunately, Orchestrator will not work for this. I'm working on a project to automate the startup of the datacenter after a power failure/restore. vCenter is not running at this point so I cannot use the Orchestrator. But, the command you gave looks like what I need to feed into a script...
  2. withanh

    Add FTP functionality to Debian

    Too bad, you had me all excited! Oh well, no harm :-)
  3. withanh

    Add FTP functionality to Debian

    BigBadBen, Can you send a link to the server version of FileZilla for Linux? I use the FileZilla client almost exclusively and would love to put a FZ server on my Linux box. I just went to their website and can only find the Windows download for the server. Thanks! h
  4. withanh

    vMA scripting

    I'm using the vMA5 to interface with my APC UPS's for controlled shutdowns when my power switches to battery. The shutdowns work as expected. My problem is during the restarts, I have my hosts starting properly, but the VMs need to start in a particular order (i.e. DC first, then Exch, then...
  5. withanh

    Calling PowerShell script from HTA

    I'm trying to build a poor man's ActiveSync manager. Basically, the goal is to check the Exchange infrastructure and see who has ActiveSync enabled. Us that to populate a drop-down list. Pick a name from the list and it kicks off another PS script (that works just fine) that asks Exchange...
  6. withanh

    Calling PowerShell script from HTA

    I wonder what user context the script runs in. Now when I run this, it tells me that the PowerShell snap-in 'Microsoft.Exchange.Management.PowerShell.Admin' is not installed on this machine. But it is, when I run the PS script separately it runs just fine. Just can't quite figure it out. The...
  7. withanh

    Calling PowerShell script from HTA

    @dilettante I fail to see how this has anything to do with Microsoft's phone platform. We do not have any Microsoft phones in our environment. It's ActiveSync which is how iPhones & Android phones connect to Exchange. Not to mention that this is a PowerShell script execution issue and really...
  8. withanh

    Calling PowerShell script from HTA

    I have an HTA that I'm writing that writes and calls a PowerShell script. The PS script interrogates Exchange to find who has ActiveSync enabled. This is used later in the main script for looking at ActiveSync devices and controlling them. The PS script works perfectly when run as a...
  9. withanh

    Determine how script was launched

    Thanks. That's pretty much what I was thinking. I wasn't sure if there was a better 'native' way to tell what launched the script. h
  10. withanh

    Determine how script was launched

    I'm trying to determine how a script was launched then run a sub based on this. For example, if a script was launched by Task Scheduler then write a line into a log file saying 'scheduled launch' but if it was run manually then write a different line into the log file saying 'manual launch'...
  11. withanh

    New to TekTips, New to scripting, Need to pull info from AD

    Check some of these pages for some examples: http://www.computerperformance.co.uk/vbscript/ http://www.alanphipps.com/VBScript-ActDir.html
  12. withanh

    Get result of SQL count query into a variable

    I finally have everything dialed in and working the way I want. Now I am soliciting advice for optimizing the code. Thanks!Option Explicit Dim objConnection, objRecordset Dim strDBServer, strDBUsername, strDBPassword, strDBConnection Dim arrDatabases(), arrFindDatabases, objDatabase...
  13. withanh

    Get result of SQL count query into a variable

    Wow, I just surprised myself, I figured it out. The problem is the table was empty so I had to check for that like this If Not objRecordset.EOF Then objRecordset.MoveFirst arrTables = objRecordset.GetRows() End IfProblem solved. Now it doesn't like opening the "model" table, but...
  14. withanh

    Get result of SQL count query into a variable

    I'm having problems looping through my databases now. The code isSub GetDatabaseNames2() GetDatabases For Each objDatabase In arrDatabases GetTables For Each objTable In arrTables MsgBox "Database = " & objDatabase & vbCrLf & "Table = " & objTable Next Next End Sub Sub...
  15. withanh

    Get result of SQL count query into a variable

    OK, got it. I just did the .GetRows with no parameters, so my final code is Set objConnection = CreateObject("ADODB.Connection") objConnection.Open "Provider=SQLOLEDB.1;Data Source=" & strDBServer & ";Initial Catalog=master",strDBUsername,strDBPassword Set objRecordset =...
  16. withanh

    Get result of SQL count query into a variable

    I'll keep googling, but so far this is what I came up with, but it yields an empty array: arrDatabases = objRecordset.GetRows(,0,"name")
  17. withanh

    Get result of SQL count query into a variable

    Thoughts on using objRecordset.RecordCount? It returns -1 instead of how many records I have. I guess I can loop through the records and add a counter, then redim the array then loop through the records again putting them into the array. Doesn't seem very efficient, though.
  18. withanh

    Get result of SQL count query into a variable

    I'm having problems now putting this into an array, and I think the issue is objRecordset.RecordCount. When I try to ReDim arrDatabases(objRecordset.RecordCount), the value of objRecordset.RecordCount is -1. Shouldn't that return how many records are in the recordset?
  19. withanh

    Get result of SQL count query into a variable

    Oh, I get it! If I used objRecordset(1).Value, that would be the 2nd column in the recordset, right?
  20. withanh

    Get result of SQL count query into a variable

    With my second set of code - using objRecordset(0).Value instead of objRecordset(i).Value I get the same database names that I get in the studio. Now I'm trying to put those into an array so I can use them later.

Part and Inventory Search

Back
Top