Scripting Blog

A place to learn about PowerShell and share stories of automation

How Can I Use Windows PowerShell to Determine the Status of the Guest Account?

Hey, Scripting Guy! How can I use Windows PowerShell to determine whether or not the Guest account has been disabled on a computer?-- RB Hey, RB. You know, last week at this time the Scripting Guy who writes this column was on vacation, a vacation spent primarily sitting outside in the sun, only occasionally getting up to watch TV. During ...

How Can I Bind to an Active Directory User Account Using Windows PowerShell?

Hey, Scripting Guy! I’ve been playing around with Windows PowerShell, and I find it interesting. However, I have a problem. I’d like to use PowerShell as a quick way to get information about an Active Directory user account, but I can’t figure out how to bind to a user account. Any suggestions?-- BW Hey, BW. As we noted a ...

How Can I Use Windows PowerShell to Start a Service on a Remote Computer?

Hey, Scripting Guy! How can I use Windows PowerShell to start a service on a remote computer?-- NA Hey, NA. You know, a few years ago a professor named Francis Fukuyama wrote a book called The End of History and the Last of Man, a book which stated (well, sort of) that now that the Cold War was over nothing particularly interesting and ...

How Can I Prompt a User for Input?

Hey, Scripting Guy! I need my script to prompt users to enter some information, like the name of the file they want to create. How do I do that?-- RW, Williamsport, PA Hey, BN. The simplest - and most foolproof - way to do this is to use an InputBox; when you do that users will be presented with a graphical dialog box similar to this: ...

How Can I Determine the Day of the Week?

Hey, Scripting Guy! I have a script that does certain management tasks based on the day of the week. I know how get the date in a script, but how can I tell whether it’s a Monday or a Tuesday or whatever? -- CT, Tallahassee, FL Hey, CT. This is actually much easier then it might sound; that’s because VBScript ...