Alan's Blog

"Yeah. I wrote a script that will do that."

Menu
  • About My Blog
Menu

Tag: Active Directory

Export AD Users

Posted on December 26, 2021 by Alan

Export-ADUsers.ps1 is a GUI script which exports users with the attributes you select from any OU selected from a domain navigation menu. The list of available attributes are read from the Schema. There is special handling of some attributes and so it can return the domain, Enabled, userAccountControl and published certificates. Not required: admin rights…

Read more

Export Domain Group Members

Posted on December 26, 2021 by Alan

Export-DomainGroupMembers.ps1 is a GUI script which exports group membership with the attributes you select. It takes the group’s distinguishedname as a parameter, and supports very large groups. How large? I have enumerated groups with over 350,000 members in a multidomain forest. You can get nested group membership, even if there are recursion loops. The list…

Read more

Get User Lockout Information

Posted on December 26, 2021 by Alan

This script lets you see lockout events for a user from the domain controller on which the event(s) occurred. It accepts the user’s distinguished name as input,  enumerates the list of domain controllers, then finds the LockoutTime on each domain controller. It then calculates the time +/- 2 seconds, and queries the DC event log…

Read more

Get AD Replication Metadata

Posted on December 25, 2021 by Alan

Some Active Directory attributes are local to the domain controller where the event occurred, such as lastlogon, but most others are replicated to all domain controllers within that domain. This should be distinguished from the attributes which are part of the Global Catalog – those attributes are a subset of domain attributes which exist and…

Read more

Get Security Set on Active Directory Objects

Posted on December 25, 2021 by Alan

Viewing the security set on an Active Directory object is useful for troubleshooting and for security event investigations. Get-ADObjPermissions_ps1 reads your AD schema data, and provides a list of security set with both the setting and the delegate. This does not require admin permissions or any modules to run. It take’s the object’s distinguished name…

Read more

Find AD Object’s DistinguishedName

Posted on December 25, 2021December 25, 2021 by Alan

Getting the distinguishedname of an Active Directory object is a common administrative task. Find-ADObject_ps1 makes it easy to get this information for users, computers and groups using System.DirectoryServices.DirectorySearcher instead of the ActiveDirectory module. Admin rights are not required. The syntax is simple, ex: .\Find-ADObject.ps1 -adobject ‘MyGroup’ -ADObjectType Group.

Read more

Getting the Status of a GPO Deployment in an AD Forest

Posted on October 2, 2020 by Alan

If you are in a large environment, you may be deploying group policies to multiple domains.  How can you track the deployment status of the deployment? With Get-GPOdeploymentStatus.ps1, you can enter the name of the GPO, then have all domains queried to discover if it has been installed, who installed it, when it was last…

Read more

Get Security Set on AD Object

Posted on October 2, 2020October 2, 2020 by Alan

It’s been a while, gentle reader, since my last post. It isn’t that I haven’t been writing code, but rather that much of what I write is for internal use only. Recently I was asked to write a PowerShell script to show the advanced security for any AD object, without relying on the ActiveDirectory module….

Read more

Get Active Directory Forest Domain Controllers

Posted on January 25, 2020 by Alan

Like the other script posted today, this was written to help out the networking team with a simple inventory of DCs in a large Active Directory forest.  It queries all domains in the forest, creating a CSV file with the Domain, DC name, IP Address, OS, AD Site and Roles.  It can optionally ping the…

Read more

Get Sites and Subnets in AD Forest

Posted on January 25, 2020 by Alan

The script below was written so the networking staff would be able to always have a current list of the AD Sites and Subnets, without relying on the Active Directory Module. <# Get-ADSubnets.ps1 Alan Kaplan 1/24/20 Get list of AD Subnets in Forest Does not rely on AD module or admin rights #> #Default logfile…

Read more
  • 1
  • 2
  • 3
  • 4
  • Next

Search

Please Note

All the scripts are saved as .txt files. Newer files have a “View Script” button which will let you save or open a script in notepad. For earlier posts, the easiest way to download with IE is to right click on the link and use “Save Target As”. Rename file from Name_ext.txt to Name.ext.

To see a full post after searching, please click on the title.

PowerShell Scripts were written with version 3 or later.

https connections are supported.

All new users accounts must be approved, as are comments. Please be patient.  If you find a post error or a script which doesn’t work as expected, I appreciate being notified.  My email is my first name at the domain name, and you are welcome to contact me that way.

Tags

1E ACLS Active Directory ActiveDirectory ADSI Advanced Functions Audit Change Administrator Password COMObject Computer Groups DateTime Desktop DNS Excel FileScriptingObject Forms General GPO GPS Group Policy Hacks ISE Lockout logons NAV740 Nessus OU OU permissions Outlook Pick Folder Power PowerShell Powershell Scriptlets RDP SCCM schedule reboot Scripting Security Shell.Application user information VBA Windows Update WMI WordPress WPF

Categories

akaplan.com

  • Back to Home Page

Archives

Scripting Sites

  • A Big Pile of Small Things
  • Adam, the Automator
  • Art of the DBA
  • Ashley McGlone
  • Boe Prox
  • Carlo Mancini
  • DexterPOSH
  • Doug Finke
  • Jaap Brasser's Blog
  • JeffOps The Scripting Dutchman
  • Jonathan Medd's Blog
  • Keith Hill's Blog
  • LazyWinAdmin
  • Nana Lakshmanan
  • PowerShell Magazine
  • PowerShell Team Blog
  • PowerShell.org
  • PwrShell.net
  • Richard Siddaway's Blog
  • Ryan Yates' Blog
  • Skatterbrainz
  • The Lonely Administrator

SQL Site

  • Art of the DBA

Meta

  • Register
  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
©2025 Alan's Blog | Theme by SuperbThemes

Terms and Conditions - Privacy Policy