Category Archives: Scripting

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

Sort Clipboard Text with PowerShell

Sort-ClipText.ps1 reads the text in your clipboard, sorts it, and creates a new sorted item in your clipboard.  Note that the split statement is a regular expression.  The pipe character represents the logical OR.  I also used splitstringoptions to remove … Continue reading

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

Add-WindowsFeature Alternative for Client OS

Waiting for the add remove features dialog populate on my client OS computer is slow.  Since I started using Add-WindowsFeature wither Server 2008, and Install-WindowsFeature beginning with Server 2012, I was disappointed by the lack of a similar cmdlet for … Continue reading

Posted in PowerShell, Scripting, Windows 10, Windows 7, Windows 8, Windows Administration | Tagged , , | Leave a comment

Export and Import Delegated OU Permissions with PowerShell

There are some delegations of permissions within Active Directory which cannot be made without extra effort. Some properties are flagged as hidden in a file called Dssec.dat, in %windir%\System32 on computers with the Active Directory Users and Computers (ADUC) MMC. … Continue reading

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

Clear GPO Cache on Remote Computer with PowerShell

Clearing the GPO cache on a computer may be the only way to fix a persistent problem.  Doing this involves deleting files, registry entries, and rebuilding the security database.  Clear-GPOCache.ps1 works by creating a custom batch file on the remote … Continue reading

Posted in Active Directory, Batch, Group Policy Objects, PowerShell, Scripting, Windows Administration | Tagged , | Leave a comment

Get and Read RDP Certificate from a Remote Host with PowerShell

Sometimes, I get some interesting questions from other teams within my organization.  Read-RDPCert.ps1 addresses a request to read the SSL certificates from a list of remote hosts.  This is based on the code and following comments at https://blogs.technet.microsoft.com/parallel_universe_-_ms_tech_blog/2014/06/26/reading-a-certificate-off-a-remote-ssl-server-for-troubleshooting-with-powershell/.

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

Enable New User Mailboxes with PowerShell

Mail enabling new users should be easy to do from within the Exchange management console.  If you are in a really large organization, you soon discover that it is painfully slow.  When we create new users it takes time to … Continue reading

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