Create home directory using powershell

Hi Experts -
Currently AD 11.1.1.5 is deployed. The home directory is been prepopulated at the time of creation of AD account, and there is a custom task called updatehomedir which gets triggered on success response of create user.
The problem is, the customer has 40 domain controllers and if I use the OOTB process tasks, it fails to find the user and gives me an invalid structure error, meaning it is not able to find the user. So when the first request goes for creating the user, it picks up a random domain controller and if the home directory parameter is been sent in the creation request it fails. so, the post user creation task works fine.
The Ad connector creates the home directory with the full permissions to the user on that folder, and also it clears out all the existing permissions. By that, it does not inherits the container permissions. SR said, that it is an ER.
How do I implement it.
The approach that looks feasible is
1. Change the provision attribute mapping for homeDirectory to say customHomeDirectory
2. Disable the home directory update task
3. Call a powershell after creation action
4. In that powershell get the process form value, and run the creation of home directory with appropirate permissions.
And I cannot test it, as the only environment where i have folders is production...
-Thanks
Kunal Jain

After some decompilation I found this
DirectorySecurity dirSecurity = new DirectorySecurity();
PropertyValueCollection pvc = directoryEntry.Properties[ActiveDirectoryConnector.ATT_OBJECT_SID];
SecurityIdentifier sid = new SecurityIdentifier((byte[])pvc[0], 0);
dirSecurity.AddAccessRule(new FileSystemAccessRule(sid, FileSystemRights.FullControl, InheritanceFlags.ContainerInherit | InheritanceFlags.ObjectInherit, PropagationFlags.None, AccessControlType.Allow));
Directory.CreateDirectory(directoryName, dirSecurity);
Does this strip of the permissions of the file admins on the container. that is inheriting is not done????

Similar Messages

  • Create Home Directory using VB Script

    Hello All,
    Did anybody is having VB script to create home directory.
    I can create a folder on the local machine through VB script but I am not able to create a folder on the network share|(like \\servername\Users\%username%).
    If anybody is having a sample code, please post it here.
    Thanks in advance

    nobody? :-(

  • How to create /home directory in a diferent disk ?

    I installed Solaris 11-11-11 on a x4640 with 4 disks:
    How to create /home directory in a diferent disk ?
    Edited by: user1502 on Apr 25, 2012 1:51 PM

    I'm confused. It looks like you already have /home configured:
    <pre># zpool status
    pool: home
    state: ONLINE
    scan: none requested
    config:
    NAME STATE READ WRITE CKSUM
    home ONLINE 0 0 0
    c4t3d0 ONLINE 0 0 0
    errors: No known data errors
    # zfs list
    NAME USED AVAIL REFER MOUNTPOINT
    home 86K 134G 32K /home
    ...</pre>
    What is the problem? Looks like you already have /home configured. Are you sure automounter is not running?
    Try this:
    <pre>zfs set mountpoint=none home
    rm -rf /home
    zfs set mountpoint=/home home</pre>

  • Creating aVirtual directory Using java

    Hai ,
    I am Using windows XP Operating system, I know how to create a directory using java,
    can you please suggest me a procedure to create a virtual(web share ) directory using java.
    waiting for your reply
    Thanks & Regards,
    Naga Raju

    Virtual Programmer is in the to share the directory
    over the Internet.No, that's a file/web server. :) I see, it's a Microsoft term.

  • Error creating home directory - Access is denied.

    Hi,
    I am getting one issue on the task while provisioning homedrive and homedirectory on AD resource.
    Error creating home directory '\\rusehf06\home\rc9782rf': ': Access is denied
    Please help. Thanks in advance.

    These error messages are typically pretty obvious with permission errors. It's getting the correct permissions that is the challenge. I would suggest you start by adding the user whom is in your IT Resource for Active Directory into the local administrators group for the server you are trying to create the folder on. Also, consult with your AD Admins to get it resolved the quickest most likely. Their skill set will be better than what we can provide.
    -Kevin

  • Create Home Directory in NetWare with the OIM 9.1

    I am trying to find out if there is a way to create a NetWare User home directory with OIM 9.1 and the eDirectory Connector?
    Edited by: user11137756 on May 6, 2009 11:42 AM

    I'm confused. It looks like you already have /home configured:
    <pre># zpool status
    pool: home
    state: ONLINE
    scan: none requested
    config:
    NAME STATE READ WRITE CKSUM
    home ONLINE 0 0 0
    c4t3d0 ONLINE 0 0 0
    errors: No known data errors
    # zfs list
    NAME USED AVAIL REFER MOUNTPOINT
    home 86K 134G 32K /home
    ...</pre>
    What is the problem? Looks like you already have /home configured. Are you sure automounter is not running?
    Try this:
    <pre>zfs set mountpoint=none home
    rm -rf /home
    zfs set mountpoint=/home home</pre>

  • How do i create a directory in powershell

    How do i create a directory in power shell

    Hi JRC,
    have youi got some experenance using powershell? please read the documentation md is an alias for the new-item command. whereas mkdir is implemented as a function (powershell v2) so you are able to use the new-item command in order to create a new folder.
    because both command md and mkdir calls new-item.
    If you don´t specifiy a parametername then it´s up to the cmdlet definition as what parameter this value is interpreted.
    get-help new-item lists all available cmlet executables.
    regards Thomas Paetzold visit my blog on: http://sus42.wordpress.com
    'Folder" is NOT an argument for the ItemType.  ItemType only takes "file" and "Directory"
    Hi,
    use this command
    new-item -Name <foldername> -ItemType folder
    regards Thomas Paetzold visit my blog on: http://sus42.wordpress.com
    This is what we get:
    17:47 PS>new-item -Name e:\tests\testfolder -ItemType folder
    New-Item : The type is not a known type for the file system. Only "file" and "directory" can be specified.
    At line:1 char:9
    + new-item <<<<  -Name e:\tests\testfolder -ItemType folder
        + CategoryInfo          : InvalidArgument: (:) [New-Item], PSArgumentException
        + FullyQualifiedErrorId : Argument,Microsoft.PowerShell.Commands.NewItemCommand
    ¯\_(ツ)_/¯

  • Create Home Now in WGM does not create home directory until...

    We are using newest ver. of Leopard on our Xserve and have some issues with Workgroup Manager. We can create new users and specify the location of their HOME, however, when we try to Create Home Now and Save, the directory does not get created! No errors though, just silence and no action. Tried many times and no go.
    UNTIL.... We log in with than new username directly into the server using Remote Desktop. Once logged in to Xserve as local user, the Home Directory magically appears.
    What is happening?

    Not sure what's happening - you can check the logs for clues.
    You can also use createhomedir -a That will create home dirs for all users (and will not touch existing home dirs)
    See here for more info
    http://support.apple.com/kb/TA21050?viewlocale=en_US

  • Creating a Directory using a MacBook Pro

    I am trying to create a directory with photos next to the contact information that can be saved as a pdf so that people can have it in iBooks on their phone.  What is the best program to do this?

    What kind of picture? Screen Shot? Command-Shift 3
    Using the Camera? Check out Photo Booth. It's in your applications folder.

  • Need to create Meeting Request using Powershell with Outlook 2010 / 2013

    We will be creating around 100 meeting request based on data from excel, so planning to migrate it to SQL & using powershell we need to speed-up the progress.
    Script tried :
    http://social.technet.microsoft.com/Forums/scriptcenter/en-US/e88ca51c-62dd-493b-a0d1-ffe6a8696fdf/create-view-in-outlook-2013-using-powershell?forum=ITCG
    http://en.community.dell.com/techcenter/powergui/f/4833/t/19576698.aspx
    http://www.amandhally.net/2013/08/30/powershell-and-outlook-create-and-send-a-new-email-using-powershell-outlooktools-module/
    Do we have any working scripts, i tried few scripts it fails throwing error as below:
    New-Object : Exception calling ".ctor" with "0" argument(s): "Retrieving the COM class factory for component with CLSID 
    {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80080005 Server execution failed (Exception from HRESULT: 
    0x80080005 (CO_E_SERVER_EXEC_FAILURE))."
    At line:2 char:6
    + $o = New-Object Microsoft.Office.Interop.Outlook.ApplicationClass
    +      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidOperation: (:) [New-Object], MethodInvocationException
        + FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.PowerShell.Commands.NewObjectCommand
    You cannot call a method on a null-valued expression.
    At line:4 char:1
    + $a = $o.CreateItem($olAppointmentItem)
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
        + FullyQualifiedErrorId : InvokeMethodOnNull
    Ganapathy

    Hi Ganapathys,
    For the error "failed due to the following error: 80080005", please Make sure that Outlook and Powershell are either both running as a standard user (not elevated) or that they are both running elevated as Administrator. They need to be running at the same
    integrity level to avoid that error.
    Please try to run powershell as standard user without "run as admin".
    If you have any feedback on our support, please click here.
    Best Regards,
    Anna Wang
    TechNet Community Support

  • Creating multiple mailboxes using Powershell for users who already exist in AD

    Hi there,
    Wondering if anyone can help, I am wanting to use Powershell to run a command which references a CSV file to create a mailbox for a user who already exists in AD.
    It needs to reference the username, to ensure the correct user has a mailbox created (as mentioned they exist already in the domain), place them on a specific database (e.g DB1) and assign them an email address as well as possibly an alias email address
    too.
    Can anyone provide me the headings of the CSV file which would be needed as well as the powershell command to run. It would be great too if I could also set the quota sizes for the user at the same time of creating the mailbox, but if not possible or complicated
    I can run a script afterwards to do this. I would only want to warn them when their mailbox is 1.5GB in size and stop them sending when it reaches 2GB. 
    Thanks

    So create a csv file with the following headers and data
    UserID, Alias
    UserID should be the user SamAccountName, and the Alias is the Mailbox Alias that you want to set. Supposing that the csv file is named users.csv and located under C:\ , open the Exchange Management Console and run:
    $users = Import-Csv c:\users.csv
    Foreach ($user in $users) {
    Enable-Mailbox -Identity $user.UserID -alias $user.alias -database 'DB1'
    Set-Mailbox -Identity $user.UserID -IssueWarningQuota 1.5gb -ProhibitSendQuota 2gb 
    Please Mark As Answer if this helps
    ammarhasayen

  • Home Directory using AD bound OSX 10.6.7

    We currently have an 2008 domain that has had the schema extended to support macs. Everything is working very well, except one minor glitch. The Macs can mount users home directories and home sync allows us to sync up data. The problem is the macs create a hidden "Documents" directory at the root of the home directory.
    Is it possible to change this setting? I'd love it if the mac could just target the "My Documents" directory in the same location. I tried cheating on the windows side by renaming the My Documents folder to Documents and hiding it, but the mac out smarted me and created a new hidden folder with a different name.
    Thanks for any input!
    Dennis

    Hi Brody,
    Thanks for the tip.
    I've ran rember and I've ran the apple hardware tests from the CD that came with my MacBook.
    Neither flagged any error, however when I ran the extended tests (from the Apple CD) it paused at 49 mins and never progressed any further.
    Is this an indication of bab memory?
    Thanks,
    Vackar

  • Best way to Create Shared Folder using Powershell

    Hi
    Does anyone have any recommendations on creating a shared folder using PowerShell? I've used new-item to create a folder, is there a way to share it and give specific name?
    Cheers

    Hi Shane,
    I’m writing to just check in to see if the suggestions
    were helpful. If you need further help, please feel free to reply this post directly so we will be notified to follow it up.
    If you have any feedback on our support, please click here.
    Best Regards
    Anna
    TechNet Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • Wrong path while creating Home-directory

    Hello,
    i hope i am in the right directory for my question!
    Under Leopard Server I set up an DNS Server wich works quite good so far...
    When i try to set up the Home-directory for an new user the networkpath is always wrong.
    My normal server adress is : "hale.school.private" the Usergroupmannager always set "afp://hale.private/user"!
    Where can i change this?

    _*Here an Copy of my changeip command:_*
    +hale:~ Administrator$ sudo changeip -checkhostname+
    Password:
    +Primary address = 192.168.2.107+
    +Current HostName = hale.school.private+
    +DNS HostName = hale.school.private+
    +The names match. There is nothing to change.+
    _*And here theproblem in the Workgroupmanager:*_
    Message was edited by: sykane

  • How to restore home directory using time machine

    I had moved my home directory to an external drive.  Unfortunately that drive died a horrible death when one of my cats knocked it off the shelf.  I have Time Machine backups of my home directory, and I would like to restore the entire directory, but I get an error saying that I can't delete the directory because it is required by the system.  Can someone tell me how I can go about performing the restore?
    Thanks!

    Thank you for the information.  I actually figured out slightly different way of doing it.  I had already formatted the replacement drive so that it was again mounted under /Volumes/Primary.  I then navigated to the drive, and entered Time Machine from there.  My old home directory appeared, and I was able to restore successfully.  Once everything was restored I merely changed the location of my home directory from its default location in /Users, and pointed it to the newly restored directory in /Volumes/Primary.

Maybe you are looking for

  • Table Maintenance(SM30) not working for a custom View..

    Hi, I have the below case which is not working at the moment. we have standard table T024 and the requirement is to update the table directly in production. To update the standard table i have created a custom maintenance view on this table and creat

  • My windows xp machine no longer recogniseds the cd rom drive

    Your tech support says something about the fact that your software conflicts with some dvd writers \I can no longer access my dvd writer. the shuffle has never installed right at all, I called support yesterday, got the ipod yesterday. Now you won't

  • Accounts problem

    Hi, I have multiple accounts in Skype and Microsoft since I use it from the very beginning and now I don't remember either the passwords or emails (I can search for the user accounts). I want to delete all of them until I only have 2. I'm trying to d

  • Gl issue

    hi, An invoice was posted in system, Doc. No. *********. For this sale invoice an excise JV was also posted,  Since this invoice was wrong, the excise JV was reversed, and the billing document was also reversed, . All theses documents can be seen thr

  • Abap proxies ( Client and Server proxies)

    Hi Team Good day to you. I am now started doing some example scenarios on ABAP proxies(ie Client and Server proxies). After going through the blogs which are avialable, i am writing this question to you for clarification. As per my understanding, the