Browse by Tags

Tagged Content List
  • Blog Post: Hey, Scripting Guy! Can I Query a Microsoft Access Database with a Windows PowerShell Script?

    Hey Scripting Guy! I have a Microsoft Access database that I need to query from a Windows PowerShell script. I have seen a number of VBScript examples, but I cannot find any Windows PowerShell samples. Can you point me in the right direction? I do not want you to write it for me, but I would like a hint...
  • Blog Post: How Can I Get a List of All the Databases on a SQL Server Computer?

    Hey, Scripting Guy! How can I get a list of all the databases on a SQL Server computer? -- ER Hey, ER. Before we answer your question, we’d like to take a moment to offer our opinions on all the major – and controversial – issues of the day. We can do that because the Scripting Editor is on vacation...
  • Blog Post: How Can I Create a Table in a SQL Server Database?

    Hey, Scripting Guy! How can I create a table in a SQL Server database? -- FD Hey, FD. And thanks: you’ve saved the Scripting Guys! Or, at any rate, you’ve saved the Scripting Guy who writes this column. As it turns out, this Scripting Guy is getting ready to leave town and attend his nephew’s wedding...
  • Blog Post: How Can I Locate and Replace Information for a Specific Item in a Spreadsheet?

    Hey, Scripting Guy! In an Excel spreadsheet, how can I locate and replace information for a specific computer? -- BB Hey, BB. You know, there’s an old saying that goes, “If all you have is a hammer then everything looks like a nail.” Well, all we Scripting Guys have at the moment is some code for...
  • Blog Post: How Can I List All the Tables in an Access Database?

    Hey, Scripting Guy! How can I list all the tables in an Access database? -- KW Hey, KW. You know, the best part about writing a daily column on system administration scripting is that people only see the finished result; they never see all the detours, dead-ends, and other frustrations we go through...
  • Blog Post: How Can I Count the Number of Computers in a Domain?

    Hey, Scripting Guy! How can I count the number of computers in a domain? -- TN Hey, TN. Here’s a true story for you. About 5 years ago, when one of the Scripting Guys first started at Microsoft, his group here (which might not be the most technically-savvy group at the company) needed to get a count...
  • Blog Post: Hey, Scripting Guy! How Can I Read from Excel Without Using Excel?

    Hey, Scripting Guy! I have an Microsoft Office Excel spreadsheet with server names in it, and I would like to be able to use this in a Windows PowerShell script. The thing is, I do not have Microsoft Office or Excel installed on the server. How can I use this spread sheet without installing Office on...
  • Blog Post: How Can I Use ADO to Read a Text File Where All the Data is on a Single Line?

    Hey, Scripting Guy! I have a fixed-width text file which includes first name (6 characters), last name (13 characters), and department (9 characters) all on a single line. How do I read that using ADO? -- DW Hey, DW. Well, to be perfectly honest, we don’t think you can read a file like this using...
  • Blog Post: How Can I Add a User to a Group, but Only if that User is a Member of the IT Department?

    Hey, Scripting Guy! How can I add a user to a group, but only if that user is a member of the IT department? -- JV Hey, JV. You know, this is your lucky day: not only are we going to show you how you can add a specified user to a group (assuming, of course, that this user is a member of the IT department...
  • Blog Post: How Can I Use Windows PowerShell to Pull Records From a Microsoft Access Database?

    Hey, Scripting Guy! How can I use Windows PowerShell to pull records from a Microsoft Access database? -- SB Hey, SB. You know, you’re lucky to get this question answered; after all, this looks as though it’s going to be the very last Hey, Scripting Guy! column ever. To be honest, that came as...
  • Blog Post: How Can I Get a List of All the Users Who Have an Alternate Recipient?

    Hey, Scripting Guy! How can I get a list of all the users who have an alternate recipient (altRecipient)? -- SA Hey, SA. You know, one of the great things about being a Scripting Guy is that we don’t ever have to know what we’re talking about; all we do have to know is how to write a script that does...
  • Blog Post: How Can I Verify that None of My Local User Accounts have a Blank Password?

    Hey, Scripting Guy! How can I verify that none of my local user accounts have a blank password? -- TB Hey, TB. To begin with, we should point out that at least some of you won’t need to make this check on computers within your domain; that’s because you’re using password policies in the domain that...
  • Blog Post: How Can I Delete a Table from a Jet Database?

    Hey, Scripting Guy! Can I delete a table from a Jet database using a script? -- AK Hey, AK. Of course you can delete a table from a Jet database using a script; after all, you can do anything using a script! Well, OK, maybe not DHCP server stuff. And maybe you can’t change the display resolution...
  • Blog Post: Hey, Scripting Guy! Quick-Hits Friday: The Scripting Guys Respond to a Bunch of Questions (04/03/09)

    Troubleshooting the Application of Two WMI Classes Hey, Scripting Guy! The examples produced from the "Scriptomatic Version 2.0 by The Microsoft Scripting Guys" for the entries Win32_ServiceSpecification and Win32_ServiceControl both return error 0x80041002 under Windows Server 2003. I can't find...
  • Blog Post: How Can I Query a Text File and Retrieve Records That Occurred on a Specific Date?

    Hey, Scripting Guy! We have tons of text files in which each line in the file represents a record or an event of some kind. How can I use a script to retrieve records or events that occurred on a specified date? -- TW Hey, TW. You know, in your email you sort of apologized for using text files, noting...
  • Blog Post: Hey, Scripting Guy! How Can I Write to Excel Without Using Excel?

    Hey, Scripting Guy! I need to be able to write information to an Excel file. I do not want to install Microsoft Office Excel on my server, but the spreadsheet format is a nice way to store information. I can then give it to my pointy-headed boss, and he can create pivot tables, charts, or whatever exactly...
  • Blog Post: How Can I List All the Fields and Data Types in an Access Database?

    Hey, Scripting Guy! In a previous column you showed us how to list all the tables in an Access database. How can I list all the fields in those tables, along with the data type of each field? -- MF Hey, MF. As you may or may not know, there’s a Microsoft researcher named Gordon Bell who has devoted...
  • Blog Post: How Can I Use ADO to Open a Text File That has Spaces in the File Name?

    Hey, Scripting Guy! How can I use ADO to open a text file that has spaces in the file name? -- TL Hey, TL. You might not even remember sending us this question; to say it’s been awhile would be an understatement. (You should have seen all the dust and cobwebs we had to brush off this question before...
  • Blog Post: Can I Get a List of All My User Accounts?

    Hey, Scripting Guy! Is there any way to get a list of all the user accounts in Active Directory? -- CB, Fremont, CA Hey, CB. By far the quickest and easiest way to do this is to search Active Directory for all your user accounts. Here’s a sample script that searches the fabrikam.com domain; to search...
  • Blog Post: How Can I Save a Disconnected Recordset?

    Hey, Scripting Guy! How can I save a disconnected recordset? -- RW Hey, RW. You know, the Scripting Guys believe in keeping things as simple as possible. For example, when one of the Scripting Guys had to buy a new tie several years ago, he simply asked his dad to tie it for him; on the rare occasions...
  • Blog Post: Hey, Scripting Guy! How Can I Use a Disconnected Recordset in Windows PowerShell?

    Hey, Scripting Guy! How can I use a disconnected recordset in Windows PowerShell? I’m able to create the recordset without any problem, but I can’t figure out how to reference the fields and values in that recordset. -- JVDL Hey, JVDL. Well, we must say, we’re impressed by how cool, calm, and collected...
  • Blog Post: How Can I Tally Items in a Text File?

    Hey, Scripting Guy! How can I tally items in a text file? -- JA Hey, JA. If we understand you correctly you have a text file that consists of a number of lines, each line representing a particular item. Just to keep things simple, let’s say your text file consists of city names: City Seattle Seattle...
  • Blog Post: How Can I Populate a List Box With the CNs of All the OUs in My Domain?

    Hey, Scripting Guy! How can I populate a list box with the CNs of all the OUs in my domain? -- AK Hey, AK. That’s an interesting question, AK, and we’ll do our best to answer it. Of course, we should point out that the United States soccer team has just finished losing to the Czech Republic in the...
  • Blog Post: Hey, Scripting Guy! How Can I Add a Record to a Database Using Windows PowerShell?

    Hey, Scripting Guy! Awhile back you showed us how we could use Windows PowerShell to retrieve data from a Microsoft Access database. I’m now trying to add data to a database using PowerShell, but I can’t get the script to work. Any chance you could show me how to add a record to a database using Windows...
  • Blog Post: Hey, Scripting Guy! Weekend Scripter: Using the Windows Search Index to Find Specific Files

    Microsoft Scripting Guy Ed Wilson here. One of the cool things about using Windows PowerShell is the different objects with which you can interact. Windows Search is an example of this. By using ADO, you can query the Windows Search index and retrieve information about files. This technique can have...