Quantcast
Channel: PowerShell
Viewing all articles
Browse latest Browse all 15370

Powershell: Checking for No Password Set Accounts

$
0
0

Found this great article on 4sysops with a PS script to find what accounts you have in AD that don't have a password set.

https://4sysops.com/archives/find-ad-users-with-empty-password-passwd_notreqd-flag-using-powershell/

For those who want to jump to the chase, here is the script:

Powershell
# Create admin folderNew-Item-Pathc:\bin\ps\nopasswdaccounts-ItemTypedirectory-force# Get domain dn$domainDN=get-addomain|select-ExpandPropertyDistinguishedName# Save pwnotreq users to txtGet-ADUser-PropertiesName,distinguishedname,useraccountcontrol,objectClass-LDAPFilter"(&(userAccountControl:1.2.840.113556.1.4.803:=32)(!(IsCriticalSystemObject=TRUE)))"-SearchBase"$domainDN"|selectSamAccountName,Name,useraccountcontrol,distinguishednameC:\bin\ps\nopasswdaccounts\PwNotReq.txt# Output pwnotreq users in grid view...

Viewing all articles
Browse latest Browse all 15370

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>