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

Edited by vs49688: n/a

7 Years
Discussion Span
Last Post by vs49688

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

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.