HelloID-Task-SA-Target-NTFS-FolderCreate

Prerequisites

  • HelloID Directory Agent
  • The HelloID Service account requires the following permissions:
    • Write Access on the folder (NTFS permissions, so not Share permissions on the Share).
    • When applicable Write Access on the folder/share itself (Share permissions, not NTFS permissions on the folder(s)).

Description

This code snippet executes the following tasks:

  1. Define a hash table $formObject. The keys of the hash table represent the properties for the New-Item cmdlet, while the values represent the values entered in the form.

To view an example of the form output, please refer to the JSON code pasted below.

{
    "DisplayName": "Sales2",
    "Path": "\\\\contoso.local\\Storage\\Projects\\"
}

❗ It is important to note that the names of your form fields might differ. Ensure that the $formObject hashtable is appropriately adjusted to match your form fields. More about the cmdlet New-Item -ItemType Directory See the Microsoft Docs page

  1. Verify if the provided parent folder exists

  2. Calls the New-Item cmdlet with the switch -ItemType Directory to create the new NTFS Folder