Tag Archives: Active Directory

Getting GPO GUID, Name from Active Directory

You don’t have to rely on the Group Policy Module to resolve the display name of a GPO from the GUID, or the GUID from the display name.  Here are two short functions that will get that information from Active … Continue reading

Posted in Active Directory, Functions, Group Policy Objects, PowerShell, Scripting, Scriptlets | Tagged , , , | Leave a comment

Undelete-ADObject

Undelete-ADObject.ps1 is a GUI form based script for undeleting user, computer, group, print queue, and contacts from Active Directory.  You can display all of the objects of the selected type, or search by the name. I use this script frequently.  … Continue reading

Posted in Active Directory, Alan's Favorites, PowerShell, Scripting, Windows Administration | Tagged , | Leave a comment

Powershell Date LDAP filters

This snippet can be used for easier date formatting when using an LDAP date filter with PowerShell.  This demonstrates how to get users created within the previous 30 days using LDAP:

 

Posted in Active Directory, PowerShell, Scripting, Scriptlets | Tagged , | Leave a comment

OU of Current PC from anywhere in the Forest

There are a lot of ways to get the OU of the current computer, but most don’t work if you are outside your home domain. This code does, without requiring AD cmdlets:

Update: 9/23/2017: You can also get this … Continue reading

Posted in Active Directory, Scripting, Scriptlets | Tagged , | Leave a comment

Create an AD Drive for Specified Domain

When you load the Active Directory Module, you get, by default, an Active Directory PSDrive for the current domain.   You can avoid the drive from loading by setting $Env:ADPS_LoadDefaultDrive = 0. When writing scripts to export and import AD delegations, connecting to … Continue reading

Posted in Active Directory, Functions, PowerShell, Scripting | Tagged , , | Leave a comment

Adding Terminal Services Information to User Reports

Add-ADTSInfo.ps1 adds TerminalServicesHomeDrive, TerminalServicesHomeDirectory, TerminalServicesProfilePath and AllowLogon as additional members returned by a query of Active Directory user objects.  As you may know, when looking at a user’s properties in the Active Directory Users and Computers MMC there is a tab … Continue reading

Posted in Active Directory, Functions, PowerShell, Scripting | Tagged , , , | Leave a comment

Test Replication – A PowerShell Wrapper for RepAdmin

Repadmin is a standard tool in an AD admin’s toolbox, and “showrepl” displays the status of replication in your domain. The results of this command are quite verbose, and can make your eyes glaze over in late night troubleshooting.  A … Continue reading

Posted in Active Directory, PowerShell, Scripting, Windows Administration | Tagged , , | Leave a comment

Quickly Check Domain Controller Health

How can you tell whether an Active Directory domain controller is functioning properly?  How do you know whether some over-zealous VLAN ACL is blocking necessary ports?  Testing ICMP, is easy, just ping it.  Testing LDAP response isn’t hard, I wrote … Continue reading

Posted in Active Directory, Alan's Favorites, My Best, PowerShell, Scripting, Windows Administration | Tagged , , , | Leave a comment

Copy Distinguished Name of OU to Clipboard (OUADSPath2Clip Updated)

OUADSPathToClip.ps1 is an updated version of OUADSPath2Clip.ps1 and is an example implementation of the new Select-OU.ps1 script.  Fast navigation of OU structure to copy the OU’s DistinguishedName into your clipboard. Version 1.1 allows control of form and button text.

Posted in Active Directory, Alan's Favorites, PowerShell, Scripting | Tagged , | Leave a comment

Fast PowerShell Treeview OU Selection Form

A large number of my scripts involve picking an Active Directory Organizational Unit (OU). I have been using Out-Gridview for OU navigation. This is because I was unable to find a form based GUI OU picker that worked fast enough in … Continue reading

Posted in Active Directory, Alan's Favorites, My Best, PowerShell, Scripting | Tagged , , , | Leave a comment