Skip Ribbon Commands
Skip to main content

Quick Launch

Todd Klindt's home page > Todd Klindt's Office 365 Admin Blog > Posts > Automating Attorney Files and Case Folders Creation in SharePoint
July 13
Automating Attorney Files and Case Folders Creation in SharePoint

In my last masterpiece, Tackling SharePoint's 5000 Item Limit with PowerShell and Search, I show how to use PowerShell with Search to return more than 5000 items from a SharePoint list or library, even if SharePoint refuses to return more than 5000 items. Pretty impressive, right? When demonstrating something like that you need a list or library with more than 5000 items. There are are a lot of scripts out there that can create test data, but I needed something specific. So, I opened up a new windows in VS Code and got to coding.

The PowerShell function I wrote is Add-AttorneyFiles, which is designed to streamline the creation of attorney files and case folders. Lots and lots of them.

This function has a few parameters to tailor the files and folders it creates. It accepts two mandatory parameters, AttorneyCount and CaseCount, specifying the number of attorneys and case folders to create for each attorney.

There are also a few switch parameters that allow you to customize the function's behavior further. You can choose to create a file in each case folder using the CreateStaticFile switch, or specify that only closed or client case folders should be created with the OnlyClosedCases and OnlyClientCases switches.

You can also specify the name of the static file created using the StaticFileName parameter. If no name is provided, the function will default to creating a file named "readme.txt".

The function starts by checking if a connection to a SharePoint site exists. If it does, the function creates attorney files and case folders in a SharePoint directory. The names for these attorney files are generated randomly from a list of common first and last names. This randomness helps to create a more realistic environment for testing.

Once the list of attorney names is created, the function will loop through each attorney, creating the appropriate case folders, either client case folders, closed case folders, or both, based on the parameters passed in.

The function gives the folders and files it creates a randomly generated last and first name, along with a random case number, for a more realistic setup.

If the CreateStaticFile switch is present, a static file will be created in each case folder. The content of these static files is a random selection of words, downloaded from a free online dictionary. This randomization also contributes to a more realistic testing environment.

Here's an example of how you might use this function:

Add-AttorneyFiles -AttorneyCount 10 -CaseCount 5 –CreateStaticFile


This will create 10 attorney folders, each with 5 case folders. A static file named "readme.txt" will be created in each case folder. For my blog a created a whole lot of autorun.inf files.

By automating the setup of this testing environment, I was able to generate a high volume of test data, with a format that accurately represented my client’s data, without exposing any of it.

I’ve uploaded the code to GitHub. Check it out.

Happy PowerShelling, and as always, feel free to drop any questions or comments below!




Re: Automating Attorney Files and Case Folders Creation in SharePoint

Vacation Zone best travel company based in the USA The USA, Canada, India, Asia Europe, Caribbean, and Dubai Trips as you want!Indian tours in USA
 on 10/1/2023 3:53 AM


Welcome to , your trusted online guide for smart financial decisions. In a world where financial literacy is crucial, Money Mentor is your free personal finance money coach, dedicated to empowering individuals, especially the younger generation, with the knowledge and skills they need to navigate the complex realm of mentor
 on 10/1/2023 5:30 AM

Re: Automating Attorney Files and Case Folders Creation in SharePoint

Looking for a local Electrician in Clearwater, FL? Call Montgomery Electrical Services, a licensed and insured contractor with over 20 years of experience. Explore our top-quality residential and commercial electrical solutions today!
 on 10/1/2023 7:15 AM

Re: Automating Attorney Files and Case Folders Creation in SharePoint

Elevate Your Workspace with curved monitor - Explore! Upgrade your computer setup with competitively priced curved monitors. Click here to browse our collection.
 on 10/1/2023 8:19 AM


Looking for the best online business india Join Livegood With Gary on Telegram for expert guidance and a supportive community. Learn more and explore our website!
 on 10/2/2023 3:40 AM

Re: Automating Attorney Files and Case Folders Creation in SharePoint

Looking for a top-notch cnc machine shop near you? Suwanee Machine Shop in Suwanee, GA, is your trusted partner for machining, welding, and fabrication. Visit us today!
 on 10/2/2023 3:52 AM


Looking for interior design ideas for your small house? Decorology offers a wealth of inspiration and interior design images
 on 10/2/2023 3:57 AM


Lightning Mobile Electricthe leading provider of industrial and commercial lighting services in Denver, Aurora, Centennial, Westminster, Colorado, Utah, and Wyoming, offers 24/7 emergency assistance and a comprehensive range of electrical services. Contact us now for superior service and energy-efficient lighting solutions.Colorado Industrial Lighting
 on 10/3/2023 5:04 AM

Re: Automating Attorney Files and Case Folders Creation in SharePoint

Normal appointments listed here are the easiest method to thanks for the work, that means that I am going to the website daily, searching for brand new, fascinating data. Numerous, thank you!슬롯사이트슬롯사이트/
 on 10/7/2023 3:46 AM

Re: Automating Attorney Files and Case Folders Creation in SharePoint

Fantastic submit, Many thanks regarding revealing This kind of information. Fantasticly composed write-up, only if almost all people supplied the identical amount of articles when you, the net would have been a greater spot. You should keep writing!Blue Vibe CBD Gummies
 on 10/9/2023 1:48 AM
1 - 10Next

Add Comment

Items on this list require content approval. Your submission will not appear in public views until approved by someone with proper rights. More information on content approval.


Body *

Today's date *

Select a date from the calendar.
Please enter today's date so I know you are a real person


Want a message when I reply to your comment? Put your Twitter handle here.