Setup Active Directory Integration with the PowerShell Toolkit

Having Active Directory integration certainly helps with organizing users in the various groups to control what actions can be performed on the FlashArray. The most complicated part of setting up Directory Service integration is on the Active Directory side. Once you have the below ingredients it very straight-forward.

Basic ingredients:

  • 1 Active Directory (AD) Server
  • 1 AD Base Group
  • 3 AD Groups
    • 1 Array Admin Group
    • 1 Storage Admin Group
    • 1 Read Only Group
  • 1 AD user account that has privileges to query

Each of the Active Directory Groups that need to be created can have any name you choose but obviously make sure that each of the groups can easily be identified as related to Pure Storage for ease of management.

Once you have each of the ingredients above plug them into the $DirectoryObj variables below and execute the script. The script will setup the Directory Service settings and at the end query to display the settings entered and then test that the Directory Services works.

Import-Module PureStoragePowerShell

$FlashArray = "My-Cool-Array"

$DirectoryObj = @{
    LdapUri = ldap://1.1.1.1
    BaseDN = "DC=mylab,DC=purestorage,DC=com"
    GroupBase = "OU=SAN-Admins"
    ArrayAdminGroup = "Pure_Storage_Admins"
    StorageAdminGroup = "Pure_Storage_Readers"
    ReadOnlyGroup = "Pure_Storage_Users"
    BindUser = "PureADQueryAcct"
    BindPassword = "BunniesRCute"
}

$FA = Get-PfaApiToken -FlashArray $FlashArray -Credential (Get-Credential) | Connect-PfaController -HttpTimeOut 10000

Update-PfaDirectoryService `
    -LdapUri $DirectoryObj.LdapUri `
    -BaseDN $DirectoryObj.BaseDN `
    -GroupBase $DirectoryObj.GroupBase `
    -ArrayAdminGroup $DirectoryObj.ArrayAdminGroup `
    -StorageAdminGroup $DirectoryObj.StorageAdminGroup `
    -ReadOnlyGroup $DirectoryObj.ReadOnlyGroup `
    -BindUser $DirectoryObj.BindUser `
    -BindPassword $DirectoryObj.BindPassword `
    -Session $FA

Get-PfaDirectoryService -Session $FA
Test-PfaDirectoryService -Session $FA

Below are examples of my environment after setting up my FlashArray using the PowerShell Toolkit.

Array_Dir_Services_Setup

PowerShell output that will be shown after executing the script:

PowerShell_AD_Setup

This sample code is available directly from GitHub at http://bit.ly/barkz. Be sure to download the latest version of the Pure Storage PowerShell Toolkit (v2.8.0.430).

Stop by Booth #108 next week and say hi!

Cheers,
barkz