Hey, Scripting Guy! How can I scan the event logs of my servers and return only information about unsuccessful logons?– LC Hey, LC. We’ll assume that you have enabled security auditing on your servers. If you haven’t, that’s step one. What you’ll want to do is – at a minimum – audit for logon event…
Year: 2005
How Can I Read Just a Single, Specified Line from a Text File?
Hey, Scripting Guy! How can I read only a specific line in a text file? For example, how can I write a script that reads only line 16 in a text file and then stores the value of that line in a variable?– DL Hey, DL. You know we haven’t answered a question about text…
How Can I Determine the Next Available Drive Letter on a Computer?
Hey, Scripting Guy! How can I determine the next available drive letter on a computer?– TW Hey, TW. Interesting question, and one that crops up from time-to-time. In the old days, when users only had drives A, B, and C, this was easy; you could pretty much guess that any drive letter other than those…
How Can I Find and Move an Active Directory Computer Account?
Hey, Scripting Guy! I need to move a computer account from one OU to another; however, I don’t know which OU the computer account is currently in. Any advice?– AA Hey, AA. You know, one thing that marks all the great advice columns – Dear Abby; Ann Landers; Hey, Scripting Guy! – is the fact…
How Can I Tell Which Switches Were Used When Starting an Executable File?
Hey, Scripting Guy! Is there any way to tell which command-line arguments (if any) were used when starting an executable file?– TO Hey, TO. We don’t mean to cause a scandal in the scripting world – well, OK, we don’t mean to cause any more scandals in the scripting world. But – gasp! – we’re…
How Can I Change the Caption for the My Computer Icon?
Hey, Scripting Guy! Instead of having the My Computer icon on the desktop read My Computer, I’d like to replace that with the name of the computer. Can I do that using a script?– TG Hey, TG. We get asked this question quite a bit; apparently a lot of you find it convenient to have…
How Can I Make a Read-Only File Writeable?
Hey, Scripting Guy! Is it possible to use a script to change the read-only attribute of a file?– ZO Hey, ZO. Of course, you can do this; the FileSystemObject can do anything! Well, OK, it can’t do either of those things. And, no, it can’t do that, either. But it can change a read-only file…
How Can I Change the Legal Warning Message Using a Script?
Hey, Scripting Guy! How can I use a script to change the legal warning message on a computer?– RB Hey, RB. As you all probably know, when you press Ctrl-Alt-Delete to log on to Windows, you’re typically presented with a logon box. You type your user name, domain, and password in the box, click OK,…
How Can I Tell if a Folder Has Any Files with a Specific File Extension?
Hey, Scripting Guy! How can I verify whether or not any files with a specific file extension exist in a folder?– GM Hey, GM. This is actually a pretty easy thing to do. All we have to do is write a WMI query that includes the path of the folder we want to check as…
How Can I Map a Printer, But Only If the User Doesn’t Have a Local Printer?
Hey, Scripting Guy! I’d like to have a logon script that maps a network printer for each user unless that user already has a local printer. If they have a local printer, I don’t want to add the network printer. Is that possible?– AG Hey, AG. Not only is that possible, but it’s actually pretty…