PowerShell for Active Directory

This is where I will be making note of all the commands I use for managing Active Directory with PowerShell.

How to get Last Logon for all user in an OU: Get-ADUser -Filter * -SearchBase “OU=Test,DC=Domain,DC=local” | %{Get-ADUserLastLogon $_} To get all users last logon times check out this script.

What is Get-ADUserLastLogon? Courtesy of

Continue reading PowerShell for Active Directory

PowerShell Profile

I’ve been tinkering with my profile for a little while and think I have it to a point worth archiving.

Almost nothing here is my own scripting, just finding thing other people have done and maybe modifying it a bit. I do have links to the sources.

##============================================================================== ##============================================================================== ## SCRIPT………: Microsoft.PowerShell_profile.ps1 ## AUTHOR………:

Continue reading PowerShell Profile

How to debug a crash dump

Grab the latest version of the Windows Debugger from here.

One you have installed the SDK, open WinDgb from Start, Programs, Debugging Tools for Windows.

The symbols need to be set so the debugger can read the dump file, to do this, click File, Symbol File Path and add the following line to the box:

Continue reading How to debug a crash dump

ADPrep Error 0×80070002

When running ADPrep on Server 2003 from Server 2008 media you may get this error:

Error message: Error(110) while running C:WINDOWSsystem32LDIFde.exe The system cannot find the file specified.(0×80070002)

<error message has been trimmed>

Pausing your AV software will likely allow the command to complete successfully.  If it isn’t your AV there is something else that

Continue reading ADPrep Error 0×80070002

VBScript for getting last logon of local user accounts

Very handy script.

I had issues with the comments on line 29 wrapping, turn off Word Wrap in notepad and double check the formatting before you save.

The script is written in VB, in case you don’t recognize it.  I had to ask around…

Folder Size tool

Nice plug-in for Explorer to show the size of folders and files.

Folder Size

Caution, I’ve seen this chew up a lot of CPU on Server 2003 boxes…

Large MSI or MSP files won’t install…

I’ve had this error a couple times, usually the message says the file is rejected by a digital signature policy (Error 1718).

The fix is a patch from MS.

How to install x86 Printer drivers on a x64 Windows Server

Courtesy Aaron and Stan: To install an x86 additional driver on a 64 bit version of Server 2008 , you first need a running x86 Vista OR Windows 7 system.

1) Install the x64 printer driver on the server. 2) On your x86 PC, download and extract the x86 printer driver to C:tempprinter_name. 3) On

Continue reading How to install x86 Printer drivers on a x64 Windows Server

Profile Restore Script

Here is the script that will take the files backed up, via my Profile Copy Script, and restore them to where they belong.

This was written with AutoIt V3, most of the code belongs to ezzetabi

The script will work on XP, Vista or Win7.

Compile and execute with one command line parameter: the source (should

Continue reading Profile Restore Script

Profile Copy Script

I often find myself copying users’ profiles, so I thought I would make a script that would simplify it.

I wrote this with AutoIt V3, most of the code belongs to ezzetabi

The script will work on XP, Vista or Win7.

Compile and execute with one command line parameter: the destination.

Will copy files

Continue reading Profile Copy Script