Scripting Blog

A place to learn about PowerShell and share stories of automation

How Can I Change the User and Computer Account Description Attributes Each Time a User Logs On?

Hey, Scripting Guy! How can I change the user and computer account Description attributes each time a user logs on? I’d like the Description to indicate who logged on, and when.-- GG Hey, GG. This is actually a pretty good idea. One question we get asked all the time is this: “How can I get a list of all my computers and who’s logged ...

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 that, over time, these columns tend to give the...

How Can I Prompt a User to Delete (or Not Delete) a Computer Account?

Hey, Scripting Guy! How can I delete a computer account from Active Directory, but provide a Yes/No prompt to the user before the account is actually deleted?-- NM Hey, NM. Let’s start by showing you how to delete a computer account from Active Directory. But don’t worry; that won’t take long. In fact, it only takes two lines of code:...