Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I tried the following to create a user and assign a home directory to the user.

$comp = [ADSI]'WinNT://localhost,computer';
$user = $comp.Create('User', 'account14');
$user.SetPassword('Welcome1$');
$user.put('HomeDirectory','C:\Users\account14');
$user.SetInfo();

Here the directory accountis not already present. So ideally it should be created and assigned as the home directory. If we check the properties of the user account14, C:\Users\account14 is listed as the local path, but the directory is not created. In the properties dialogue box of the user, under the profile tab if we click apply, the directory gets created.

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.