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 this remote drive became important to me. Here is an example of the…
Tag: Active Directory
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 for these fields. However, if you look at the properties of a user object, these…
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 number of people have noticed that you can pipe RepAdmin CSV output to the ConvertFrom-CSV…
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 a vbScript to do that years ago. But to complete, we want to check more. …
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.
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 my very large AD environment. The scripts I have seen tended to collect all objects at…
Passwords for Password Resets
I discovered that my script to generate passwords, RandomPW.vbs, isn’t popular with users because the passwords are random. I have an even more complicated but unposted PowerShell version with the same issue. I wanted to create something that was easier for the help desk and users. Get-TempPW.ps1 is my answer to those objections. This script…
Get the Parent OU for an AD Object
I have mentioned before that the Charlotte PowerShell User group was frequented by Scripting Guy Ed Wilson, and his wife Teresa. I’m sad to say that they have moved away, but am happy that Brian Wilhite has been running the meetings since. I mentioned to Brian that I had a cool way to get the…
Test Whether Organizational Unit or Account Exists
Here are two quick functions which I have recently found useful. The first tests whether a user account exists. It takes the Domain and Identity as arguments. Using the “Stop” error action with Try/Catch keeps it from showing any errors. You can do this with any of the AD cmdlets, such as Get-ADOrganizationalUnit, Get-ADComputer and…
Auditing Active Directory Permissions with Powershell
Active Directory permissions aren’t easy to audit. It is a lot easier to delegate permissions to a user or a group than it is to figure out later who has what rights on what containers and organizational units. I have taken a few runs at it, including a vbscript version which was terrible. That is…