Jump to content

Any way to automate user logins to create redirected folders enmass?!


Recommended Posts

Posted

We have folder redirection setup here on our Windows Server 2012 r2 environment, so when we create users and they login, a home folder is created in users$ and their "documents" path is redirected to this folder.

 

Unfortunately, I have 300 Continuous Assessment accounts to create. I have created the account by importing them in bulk in ManageEngine ADManager, but now need to log into every account in order to create the folder so I can copy the files into these folders.

 

Is there any method we can use to automate this? I have googled and looked at ADManager Automation but no "user login" option is available, only create user, delete user, etc.

 

Any ideas would be appreciated.

 

Thanks everyone

Posted

do a AD dump of the users and in excel use the concanate function to create script that copys the files to the location, drag it down the spreadsheet and copy the contents into notepad and save as batch file.

 

This is how I copy files etc to my student users copy c:\year2photos\*.* "Y:\username\Documents\My PICTURES"

Posted

Powershell can handle this pretty easily, either importing the account names via csv or straight from AD.

 

CSV:

 

$Students = Import-Csv C:\Path\To\File.csv
$InheritanceFlag = [system.Security.AccessControl.InheritanceFlags]::ContainerInherit -bor [system.Security.AccessControl.InheritanceFlags]::ObjectInherit
$PropagationFlag = [system.Security.AccessControl.PropagationFlags]::None
$objType = [system.Security.AccessControl.AccessControlType]::Allow 

foreach ($student in $students)
{
$folder = \\server\path\$student
New-Item -Path $folder -Type Directory
$acl = Get-Acl -Path $folder
$permission = "\$student","FullControl", $InheritanceFlag, $PropagationFlag, $objType
$accessRule = New-Object System.Security.AccessControl.FileSystemAccessRule $permission


$acl.SetAccessRule($accessRule)
Set-Acl -Path $Folder -AclObject $acl
}

 

AD (needs to be run from a DC or something with RSAT powershell installed):

 

$students = Get-ADUser -filter * -Searchbase "OU=Assessment,OU=Students,OU=Users,DC=Domain,DC=Local"
$InheritanceFlag = [system.Security.AccessControl.InheritanceFlags]::ContainerInherit -bor [system.Security.AccessControl.InheritanceFlags]::ObjectInherit
$PropagationFlag = [system.Security.AccessControl.PropagationFlags]::None
$objType = [system.Security.AccessControl.AccessControlType]::Allow 

foreach ($student in $students)
{
$folder = "\\Server\Path\$($student.Samaccountname)"
New-Item -Path $folder -Type Directory
$acl = Get-Acl -Path $folder
$permission = "\$($student.Samaccountname)","FullControl", $InheritanceFlag, $PropagationFlag, $objType
$accessRule = New-Object System.Security.AccessControl.FileSystemAccessRule $permission


$acl.SetAccessRule($accessRule)
Set-Acl -Path $Folder -AclObject $acl
}

Posted (edited)

I know a manual bulk way. In AD Select all the accounts and under the profile section choose a drive letter and then enter \\nameofserver\users$\%username% and click OK. This ( if you have the permissions right) will create all the folders needed under user$ and give each user full permissions. You just then need to setup folder redirection in group policy if you haven't done already.

 

I hope I understood your request correctly!!!

 

Edit: No I didn't understand it fully lol. We had the same issue as you. We created a separate desktop for our assessments and put the fikes on there. The desktop background explained that they had to copy these files into their home folder before they opened them. It worked. On the few occasions students didn't follow instructions the exams officer knew that they hadn't done that and showed them where to save it. Worked really well for us.

Edited by harriuk
Posted

Thanks every one for your responses.

 

Edit: No I didn't understand it fully lol. We had the same issue as you. We created a separate desktop for our assessments and put the fikes on there. The desktop background explained that they had to copy these files into their home folder before they opened them. It worked. On the few occasions students didn't follow instructions the exams officer knew that they hadn't done that and showed them where to save it. Worked really well for us.

 

Thanks for this, this is useful to hear. This might be a possibility for us then. I will look into the feasibility of this (our exam invigilators aren't very IT literate!)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...