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

image


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!

tk

ShortURL: https://www.toddklindt.com/PoshAttorneyFiles

Comments

Re: Automating Attorney Files and Case Folders Creation in SharePoint

I quite like ones putting up. Their okay to view that you make clear throughout words and phrases while using heart as well as solution on this crucial subject can often be without difficulty considered.
blog comments https://www.fiverr.com/s/bd8lGGp
 on 9/5/2024 11:10 AM

Im glad I now registered https://briansclub.ski

Excellent blog here! Additionally your website lots up very fast!
What web host are you the use of? Can I get your affiliate hyperlink on your host?
I want my site loaded up as fast as yours lol
 on 9/6/2024 10:49 AM

I am the new girl https://briansclub.kz

Pretty nice post. I just stumbled upon your weblog
and wanted to say that I have truly enjoyed browsing your
blog posts. After all I will be subscribing to your rss feed and I hope
you write again soon!
 on 9/6/2024 11:00 AM

Just want to say Hi. https://briansclub.ac

Amazing! Its really awesome piece of writing,
I have got much clear idea regarding from this post.
 on 9/6/2024 11:46 AM

I am the new girlhttps://basetools.store

Do you have a spam issue on this blog; I also am a
blogger, and I was wondering your situation; we have created some nice
methods and we are looking to trade techniques with others,
be sure to shoot me an e-mail if interested.
 on 9/9/2024 2:49 PM

I am the new onehttps://kfcclub.to

Hi, this weekend is nice in support of me, for the reason that this time i am
reading this enormous informative article here at my home.
 on 9/10/2024 3:37 PM

I am the new girl https://bclubb.to

I truly love your website.. Pleasant colors & theme.
Did you create this website yourself? Please reply back as I'm hoping to create my very own website
and would like to find out where you got this from or exactly what the theme is named.
Thanks!
 on 9/15/2024 2:12 AM

I am the new one https://bclub.vin

Hi, its fastidious paragraph regarding media print, we all be familiar with media is a
enormous source of information.
 on 9/19/2024 11:12 PM

 https://retrobowl-game.io/

The automation of attorney files in SharePoint with PowerShell is such an efficient process, making case management simpler. It’s like how Retro Bowl keeps gameplay smooth and strategic. Great innovation!

 on 10/1/2024 1:28 AM

Just wanted to say Hi.

이 글이 많은 사람들에게 도움이 되길 바랍니다.

먹튀제보
검증된 사이트
http://totoper.com/
 on 10/10/2024 5:56 PM

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.

Title


Body *


Today's date *

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

Twitter


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

Attachments

 

 SysKit