Category Archives: Functions

Using Workflows to Multithread AD Queries

I am frequently called on for Active Directory reports for all domains in the forest.  This code shows you how to use a workflow to easily do this, adding the domain data into the results:

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

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

Export to Textbox with Out-TextBox

Out-TextBox.ps1 is an advanced function which outputs object to a resizable text box for display.  Not much more I can say about it, except that you can copy the text in the box.

Posted in Functions, PowerShell | Tagged | Leave a comment

Get-ADSystemInfo – Wrapping the ADSystemInfo ComObject

When I was writing in vbscript, I often used the ADSystemInfo ComObject.  It is a quick and easy way to get these properties:  Current user’s distinguished name, Current computer’s distinguished name, the site name, the Domain short (NetBIOS) Name,  the … Continue reading

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

Drag and Drop Form for Powershell

Get-DragAndDrop.ps1 is drag and drop PowerShell form is based on http://www.rlvision.com/blog/a-drag-and-drop-gui-made-with-powershell/.  All the interesting coding bits were written by Dan.  I modified the script to make it an advanced function which has parameters for the form title, instructions, status and … Continue reading

Posted in Functions, PowerShell | 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

Get MAC Address from IP Address

I got a call last week from a member of one the other teams where I work.  He asked, “Do you have a script which will resolve a list of IP Addresses to MAC Addresses?” My answer was, “not yet”.  … Continue reading

Posted in Functions, PowerShell, Scripting, Windows Administration, WMI | Tagged , , | Leave a comment

Remove Active Directory Delegations

Over time, Active Directory delegations tend to accumulate and drift from the standards in the enterprise.  Removing the delegations for a user or group can be slow, especially if you do it manually.  Microsoft has a good article about this process, but … Continue reading

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

Get Downtime Using PowerShell

I have been having problem with a computer with random reboots, and hanging on restart.  I wanted to know how long the computer had been unavailable.   I decided to use System Event ID 12 as the startup event for the … Continue reading

Posted in Computing, Functions, PowerShell, Scripting, Windows Administration | 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