The Multifunctioning DBA:

Powershell


October 21, 2009  10:00 AM

AD Audit all together



Posted by: Colin Smith
AD, AD Administration, AD Managment, Powershell, Scripting

Here is the full script so you can copy and paste it. Remember that you will need to make some modifications to the script to fit your environment. Let me know if you have any questions at...

October 20, 2009  6:48 PM

AD Audit Script Q and A



Posted by: Colin Smith
AD, AD Administration, AD Managment, Powershell, Q and A, Scripting

I got the following comment on Part 3 of the script. RobDolfijn Hi Colin, This is just what I need so I’m looking forward to the whole script! I’m getting stuc on Get_Users because it...


October 20, 2009  4:45 PM

AD Audit in Powershell Script Part 6



Posted by: Colin Smith
AD, AD Administration, AD Managment, Powershell, Scripting

As i recall, in Part 5 we had gathered all the account information, parsed that, disabled accounts that needed to be disabled, gathered information on all the disabled accounts, and removed the accounts from the domain that needed to be...


September 27, 2009  9:00 AM

AD Audit in Powershell Script Part 5



Posted by: Colin Smith
AD, AD Administration, AD Managment, Powershell, Scripting

Now that we have disabled and moved all the disabled accounts to the Disabled OU I am going to get all the user object information from just the disabled OU this time. I need this since objects have been moved around. This scan of AD does go much faster as I am only scanning the one OU. I have this...


September 25, 2009  4:57 PM

AD Audit in Powershell Script Part 4



Posted by: Colin Smith
AD, AD Administration, AD Managment, Powershell, Scripting

Now that we have all of the users information into a csv file it is time to start sorting through all of that data and determining what objects need to be disabled and moved to the disabled OU that I have set up for all disabled accounts to go and await deletion. Lets do that with the...


September 24, 2009  8:30 PM

AD Audit in Powershell Script Part 3



Posted by: Colin Smith
AD, AD Administration, Powershell, Scripting

Now that we have the main part of the script setup it is time to look at the first function that we call. This is the Get_users function. Now this function gets a listing of all the DC's and does a get-qaduser on all of them looking at the lastlogon property to determine what DC has the latest...


September 24, 2009  4:13 PM

Powershell Remove files



Posted by: Colin Smith
Microsoft Windows, Powershell, Windows, Windows Administration

I have a server that attempts to backup up the SQL Server databases and it always fails because not enough space is available. This usually is not a big deal as I would run a SQL Clean up task before the backups run to remove the old files. In this case though I am using a third party utility to...


September 24, 2009  7:30 AM

AD Audit in Powershell Script Part 2



Posted by: Colin Smith
Active Directory, AD, AD Administration, Powershell

Now that we have some idea about what this script is about and what we would like to accomplish with the script lets get into it. I have the code in the box below and I will just go over what I am doing . This is where the script will start so I am setting up my variables and then I will start...


September 23, 2009  4:35 PM

AD Audit in Powershell Script Part 1



Posted by: Colin Smith
Active Directory, AD, AD Administration, Powershell

As I said before I have completed my re-write of my Active Directory Audit into Powershell. Man is it better. more functional and less code. I love it. This script goes out and searches my domain for user accounts that are old and stale. By old and stale I mean that they were both created, and have...


September 18, 2009  4:37 PM

AD Audit in Powershell



Posted by: Colin Smith
AD, Administration, Audit, Automation, Powershell

I have mentioned this before but I have finally done what I set out to do and re-wrote my old vbscript that audits AD Accounts based on Create Date and Last LogonDate in Powershell. This is another great example of how much better powershell is and why everyone should now it. My VB Script was just...


Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: