Link to home
Create AccountLog in
Avatar of Terellion
TerellionFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Checking if User Folder Exists, if not email

Hi guys! Spent ages looking online and not found anything concrete, basically we have an active directory environment with different OU's for each sites and within each site has users in.

We have a data server with a folder for each user on (NTname format) for example test1, test2, test3 all separate folders.

I'd like to report on if a user in a particular OU has a folder on the data server or not, if it doesn't then to email advising of this. Hope this makes sense! I have a funny feeling it would be something like Get-ADUSer "Test1" and then to Test-Path if a folder exists (\\server1\users\test1"). if it doesn't exist then to email.

Thanks so much!
ASKER CERTIFIED SOLUTION
Avatar of footech
footech
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of Terellion

ASKER

That is absolutely fantastic. Precisely what I needed! THANK YOU SO MUCH :)