Skip to main content

HelloID

Directory scripts

For more information, see Directories and AD target system variable reference.

In the directory and profile scripts, you get $person, $manager, $accountReference, $managerAccountReference, and $account objects. Use them to build up the $configuration object, which is then returned to HelloID inside $result.

Caution

Do not attempt to directly create any directories in these scripts. The purpose of the scripts is only to build up the $configuration object and return it to HelloID. HelloID then creates the directories for you, and manages their state.

Optionally, put any debug code (e.g., logging) inside the if($dryRun -eq $True) statement. See $dryRun.

For reference, here is the default Home script. All directory scripts follow the same template.

#Initialize default properties
$p = $person | ConvertFrom-Json;
$m = $manager | ConvertFrom-Json;
$a = $accountReference | ConvertFrom-Json;
$ma = $managerAccountReference | ConvertFrom-Json;
$u = $account | ConvertFrom-Json;

$path = "\\localhost\c$\test\home\";
$archivePath = "\\localhost\c$\test\archive\home\";

$configuration = [PSCustomObject]@{
    Enabled = $TRUE;
    SetAttribute = $TRUE;
    Drive = "F:";
    Path = $path + $u.SamAccountName;
    Archive = $TRUE;
    ArchivePath = $archivePath + $u.SamAccountName;
}

if($dryRun -eq $True) {
    Write-Verbose -Verbose "Dry run for determining the home directory"
}

$success = $True;

#build up result
$result = [PSCustomObject]@{
	Success = $success;
	Configuration = $configuration;
};

#send result back
Write-Output $result | ConvertTo-Json -Depth 2