I want to run a process that will create server folders for all of my users. I know i can user get-adusers to pull the samaccoutnname to pull the name i want to create for each folder but i want to pipe that name straight into creating the folder.
So if i run this:
get-aduser -filter * -Searchbase "ou=Computer Users,dc=mydomain,dc=com"|select-object samaccountname
Can i just pipe that into a if statement that uses test-path to check if the folder exists then if it doesn't create the folder or do i need to do as i used to in a regular programming language and feed each item one at a time? thanks.