Member Avatar

I have a domain called "OMNIA" on Server 2008 R2, in which the domain users are created by a script. The script creates a folder for that user and assigns them full access at both a folder and network level. However, whenever I log on as a created user and try to modify the contents of the folder, it throws up an Access Denied error message.
I have tried to grant the user full access and ownership of the folder through the Windows GUI, but I still get the same error. Does anyone have any idea why this is happening and if there is any way to fix it?

This is the contents of "addstaff.bat":

@echo off
rem %1 -> First Name
rem %2 -> Surname

set PASSWORD=DefaultPwd01
net user %2.%1 %PASSWORD% /add /profile:\\\Profiles\Default /domain

net group "Staff" %2.%1 /add /domain

mkdir "E:\Profiles\%2.%1"
mkdir "E:\Profiles\%2.%1\My Documents"
mkdir "E:\Profiles\%2.%1\My Documents\My Music"
mkdir "E:\Profiles\%2.%1\My Documents\My Pictures"
mkdir "E:\Profiles\%2.%1\My Documents\My Video"
mkdir "E:\Profiles\%2.%1\My Documents\Downloads"

icacls \\\Profiles\%2.%1 /grant:r OMNIA\%2.%1:(OI)(CI)(F) /T /C
icacls E:\Profiles\%2.%1 /grant:r OMNIA\%2.%1:(OI)(CI)(F) /T /C

Recommended Answers

All 2 Replies

Is the 192 address you populated correct? It looks like a gateway address to me.

Member Avatar

Yes is it, our gateway is

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.