Re: AD user home folder creation
- From: "Pete Gomersall" <pete.gomersall@xxxxxxx>
- Date: Tue, 20 Jun 2006 11:09:48 -0700
Thanks ozzie,
I had all of this including the permissions but was wanting a "cleaner way"
and an explanation of why the GUI works and a script doesn't.
Pete
"ozzie" <ozzie@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:9FCB30F9-756F-4AE8-BB16-64CEA66FD125@xxxxxxxxxxxxxxxx
I think the rationale is that if you want to use the GUI - use the GUI
otherwise if you are scripting you probably want more control and
flexibility
over the entire process anyhow.
As far as the code to create the folder:
Sub CreateHomeFolder(drivePath)
'=====================
'create a home folder on a server
'=====================
dim fso
dim fldUserHomedir
Set fso = CreateObject("Scripting.FileSystemObject")
If Not fso.FolderExists(drivePath) Then
Set fldUserHomedir = fso.CreateFolder(drivePath)
End If
End Sub
That's it...unless you want to go and start setting permissions, but even
that isn't too much more.
"Pete Gomersall" wrote:
Hi all,
Is the anyone out there who can answer this one?
When you create an AD user, using the GUI and specify a home folder in
the
following manner:
\\server\sharename\folder\%USERNAME% then the folder is created if it
doesn't exist (obviously if the user has appropriate permissions to the
share).
So I have a wonderful little vbscript that will do great things adding a
bunch of users to AD and set all their properties etc - exactly how I
want.
However, the script writing to AD doesn't invoke creating the users home
folder (if it doesn't exist) by expanding the username variable.
I have seen several script methods that use FSO to create the folder and
CACLS to modify permissions, but isn't there a way to invoke the
functionality of the GUI directly using some method/function of ADSI? Why
this hindrance to achieving the same thing through scripting or am I
missing
something?
Can someone explain?
Cheers,
Pete Gomersall
.
- References:
- AD user home folder creation
- From: Pete Gomersall
- AD user home folder creation
- Prev by Date: UNIX attributes in user accounts in W2K3 R2
- Next by Date: Re: How can I check %time% for a process to run
- Previous by thread: AD user home folder creation
- Next by thread: Re: Task Manager
- Index(es):
Relevant Pages
|