Author Details

avatar-teacher

Anusha Tottadi – Certified Microsoft 365 Developer at Evolvous Limited.

We are a team of tech enthusiast and this section is where we love to share our experience and our knowledge. We try our best to help you understand technical topics by giving you live instances of how-to’s, guides, tips, FAQ’s and troubleshoots.

If you like it or have questions, do share your feedback in the comments section below.

PowerShell script to find out the file path length more than certain characters from network drive Or FE (File Explorer)

We have many folders in a network drive that have certain characters in length. Problem is that it is too time consuming to go through all the folders in FE (file explorer) to find out the file paths exceeds certain characters.

Here is a quick way to get a list of file paths that exceed certain limit in a network drive or FE.

$Output=
foreach($item in Get-ChildItem -Path "C:UsersAnushaTottadiOneDrive - Evolvous LimitedData" -Recurse -Force)
{
if($item.fullname.length -gt 150)
{ Write-Output $item.fullname }
}
$output | Out-File "C:UsersAnushaTottadiDesktopFile.csv"

Note:

  • Here you need to change the path according to your requirement.
  • Also, I have mentioned the limit as 150 characters and you can change it according to your requirement.
  • And saved the output file with the name of “File.csv”
  • File.csv will have the full path of the files which exceeds 150 characters in length.

PowerShell script to get the network drive/ FE(File Explorer) access denied folders information.

We have many folders in a network drive that may have access or not. Problem is that it is too time consuming to go through all the folders in FE (file explorer) to check for the access.

Here is a quick way to get a list of folder paths that don’t have access to.

Get-ChildItem -Path “C:UsersAnushaTottadiOneDrive – Evolvous LimitedData” -Recurse -Force -ErrorVariable err

$err | Out-File "C:UsersAnushaTottadiDesktopAccess Denied.txt"

Note:

  • Here you need to change the path according to your requirement.
  • And saved the output file with the name of “Access Denied.txt”
  • Access Denied.txt will have the folder paths that don’t have access to.