Easily add targets into GoPhish for internal simulated threat training, based on pre existing groups in your Active Directory environment.
- Download DirectoryPhish.ps1 or clone this repo.
- Make sure you have the AD-DS PowerShell cmdlets installed.
- Set your execution policy appropriately.
- Select your target group and run the script (see Examples below).
- Take the output CSV and login to your GoPhish management panel
Users & Groups.
New Groupand give it a name.
+ Bulk Import Usersselect your CSV and wait for the table to populate.
- Catch some phish :)
--Group (required) --ExcludeIfIn (optional) --Domain (optional)
Get your Domain Users:
.\DirectoryPhish.ps1 --Group "Domain Users"
Get your Domain Users that are not in ManagementGroup:
.\DirectoryPhish.ps1 --Group "Domain Users" --ExcludeIfIn "ManagementGroup"
Get your Domain Users that only have *@contoso.com email addresses:
.\DirectoryPhish.ps1 --Group "Domain Users" --Domain contoso.com"
This script will only return results if the user has an email address in AD under the
EmailAddress property and will only return this email address.