blog - pmo365 | Project Portfolio Management Solution

Tech Support: Extracting PWA Security Group Usernames In Bulk - pmo365 | Project Portfolio Management Solution

Written by Laith Adel | Nov 5, 2020 2:56:57 AM

Background

It’s so helpful to have an Excel list of the username data contained in multiple PWA Security Groups. So, we thought we’d make a blog post with the solution! You can easily achieve this if you only have a handful of PWA Security Group Usernames. But, what if you have more than a few users? You may have noticed there is no nifty “Export to Excel” button in the ribbon to save you this time.

You’ll find the secret to extracting users from PWA Security Groups in the HTML source code. There are two ways we can go about locating the User list in HTML source code, but both require you to access your PWA Security Group. We’ll outline both ways below. 

Prep Work

Firstly, you will need to access your PWA Security Group, and navigate to Manage Groups.

  1. Go into your PWA environment by right-clicking on the cog wheel located at the top right-hand corner.
  2. Select “PWA settings”, then Under Security section, click on “Manage Groups”
  3. On the Group Name in the “Users” section, select the PWA Security Group you would like to extract Username data from.
  4. While it might vary for your set up, we accessed our HTML under “Portfolio Managers”, where you’ll find this data located in a container labelled “Selected Users”.

Time Saver Approach to Extract PWA Security Group Usernames

  1. Once you’re inside your desired PWA Security Group, right click on the web page to for the pop-up window to pop up.
  2. Select and click on “View page source”.
  3. This will open a new browser window with all the HTML source code, which can be edited.
  4. Use the Find command (Control + F or Command + F) and type into the search bar: <select name=”users_Beta” id=”users_Beta” size=”7″ style=”width:15em;”>
  5. We have found our Users, of which you could potentially have hundreds in a single PWA group. Now, it’s as easy as selecting the users you wish to grab and pasting them into an Excel spread sheet.
  6. Copying the whole HTML line for each user and paste it in your spreadsheet. It may require of you to do some minimal tidying up. Essentially, we want to make sure we have all our users under one excel column.
  7. Introduce a Macros script that will strip away all our HTML code for us in a timely manner.

Using Macros to Eliminate HTML Tags

An Excel Macros is a piece of programming code which will run in an Excel environment, and is very handy to automate routine tasks. A macro is an Excel task recording and playback tool. This tool will allow you to record your excel inputs and then play it back to save the hassle of repeating mundane tasks constantly.

For the purpose of this blog, here is the set of instruction to use Macros to strip away your HTML code:

  1. To enter Macros in Excel, go to “View” > “Macros” > “Record Macro…”
  2. You will be presented with a pop-up window. Name the macro appropriately (avoid spaces in Macro name), see below for suggestion. Click “OK” once done.
  3. Now go back to “”View” > “Macros” > “Stop Recording”.
  4. Go back again to “View” > “Macros” this time you want to select “View Macros”.
  5. Select the macros we have just created and click “Edit”. 
  6. This will open a Visual Basic window. Visual Basic for Applications (VBA) window is a programming language that Excel utilises to record your steps as you perform routine tasks in an Excel environment.
  7. Clear preexisting text in the editor window and replace with the following:Sub HTML_Removal() Dim Cell As Range With CreateObject(“vbscript.regexp”) .Pattern = “\<.*?\>” .Global = True For Each Cell In Selection Cell.Value = .Replace(Cell.Value, “”) Next End With End Sub
  8. Your editor should now look like the image below. Click the “Save” icon to save this.
  9. When saving, please make sure to save it as an Excel Macro-Enabled Workbook.
  10. Select your entire User list in the spreadsheet. The Macros will affect anything you select.
  11. Go to “View” > “Macros” > “View Macros”.
  12. Select the Macros we just saved.
  13. Click “Run” to execute your Macros.
  14. Clicking on the arrow will open up nested HTML content specific to the area you’re digging in.
  15. Blue shaded selection panel allows you to determine which section of the web page you’re looking at.
  16. As an added aid, Chrome’s Designer Tool tags the selected area with the corresponding line of HTML code you’re currently selecting. In the example below, that is Div#DeltaPlaceHolderMain

Access More of Our Tech Support Articles

If you benefited from this article on extracting PWA Security Group Usernames, check out our other Tech Support Articles on Extracting PWA Usernames in Bulk, Workflows Invalid Data Error, and Updating Sharepoint Fields!