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.
This topic is 1 year and 8 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
mikedazzle99
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

\\contoso.local\home\homeshare\<username>\home\Xtemp\Xtemparchive
\\contoso.local\home\homeshare\<username>\home\Ytemp
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:

SYSTEM
Administrators
GroupA
GroupB

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
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 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.
This topic is 1 year and 8 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked