Active Directory - Scripts
AD Health Check With Email
<#PSScriptInfo .VERSION 1.0 .GUID 30c7c087-1268-4d21-8bf7-ee25c37459b0 .AUTHOR Vikas Suk...
Compare Two Azure/AD/M365 Groups and Print the Results
Compare two AD Groups. $GROUP1=Get-ADGroupMember -Identity "Domain Admins" | select-Object Name ...
Create daily scheduled task for AD snapshots
#region Check if System is DC and logged-on user is admin $DomainRole = Get-WmiObject -Class W...
Disable DNS Debug Logging
Generated from claude.ai # GUI Script to disable DNS debug logging on multiple domain controll...
Get DNS Diagnostics
Generated by Claude.ai Can you generate a script that gathers the DNS logging information fr...
Get List of All Attributes in AD
# Import Active Directory module Import-Module ActiveDirectory # Retrieve schema information fo...
Get User SID
$objUser = New-Object System.Security.Principal.NTAccount("USERNAME") $strSID = $objUser.Transla...
Get USERID From SID
$objSID = New-Object System.Security.Principal.SecurityIdentifier ("S-1-5-21-2484819571-212552959...
Get-ADUserPasswordNeverExpires
get-aduser -filter * -properties Name, PasswordNeverExpires | Where-Object { $_.passwordNeverExp...
Get-UserAccountControl for Specific Machine
<# .SYNOPSIS Retrieves UserAccountControl values for machine accounts across multiple server...
List Active Directory Users In Groups
$Members = @() $domains = (Get-ADForest).domains foreach ($domain in $domains) { $Groups...
Test gMSA Account on DCs
# This will run on all Domain Controllers. . Replace 'adhealthcheck' with actual gMSA name Invok...
Get-AllDisabledandInactiveComputers
How to Find Disabled Computers in Active Directory Using PowerShell Report? For those who prefer...
Count-AllDomainControllers
########################################## # AUTHOR : Ryan Mutschler # DATE : 8-15-...
Count-MembersInADGroupNested
########################################## # AUTHOR : Ryan Mutschler # DATE : 4-2-2...