Active Directory Star Wars PowerShell Module
Some time ago I talk about how to create Active Directory users based on the Star Wars world. This will help you to create some good tests users for your labs or demo instead of User1, User2 and so on.I use this on a regular basis when I need to build a demo for a client, the benefit of this is that you can use it for all kind of demos:
- Active Directory
- Office 365
- Access Permission
So I decided to enhance the script and turn it into a module for better sharing and usability.
Active Directory Star Wars PowerShell Module – Download
You can download the module on the PowerShell Gallery.
From Powershell with PackageManagement (included in Win10/Server2016):
Install-Module -Name StarWars -Scope CurrentUser
Note: Setting the install scope to “CurrentUser” allows you to install a module without admin permission on the operating system and it will install it only for you, in your own PSModulePath: %userprofile%\documents\WindowsPowerShell\Modules.
Once installed, you can see the included functions in it:
Get-Command -Module StarWars
For each function in this module, you can use the Get-Help cmdlet to lean more about how it works and what it does:
Get-Help -Name New-StarWarsADUser -ShowWindow
This function will create all the users available on the swapi.co in you local Active Directory. The function accepts a “Path” parameter to specify the organizational unit where you want them to be created, or, by default, it will create them in the default user location.
You can also choose the password that will be associated with the users, the UserPrincipalName suffix and the mail domain.
New-StarWarsADUser -Path 'OU=Users,OU=Star Wars,OU=Prod,DC=D2K16,DC=itfordummies,DC=net' -PassThru | Format-Table -AutoSize
This function will create groups based on the species and movies found in the swapi.co API. You can also specify a custom path to create them in the organizational unit of your choosing.
This function will create sites based on the planets found on the swapi.co API.
Once you created the users and the groups, you can use this function to add some users to the groups. Each users will be able in the movies they appear in, and they also will be added in their specie’s group.
Note: There is no magic, the users and the groups must be created before running this one.
This function will use the buzzer of your computer and try to do its best to sing the Star Wars music theme.
This function will delete all the groups created previously.
This function will delete all the sites created previously.
This function will delete all the users created previously.
I hope you’ll envoy this module to build some great demo to your clients, management, teams with friendly names as users!