Re: AD user home folder creation

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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





.



Relevant Pages

  • Re: "Recovered Files" Always in Trash
    ... What the script did was to set the permissions correctly on your invisible ... Temporary Items folder. ... Thanks for the advice and the script. ...
    (microsoft.public.mac.office.word)
  • Problem Creating HomeDirectories and Permissions using VBScript
    ... and assigning permissions to it in a VBScript script. ... it creates the setting for the folder inside the ...
    (microsoft.public.win2000.active_directory)
  • Re: Logon Script Elevated Privileges
    ... script within the GPO if you want, such as selecting from between user ... I'm using XCacls.vbs to create the permissions structure. ... the root folder to create the folder, ...
    (microsoft.public.windows.group_policy)
  • Re: Logon Script Elevated Privileges
    ... script within the GPO if you want, such as selecting from between user ... I'm using XCacls.vbs to create the permissions structure. ... > the root folder to create the folder, ... >> of a GPO using elevated privileges. ...
    (microsoft.public.windows.group_policy)
  • Re: Deny _WRITE_ access to a file
    ... > trying to talk about was a STARTUP script (if I'm not mistaken, ... > script runs as BUILTIN\SYSTEM). ... If it is possible to script a permissions change such that the ... folder remains read/write for everyone except for the restricted group who ...
    (microsoft.public.security)