Creating Xtemp and Ytemp temporary folders

Ask your PowerShell-related questions, including questions on cmdlet development!
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Post Reply
Posts: 1
Last visit: Wed Jun 22, 2022 9:28 am

Creating Xtemp and Ytemp temporary folders

Post by mikedazzle99 »

Need help creating a powershell script for automatically creating Xtemp and Ytemp temporary folders with permissions
The folders to be created have the following path

The users should have write access within these folders

Looking to create a powershell script that takes the username as an input parameter, and executes the following file system operations
Create the user-folder \\contoso.local\home\homeshare\<username>

Disable inheritance at the level \\contoso.local\home\homeshare\<username> and convert all inherited file system permissions to explicit permissions

Change owner to <username>

Give the following groups Full Control:


Give the <username> Read & Execute Permissions

Remove all other permissions from the <username> folder

Create the folder called “home” within the <username> folder

Create the XTemp folders \\contoso.local\home\homeshare\<username>\home\Xtemp\Xtemparchive

Create the Ytemp folders \\contoso.local\home\homeshare\<username>\home\Ytemp

Add Modify-permissions for <username> at the level \\akelius01.intern\home\homeshares\<username>\Home\d3_temp\

Add Modify-permissions for <username> at the level \\contoso.local\home\homeshare\<username>\home\Ytemp
Posts: 15221
Last visit: Wed Jun 29, 2022 5:42 pm
Answers: 23
Has voted: 4 times
Been upvoted: 21 times

Re: Creating Xtemp and Ytemp temporary folders

Post by jvierra »

Unfortunately, technical forums are not places to ask for free code writing or consulting. You can find many coders on the Internet who will write code for you for a reasonable fee.

You can also access the resources and videos on this site that will help you learn how to write PowerShell code.
Post Reply